V-Gears 0
Free Final Fantasy VII engine.
Formation.h
Go to the documentation of this file.
1/*
2 * V-Gears
3 * Copyright (C) 2022 V-Gears Team
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <string>
20#include "common/TypeDefine.h"
21#include "data/GameData.h"
22
26struct Formation{
27
31 enum class Layout{
32
36 NORMAL = 0,
37
44 PREEMPTIVE,
45
52 BACK_ATTACK,
53
60 SIDE_ATTACK,
61
66 PINCER_ATTACK,
67
73 LOCKED
74 };
75
79 struct Enemy{
80
84 unsigned int id;
85
89 int x;
90
94 int y;
95
99 int z;
100
104 unsigned int row;
105
146 char cover[5];
147
152
157
162
167
174 id(0), x(0), y(0), z(0), row(0), visible(true),
176 {
177 for (int c = 0; c < 5; c ++) cover[c] = '0';
178 }
179 };
180
184 struct Camera{
185
189 int x;
190
194 int y;
195
199 int z;
200
204 int d_x;
205
209 int d_y;
210
214 int d_z;
215
221 Camera(): x(0), y(0), z(0), d_x(0), d_y(0), d_z(0){}
222 };
223
227 unsigned int id;
228
233
238
243
248
255
260
265
269 std::vector<Enemy> enemies;
270
278
284 std::string location_name;
285
289 std::vector<Camera> camera_positions;
290
295
300
305
312 id(0), next_formation(-1), escape_counter(0.0f), escapable(true), skip_victory_pose(false),
313 skip_spoils(false), preemptive_disabled(false), layout(Layout::NORMAL), location(-1),
315 {
316 enemies.clear();
317 camera_positions.clear();
319 }
320
321};
Position for a camera.
Definition: Formation.h:184
int x
X position.
Definition: Formation.h:189
Camera()
Constructor.
Definition: Formation.h:221
int y
Y position.
Definition: Formation.h:194
int z
z position.
Definition: Formation.h:199
int d_z
z direction.
Definition: Formation.h:214
int d_x
X direction.
Definition: Formation.h:204
int d_y
Y direction.
Definition: Formation.h:209
Each enemy in the formation.
Definition: Formation.h:79
int z
Enemy Z position.
Definition: Formation.h:99
int y
Enemy Y position.
Definition: Formation.h:94
unsigned int row
Enemy row.
Definition: Formation.h:104
bool targeteable
Indicates if the enemy is targeteable.
Definition: Formation.h:161
bool main_script_active
Definition: Formation.h:166
bool visible
Indicates if the enemy is initially visible.
Definition: Formation.h:151
int x
Enemy X position.
Definition: Formation.h:89
int direction
Indicates initial direction facing if players get a side attack.
Definition: Formation.h:156
char cover[5]
Cover flags.
Definition: Formation.h:146
Enemy()
Constructor.
Definition: Formation.h:173
unsigned int id
Enemy ID.
Definition: Formation.h:84
An enemy formation.
Definition: Formation.h:26
bool skip_victory_pose
If true, the victory pose will be played after the battle.
Definition: Formation.h:247
bool is_arena_battle
Indicates if the formation is an arena battle.
Definition: Formation.h:299
bool skip_spoils
If true, spoils (item, ap, money...) will not be obtained after the battle.
Definition: Formation.h:254
int next_formation
When all enemies are defeated, begin battle with this ID without ending battle scene.
Definition: Formation.h:232
std::vector< Enemy > enemies
The enemies in the formation.
Definition: Formation.h:269
std::vector< Camera > camera_positions
Camera positions.
Definition: Formation.h:289
Formation()
Constructor.
Definition: Formation.h:311
std::vector< int > next_arena_formation_candidates
FOr arena battles, candidates fro the next formation.
Definition: Formation.h:304
bool escapable
Indicates if the battle can be escaped.
Definition: Formation.h:242
std::string location_name
Location name.
Definition: Formation.h:284
Layout
Battle layouts.
Definition: Formation.h:31
int location
Location ID.
Definition: Formation.h:277
int initial_camera_position
Index of the initial camera position.
Definition: Formation.h:294
Layout layout
Battle layout.
Definition: Formation.h:264
float escape_counter
Difficulty to escape.
Definition: Formation.h:237
unsigned int id
Formation ID.
Definition: Formation.h:227
bool preemptive_disabled
If false, this battle can never be preemtied.
Definition: Formation.h:259