![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Any enemy in a battle. More...
#include <Enemy.h>
Classes | |
struct | Attack |
Enemy attack data. More... | |
struct | Element |
struct | Immunity |
Status immunity. More... | |
struct | Item |
Data for drop and steal items. More... | |
Public Member Functions | |
Enemy (const unsigned int id) | |
Constructor. More... | |
Enemy (const unsigned int id, const Ogre::Vector3 pos, const bool front, const bool visible, const bool targeteable, const bool active, const std::string cover) | |
Constructor. More... | |
virtual | ~Enemy () |
Destructor. More... | |
const int | GetId () const |
Retrieves the enemy ID. More... | |
void | SetId (const int id) |
Sets the enemy ID. More... | |
const std::string | GetModel () const |
Retrieves the enemy model. More... | |
void | SetModel (const std::string model) |
Sets the enemy model. More... | |
const std::string | GetName () const |
Retrieves the enemy name. More... | |
void | SetName (const Ogre::String &name) |
Sets the enemy name. More... | |
unsigned int | GetLevel () const |
Retrieves the enemy level. More... | |
void | SetLevel (const unsigned int level) |
Sets the enemy level. More... | |
unsigned int | GetAp () const |
Retrieves the AP gain upon defeating the enemy. More... | |
void | SetAp (unsigned int ap) |
Sets the AP gain upon defeating the enemy. More... | |
unsigned int | GetExp () const |
Retrieves the EXP gain upon defeating the enemy. More... | |
void | SetExp (const unsigned int exp) |
Sets the EXP gain upon defeating the enemy. More... | |
unsigned int | GetMoney () const |
Retrieves the money gain upon defeating the enemy. More... | |
void | SetMoney (const unsigned int money) |
Sets the money gain upon defeating the enemy. More... | |
std::vector< unsigned int > | GetAnimations () const |
Retrieves the enemy animation IDs. More... | |
void | AddAnimation (const unsigned int animation) |
Adds an animation for the enemy. More... | |
std::vector< Attack > | GetAttacks () const |
Retrieves the enemy attacks. More... | |
void | AddAttack (const Attack attack) |
Adds an attack for the enemy. More... | |
std::vector< Item > | GetDrop () const |
Retrieves the enemy possible item drops. More... | |
void | AddDrop (const Item item) |
Adds an item drop for the enemy. More... | |
std::vector< Element > | GetElements () const |
Retrieves the list of the enemy elemental affinities. More... | |
void | AddElement (const Element element) |
Adds an elemental affinity to the monster. More... | |
std::vector< Immunity > | GetImmunities () const |
Retrieves the list of status immunities. More... | |
void | AddImmunity (const Immunity immunity) |
Adds an immunity to the monster. More... | |
std::vector< unsigned int > | GetManipulateAttacks () const |
Retrieves the list of attacks that can be used during the manipulated state. More... | |
void | AddManipulateAttack (const unsigned int attack) |
Adds an attack usable during manipulation. More... | |
std::vector< Item > | GetSteal () const |
Retrieves the enemy possible item stelas. More... | |
void | AddSteal (const Item item) |
Adds an item steal to the enemy. More... | |
unsigned int | GetMorph () const |
Retrieves the ID of the item the monster can be morphed into. More... | |
void | SetMorph (const int morph) |
Sets the ID of the item the monster can be morphed into. More... | |
float | GetBackDamage () const |
Retrieves the multiplier for the damage the enemy receives when attacked from the back. More... | |
void | SetBackDamage (const float back_damage) |
Sets the multiplier for the damage the enemy receives when attacked from the back. More... | |
unsigned int | GetStr () const |
Retrieves the enemy's strength stat. More... | |
void | SetStr (const unsigned int str) |
Sets the enemy's strength stat. More... | |
unsigned int | GetDef () const |
Retrieves the enemy's defense stat. More... | |
void | SetDef (const unsigned int def) |
Sets the enemy's defense stat. More... | |
unsigned int | GetMag () const |
Retrieves the enemy's magic stat. More... | |
void | SetMag (const unsigned int mag) |
Sets the enemy's magic stat. More... | |
unsigned int | GetSpr () const |
Retrieves the enemy's spirit stat. More... | |
void | SetSpr (const unsigned int spr) |
Sets the enemy's spirit stat. More... | |
unsigned int | GetDex () const |
Retrieves the enemy's dexterity stat. More... | |
void | SetDex (const unsigned int dex) |
Sets the enemy's dexterity stat. More... | |
unsigned int | GetLck () const |
Retrieves the enemy's luck stat. More... | |
void | SetLck (const unsigned int lck) |
Sets the enemy's luck stat. More... | |
unsigned int | GetEva () const |
Retrieves the enemy's evasion stat. More... | |
void | SetEva (const unsigned int eva) |
Sets the enemy's evasion stat. More... | |
unsigned int | GetMeva () const |
Retrieves the enemy's magic evasion stat. More... | |
void | SetMeva (const unsigned int meva) |
Sets the enemy's magic evasion stat. More... | |
unsigned int | GetHp () const |
Retrieves the enemy's current HP. More... | |
void | SetHp (const unsigned int hp) |
Sets the enemy's current HP. More... | |
unsigned int | GetHpMax () const |
Retrieves the enemy's max HP. More... | |
void | SetHpMax (const unsigned int hp_max) |
Sets the enemy's max HP. More... | |
unsigned int | GetMp () const |
Retrieves the enemy's current MP. More... | |
void | SetMp (const unsigned int mp) |
Sets the enemy's current MP. More... | |
unsigned int | GetMpMax () const |
Retrieves the enemy's max MP. More... | |
void | SetMpMax (const unsigned int mp_max) |
Sets the enemy's max MP. More... | |
Ogre::Vector3 & | GetPos () |
Retrieves the enemy position in the battlefield. More... | |
void | SetPos (const Ogre::Vector3 &pos) |
Sets the enemy position in the battlefield. More... | |
void | ScriptGetPos () const |
Retrieves the enemy position. More... | |
bool | IsFront () const |
Checks if the enemy is in the front row. More... | |
void | SetFront (bool front) |
Sets the enemy in or out the front row. More... | |
bool | IsVisible () const |
Checks the enemy visibility. More... | |
void | SetVisible (bool visible) |
Toggles the enemy visibility. More... | |
bool | IsTargeteable () const |
Checks whether the enemy can be targeted. More... | |
void | SetTargeteable (bool targeteable) |
Determines whether the enemy can be targeted. More... | |
bool | IsActive () const |
Checks whether the enemy's main script is active. More... | |
void | SetActive (bool active) |
Activates or deactivates the enemy main script. More... | |
std::string | GetCover () const |
Retrieves the flags for enemy covering. More... | |
void | SetCover (std::string cover) |
Sets the flags for enemy covering. More... | |
int | ScriptGetAttackCount () |
Retrieves the number of attacks of the enemy. More... | |
int | ScriptGetAttack (const unsigned int index) |
Retrieves an attack. More... | |
int | ScriptGetCameraForAttack (const unsigned int index) |
Retrieves the camera for an attack. More... | |
Enemy () | |
Constructor. More... | |
Public Attributes | |
u32 | id |
The enemy ID. More... | |
std::string | name |
The enemy name. More... | |
u8 | level |
The enemy level. More... | |
u8 | str |
The enemy strength stat. More... | |
u8 | mag |
The enemy magic stat. More... | |
u8 | def |
The enemy defense stat. More... | |
u8 | mdef |
The enemy magic defense stat. More... | |
u8 | spd |
The enemy speed stat. More... | |
u8 | lck |
The enemy luck stat. More... | |
u8 | eva |
The enemy evasion stat. More... | |
u32 | hp |
The enemy HP. More... | |
u32 | mp |
The enemy MP. More... | |
u32 | exp |
Experience given upon defeat. More... | |
u32 | ap |
AP given upon defeat. More... | |
u32 | money |
Money given upon defeat. More... | |
float | back_damage |
Back damage multiplier. More... | |
std::vector< unsigned int > | animations |
List of animations. More... | |
std::vector< Element > | elements |
Elemental affinities. More... | |
std::vector< Immunity > | immunities |
Status immunities and resistances. More... | |
std::vector< Attack > | attacks |
Enemy attacks. More... | |
std::vector< u16 > | manipulate_attacks |
List of attacks that can be used while manipulated. More... | |
std::vector< Item > | steal |
List of the items that can be stolen from the enemy. More... | |
std::vector< Item > | drop |
List of the items that can be dropped from the enemy. More... | |
std::string | model |
Two-letter model code. More... | |
unsigned int | morph |
ID of the item the enemy can be morphed into. More... | |
Private Member Functions | |
void | ReadFromXml () |
Reads enemy data from the xml file. More... | |
Private Attributes | |
int | id_ |
The enemy ID. More... | |
std::string | model_ |
NAme of the enemy model file. More... | |
Ogre::String | name_ |
The name of the enemy. More... | |
unsigned int | level_ |
The enemy level. More... | |
unsigned int | exp_ |
EXP given upon defeating the enemy. More... | |
unsigned int | ap_ |
AP given upon defeating the enemy. More... | |
unsigned int | money_ |
Money given upon defeating the enemy. More... | |
std::vector< unsigned int > | animations_ |
List of animations. More... | |
std::vector< Element > | elements_ |
Elemental affinities. More... | |
std::vector< Immunity > | immunities_ |
Status immunities and resistances. More... | |
std::vector< Attack > | attacks_ |
Enemy attacks. More... | |
std::vector< unsigned int > | manipulate_attacks_ |
List of attacks that can be used while manipulated. More... | |
std::vector< Item > | steal_ |
List of the items that can be stolen from the enemy. More... | |
std::vector< Item > | drop_ |
List of the items that can be dropped from the enemy. More... | |
int | morph_ |
ID of the item the enemy can be morphed into. More... | |
float | back_damage_ |
Multiplier for back damage. More... | |
unsigned int | str_ |
Enemy strength stat. More... | |
unsigned int | def_ |
Enemy defense stat. More... | |
unsigned int | mag_ |
Enemy magic stat. More... | |
unsigned int | spr_ |
Enemy spirit stat. More... | |
unsigned int | dex_ |
Enemy dexterity stat. More... | |
unsigned int | lck_ |
Enemy luck stat. More... | |
unsigned int | eva_ |
Enemy evasion stat. More... | |
unsigned int | meva_ |
Enemy magic evasion stat. More... | |
unsigned int | hp_ |
Enemy's current HP. More... | |
unsigned int | mp_ |
Enemy's current MP. More... | |
unsigned int | hp_max_ |
Enemy's max HP. More... | |
unsigned int | mp_max_ |
Enemy's max MP. More... | |
Ogre::Vector3 | pos_ |
Enemy position in the battlefield (x, y, z). More... | |
bool | front_ |
Indicates if the enmy is in the frontline. More... | |
bool | visible_ |
Indicates if the enemy is visible. More... | |
bool | targeteable_ |
Indicates if the enemy can be targeted. More... | |
bool | active_ |
Indicates if the enemy's main script is active. More... | |
std::string | cover_ |
Cover binary flags. More... | |
Any enemy in a battle.
Enemy::Enemy | ( | const unsigned int | id | ) |
Constructor.
[in] | id | Enemy ID. |
Enemy::Enemy | ( | const unsigned int | id, |
const Ogre::Vector3 | pos, | ||
const bool | front, | ||
const bool | visible, | ||
const bool | targeteable, | ||
const bool | active, | ||
const std::string | cover | ||
) |
Constructor.
[in] | id | Enemy ID. |
[in] | pos | Enemy position (x, y, z). |
[in] | front | True to set the enemy in the front row, false for back row. |
[in] | visible | Indicates enemy visibility. |
[in] | targeteable | Indicates if the enemy can be targeted. |
[in] | active | Indicates whether the enemy main script is active or not. |
[in] | cover | Cover binary flags string. |
|
virtual |
Destructor.
|
inline |
Constructor.
Initializes to default values.
void Enemy::AddAnimation | ( | const unsigned int | animation | ) |
Adds an animation for the enemy.
[in] | animation | Animation ID. |
void Enemy::AddAttack | ( | const Attack | attack | ) |
Adds an attack for the enemy.
[in] | attack | Attack to add. |
void Enemy::AddDrop | ( | const Item | item | ) |
Adds an item drop for the enemy.
[in] | item | The dropable item. |
void Enemy::AddElement | ( | const Element | element | ) |
Adds an elemental affinity to the monster.
[in] | element | Elemental affinity. |
void Enemy::AddImmunity | ( | const Immunity | immunity | ) |
Adds an immunity to the monster.
[in] | immunity | The immunity to add. |
void Enemy::AddManipulateAttack | ( | const unsigned int | attack | ) |
Adds an attack usable during manipulation.
[in] | attack | ID of the attack. |
void Enemy::AddSteal | ( | const Item | item | ) |
Adds an item steal to the enemy.
[in] | item | The stealableitem. |
std::vector< unsigned int > Enemy::GetAnimations | ( | ) | const |
Retrieves the enemy animation IDs.
unsigned int Enemy::GetAp | ( | ) | const |
Retrieves the AP gain upon defeating the enemy.
std::vector< Enemy::Attack > Enemy::GetAttacks | ( | ) | const |
Retrieves the enemy attacks.
float Enemy::GetBackDamage | ( | ) | const |
Retrieves the multiplier for the damage the enemy receives when attacked from the back.
std::string Enemy::GetCover | ( | ) | const |
Retrieves the flags for enemy covering.
{
unsigned int Enemy::GetDef | ( | ) | const |
Retrieves the enemy's defense stat.
unsigned int Enemy::GetDex | ( | ) | const |
Retrieves the enemy's dexterity stat.
std::vector< Enemy::Item > Enemy::GetDrop | ( | ) | const |
Retrieves the enemy possible item drops.
std::vector< Enemy::Element > Enemy::GetElements | ( | ) | const |
Retrieves the list of the enemy elemental affinities.
unsigned int Enemy::GetEva | ( | ) | const |
Retrieves the enemy's evasion stat.
unsigned int Enemy::GetExp | ( | ) | const |
Retrieves the EXP gain upon defeating the enemy.
unsigned int Enemy::GetHp | ( | ) | const |
Retrieves the enemy's current HP.
unsigned int Enemy::GetHpMax | ( | ) | const |
Retrieves the enemy's max HP.
const int Enemy::GetId | ( | ) | const |
Retrieves the enemy ID.
std::vector< Enemy::Immunity > Enemy::GetImmunities | ( | ) | const |
Retrieves the list of status immunities.
unsigned int Enemy::GetLck | ( | ) | const |
Retrieves the enemy's luck stat.
unsigned int Enemy::GetLevel | ( | ) | const |
Retrieves the enemy level.
unsigned int Enemy::GetMag | ( | ) | const |
Retrieves the enemy's magic stat.
std::vector< unsigned int > Enemy::GetManipulateAttacks | ( | ) | const |
Retrieves the list of attacks that can be used during the manipulated state.
The first attack of the list is also the attack the enemy will use when in berserkr state. If the list is empty, the enemy can't be manipulated or berserkred.
unsigned int Enemy::GetMeva | ( | ) | const |
Retrieves the enemy's magic evasion stat.
const std::string Enemy::GetModel | ( | ) | const |
Retrieves the enemy model.
The model name is the filename of the .mesh file, without extension.
unsigned int Enemy::GetMoney | ( | ) | const |
Retrieves the money gain upon defeating the enemy.
unsigned int Enemy::GetMorph | ( | ) | const |
Retrieves the ID of the item the monster can be morphed into.
unsigned int Enemy::GetMp | ( | ) | const |
Retrieves the enemy's current MP.
unsigned int Enemy::GetMpMax | ( | ) | const |
Retrieves the enemy's max MP.
const std::string Enemy::GetName | ( | ) | const |
Retrieves the enemy name.
Ogre::Vector3 & Enemy::GetPos | ( | ) |
Retrieves the enemy position in the battlefield.
unsigned int Enemy::GetSpr | ( | ) | const |
Retrieves the enemy's spirit stat.
std::vector< Enemy::Item > Enemy::GetSteal | ( | ) | const |
Retrieves the enemy possible item stelas.
unsigned int Enemy::GetStr | ( | ) | const |
Retrieves the enemy's strength stat.
bool Enemy::IsActive | ( | ) | const |
Checks whether the enemy's main script is active.
bool Enemy::IsFront | ( | ) | const |
Checks if the enemy is in the front row.
bool Enemy::IsTargeteable | ( | ) | const |
Checks whether the enemy can be targeted.
bool Enemy::IsVisible | ( | ) | const |
Checks the enemy visibility.
|
private |
Reads enemy data from the xml file.
int Enemy::ScriptGetAttack | ( | const unsigned int | index | ) |
Retrieves an attack.
To be used from Lua scripts.
[in] | index | The index of the attack to retrieve. Must be lower than reported by { |
int Enemy::ScriptGetAttackCount | ( | ) |
Retrieves the number of attacks of the enemy.
To be used from Lua scripts.
int Enemy::ScriptGetCameraForAttack | ( | const unsigned int | index | ) |
Retrieves the camera for an attack.
To be used from Lua scripts.
[in] | index | The index of the attack to retrieve. Must be lower than reported by { |
void Enemy::ScriptGetPos | ( | ) | const |
Retrieves the enemy position.
To be used from Lua scripts only. It doesn't return anything, but adds three values to the stack for the X, Y and Z coordinates.
void Enemy::SetActive | ( | bool | active | ) |
Activates or deactivates the enemy main script.
[in] | active | True to activate the script, false to deactivate it. |
void Enemy::SetAp | ( | unsigned int | ap | ) |
Sets the AP gain upon defeating the enemy.
[in] | ap | The AP gain. |
void Enemy::SetBackDamage | ( | const float | back_damage | ) |
Sets the multiplier for the damage the enemy receives when attacked from the back.
[in] | back_damage | Back attack damage multiplier, 0 or positive. |
void Enemy::SetCover | ( | std::string | cover | ) |
Sets the flags for enemy covering.
{
[in] | cover | A string with five 0s or 1s indicating the cover flags. |
void Enemy::SetDef | ( | const unsigned int | def | ) |
Sets the enemy's defense stat.
[in] | def | The defense stat. |
void Enemy::SetDex | ( | const unsigned int | dex | ) |
Sets the enemy's dexterity stat.
[in] | dex | The dexterity stat. |
void Enemy::SetEva | ( | const unsigned int | eva | ) |
Sets the enemy's evasion stat.
[in] | eva | The evasion stat. |
void Enemy::SetExp | ( | const unsigned int | exp | ) |
Sets the EXP gain upon defeating the enemy.
[in] | exp | The EXP gain. |
void Enemy::SetFront | ( | bool | front | ) |
Sets the enemy in or out the front row.
[in] | front | True to set the enemy in the front row, false for the back row. |
void Enemy::SetHp | ( | const unsigned int | hp | ) |
Sets the enemy's current HP.
If set to higher then max HP reported by {
[in] | hp | The current HP. |
void Enemy::SetHpMax | ( | const unsigned int | hp_max | ) |
Sets the enemy's max HP.
If the new max HP is higher than the current HP, the current HP will be set to the new max HP.
[in] | hp_max | The max HP stat. |
void Enemy::SetId | ( | const int | id | ) |
Sets the enemy ID.
[in] | id | The enemy ID. |
void Enemy::SetLck | ( | const unsigned int | lck | ) |
Sets the enemy's luck stat.
[in] | lck | The luck stat. |
void Enemy::SetLevel | ( | const unsigned int | level | ) |
Sets the enemy level.
[in] | level | The enemy level. |
void Enemy::SetMag | ( | const unsigned int | mag | ) |
Sets the enemy's magic stat.
[in] | mag | The magic stat. |
void Enemy::SetMeva | ( | const unsigned int | meva | ) |
Sets the enemy's magic evasion stat.
[in] | meva | The magic evasion stat. |
void Enemy::SetModel | ( | const std::string | model | ) |
Sets the enemy model.
The model name must be the filename of the .mesh file, without extension.
[in] | model | The enemy model name. |
void Enemy::SetMoney | ( | const unsigned int | money | ) |
Sets the money gain upon defeating the enemy.
[in] | money | The money gain. |
void Enemy::SetMorph | ( | const int | morph | ) |
Sets the ID of the item the monster can be morphed into.
[in] | morph | ID of the item the enemy can be morphed into, -1 if none. |
void Enemy::SetMp | ( | const unsigned int | mp | ) |
Sets the enemy's current MP.
If set to higher then max MP reported by {
[in] | mp | The current MP. |
void Enemy::SetMpMax | ( | const unsigned int | mp_max | ) |
Sets the enemy's max MP.
If the new max MP is higher than the current MP, the current MP will be set to the new max MP.
[in] | mp_max | The max MP stat. |
void Enemy::SetName | ( | const Ogre::String & | name | ) |
Sets the enemy name.
[in] | name | The enemy name. |
void Enemy::SetPos | ( | const Ogre::Vector3 & | pos | ) |
Sets the enemy position in the battlefield.
[in] | pos | The enemy position (x, y, z). |
void Enemy::SetSpr | ( | const unsigned int | spr | ) |
Sets the enemy's spirit stat.
[in] | spr | The spirit stat. |
void Enemy::SetStr | ( | const unsigned int | str | ) |
Sets the enemy's strength stat.
[in] | str | The strength stat. |
void Enemy::SetTargeteable | ( | bool | targeteable | ) |
Determines whether the enemy can be targeted.
[in] | targeteable | True to allow targeting the enemy false to prevent it. |
void Enemy::SetVisible | ( | bool | visible | ) |
Toggles the enemy visibility.
[in] | visible | True to make the enemy visible, false to make it invisible. |
|
private |
Indicates if the enemy's main script is active.
std::vector<unsigned int> Enemy::animations |
List of animations.
|
private |
List of animations.
u32 Enemy::ap |
AP given upon defeat.
|
private |
AP given upon defeating the enemy.
float Enemy::back_damage |
Back damage multiplier.
|
private |
Multiplier for back damage.
|
private |
Cover binary flags.
u8 Enemy::def |
The enemy defense stat.
|
private |
Enemy defense stat.
|
private |
Enemy dexterity stat.
std::vector<Item> Enemy::drop |
List of the items that can be dropped from the enemy.
|
private |
List of the items that can be dropped from the enemy.
std::vector<Element> Enemy::elements |
Elemental affinities.
|
private |
Elemental affinities.
u8 Enemy::eva |
The enemy evasion stat.
|
private |
Enemy evasion stat.
u32 Enemy::exp |
Experience given upon defeat.
|
private |
EXP given upon defeating the enemy.
|
private |
Indicates if the enmy is in the frontline.
u32 Enemy::hp |
The enemy HP.
|
private |
Enemy's current HP.
|
private |
Enemy's max HP.
u32 Enemy::id |
The enemy ID.
|
private |
The enemy ID.
std::vector<Immunity> Enemy::immunities |
Status immunities and resistances.
|
private |
Status immunities and resistances.
u8 Enemy::lck |
The enemy luck stat.
|
private |
Enemy luck stat.
u8 Enemy::level |
The enemy level.
|
private |
The enemy level.
u8 Enemy::mag |
The enemy magic stat.
|
private |
Enemy magic stat.
std::vector<u16> Enemy::manipulate_attacks |
List of attacks that can be used while manipulated.
The first one is also the one used in berserkr. If empty, it means the enemy can't be manipulated or berserkd.
|
private |
List of attacks that can be used while manipulated.
The first one is also the one used in berserkr. If empty, it means the enemy can't be manipulated or berserkd.
u8 Enemy::mdef |
The enemy magic defense stat.
|
private |
Enemy magic evasion stat.
std::string Enemy::model |
Two-letter model code.
|
private |
NAme of the enemy model file.
u32 Enemy::money |
Money given upon defeat.
|
private |
Money given upon defeating the enemy.
unsigned int Enemy::morph |
ID of the item the enemy can be morphed into.
If -1, it can't be morphed.
|
private |
ID of the item the enemy can be morphed into.
-1 if none..
u32 Enemy::mp |
The enemy MP.
|
private |
Enemy's current MP.
|
private |
Enemy's max MP.
std::string Enemy::name |
The enemy name.
|
private |
The name of the enemy.
|
private |
Enemy position in the battlefield (x, y, z).
u8 Enemy::spd |
The enemy speed stat.
|
private |
Enemy spirit stat.
std::vector<Item> Enemy::steal |
List of the items that can be stolen from the enemy.
|
private |
List of the items that can be stolen from the enemy.
u8 Enemy::str |
The enemy strength stat.
|
private |
Enemy strength stat.
|
private |
Indicates if the enemy can be targeted.
|
private |
Indicates if the enemy is visible.