V-Gears 0
Free Final Fantasy VII engine.
Attack.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 Attack{
27
31 struct Damage{
32
39
44
48 bool magical;
49
54
59
63 float accuracy;
64
69
74
79
84
89
94
99
100 };
101
106
111
115 float chance;
116
120 unsigned int type;
121 };
122
126 struct Target{
127
135
143
152
161
169
178
185
192 bool random;
193
198
203 };
204
208 struct Animation{
209
216
223
228
235 int sound;
236
244
252 };
253
258
262 std::string name;
263
268
275
280
285
289 std::vector<StatusEffect> status_effects;
290
294 std::vector<unsigned int> elements;
295
300
306 Attack(): id(0), name(""), mp(0), reflectable(false){
307 damage.physical = false;
308 damage.magical = false;
309 damage.power = 0;
310 damage.formula = -1;
311 damage.modifier = -1;
312 damage.accuracy = 1.0f;
315 damage.damage_mp = false;
316 damage.drain_hp = false;
317 damage.drain_mp = false;
319 damage.critical = false;
321 target.default_enemy = false;
322 target.default_multiple = false;
323 target.toggle_multiple = false;
324 target.fixed_row = false;
325 target.short_range = false;
326 target.all_rows = false;
327 target.random = false;
328 target.only_for_dead = false;
329 target.no_re_target = false;
330 animation.effect = -1;
332 animation.hurt_anim = -1;
333 animation.sound = -1;
336 status_effects.clear();
337 elements.clear();
338 }
339};
Ogre::uint16 u16
Definition: TypeDefine.h:22
Ogre::uint32 u32
Definition: TypeDefine.h:23
Ogre::uint8 u8
Definition: TypeDefine.h:21
RestoreType
Determines what an attack (or item) restores.
Definition: GameData.h:253
@ NONE
The attack is not restorative.
Animation data related to the attack;.
Definition: Attack.h:208
int camera_single
Camera movement ID for single target.
Definition: Attack.h:243
int impact_effect
Impact effect.
Definition: Attack.h:222
int camera_multiple
Camera movement ID for multiple target.
Definition: Attack.h:251
int hurt_anim
Index of the animation played by the target when hit.
Definition: Attack.h:227
int effect
Atack effect ID.
Definition: Attack.h:215
int sound
Impact sound.
Definition: Attack.h:235
Attack parameters related to the damage done.
Definition: Attack.h:31
bool affected_by_darkness
Indicates if the accuracy is affected by darkness.
Definition: Attack.h:68
bool physical
Indicates physical damage.
Definition: Attack.h:43
int modifier
The damage modifier.
Definition: Attack.h:58
bool damage_mp
Indicates if the attack damages MP instead of HP.
Definition: Attack.h:78
bool ignore_status_defense
Indicates if the attack ignores status defense.
Definition: Attack.h:93
bool drain_hp
Indicates if the attack drains HP from the target.
Definition: Attack.h:83
bool drain_mp
Indicates if the attack drains MP from the target.
Definition: Attack.h:88
bool magical
Indicates magical damage.
Definition: Attack.h:48
u16 power
The attack power.
Definition: Attack.h:38
int formula
The damage formula.
Definition: Attack.h:53
float accuracy
Probability of the attack to land.
Definition: Attack.h:63
GameData::RestoreType restore
The restore type.
Definition: Attack.h:73
bool critical
If true, the attack will always be critical.
Definition: Attack.h:98
Status effect information.
Definition: Attack.h:105
float chance
Chance of inflicting.
Definition: Attack.h:115
unsigned int type
Inflict/cure/toggle mode.
Definition: Attack.h:120
u8 id
ID of the status effect.
Definition: Attack.h:110
Targeting parameters.
Definition: Attack.h:126
bool random
The target is random.
Definition: Attack.h:192
bool only_for_dead
If true, the attack will miss unless the target is dead.
Definition: Attack.h:197
bool fixed_row
The target group can be changed.
Definition: Attack.h:168
bool default_multiple
The default target is a group.
Definition: Attack.h:151
bool short_range
The command is short ranged.
Definition: Attack.h:177
bool selection_enabled
The target can be selected.
Definition: Attack.h:134
bool default_enemy
The default target is an enemy.
Definition: Attack.h:142
bool all_rows
Targets all, enemies and allies.
Definition: Attack.h:184
bool no_re_target
The attack can be re-targeted if the target is dead.
Definition: Attack.h:202
bool toggle_multiple
The selection can change between groups and individuals.
Definition: Attack.h:160
An attack structure.
Definition: Attack.h:26
bool reflectable
The attack can be reflected.
Definition: Attack.h:284
Target target
Targeting options.
Definition: Attack.h:279
Animation animation
Animation data.
Definition: Attack.h:299
std::vector< unsigned int > elements
Information about the item elements.
Definition: Attack.h:294
u32 id
Attack ID.
Definition: Attack.h:257
std::vector< StatusEffect > status_effects
Information about status change mode and chance.
Definition: Attack.h:289
Attack()
Constructor.
Definition: Attack.h:306
Damage damage
Damage parameters.
Definition: Attack.h:267
std::string name
Attack name.
Definition: Attack.h:262
u16 mp
MP cost.
Definition: Attack.h:274