18#include <OgreString.h>
107 Enemy(
const unsigned int id);
121 const unsigned int id,
const Ogre::Vector3 pos,
const bool front,
const bool visible,
122 const bool targeteable,
const bool active,
const std::string cover
135 const int GetId()
const;
142 void SetId(
const int id);
167 const std::string
GetName()
const;
195 unsigned int GetAp()
const;
209 unsigned int GetExp()
const;
265 std::vector<Item>
GetDrop()
const;
366 unsigned int GetStr()
const;
380 unsigned int GetDef()
const;
394 unsigned int GetMag()
const;
408 unsigned int GetSpr()
const;
415 void SetSpr(
const unsigned int spr);
422 unsigned int GetDex()
const;
429 void SetDex(
const unsigned int dex);
436 unsigned int GetLck()
const;
450 unsigned int GetEva()
const;
471 void SetMeva(
const unsigned int meva);
478 unsigned int GetHp()
const;
488 void SetHp(
const unsigned int hp);
505 void SetHpMax(
const unsigned int hp_max);
512 unsigned int GetMp()
const;
522 void SetMp(
const unsigned int mp);
539 void SetMpMax(
const unsigned int mp_max);
553 void SetPos(
const Ogre::Vector3 &pos);
Any enemy in a battle.
Definition: Enemy.h:24
unsigned int GetDef() const
Retrieves the enemy's defense stat.
Definition: Enemy.cpp:165
unsigned int mag_
Enemy magic stat.
Definition: Enemy.h:774
std::vector< Immunity > immunities_
Status immunities and resistances.
Definition: Enemy.h:726
void AddElement(const Element element)
Adds an elemental affinity to the monster.
Definition: Enemy.cpp:136
void SetMp(const unsigned int mp)
Sets the enemy's current MP.
Definition: Enemy.cpp:206
bool IsFront() const
Checks if the enemy is in the front row.
Definition: Enemy.cpp:225
u8 level
The enemy level.
Definition: Enemy.h:112
std::vector< Immunity > GetImmunities() const
Retrieves the list of status immunities.
Definition: Enemy.cpp:138
std::string model_
NAme of the enemy model file.
Definition: Enemy.h:686
float back_damage
Back damage multiplier.
Definition: Enemy.h:177
std::string GetCover() const
Retrieves the flags for enemy covering.
Definition: Enemy.cpp:241
void SetMorph(const int morph)
Sets the ID of the item the monster can be morphed into.
Definition: Enemy.cpp:152
unsigned int GetSpr() const
Retrieves the enemy's spirit stat.
Definition: Enemy.cpp:173
u32 hp
The enemy HP.
Definition: Enemy.h:152
Ogre::Vector3 pos_
Enemy position in the battlefield (x, y, z).
Definition: Enemy.h:824
const int GetId() const
Retrieves the enemy ID.
Definition: Enemy.cpp:94
unsigned int GetMpMax() const
Retrieves the enemy's max MP.
Definition: Enemy.cpp:208
void SetHpMax(const unsigned int hp_max)
Sets the enemy's max HP.
Definition: Enemy.cpp:199
void SetMag(const unsigned int mag)
Sets the enemy's magic stat.
Definition: Enemy.cpp:171
void AddAnimation(const unsigned int animation)
Adds an animation for the enemy.
Definition: Enemy.cpp:124
void ReadFromXml()
Reads enemy data from the xml file.
Definition: Enemy.cpp:257
unsigned int GetHp() const
Retrieves the enemy's current HP.
Definition: Enemy.cpp:193
unsigned int hp_max_
Enemy's max HP.
Definition: Enemy.h:814
unsigned int GetMeva() const
Retrieves the enemy's magic evasion stat.
Definition: Enemy.cpp:189
bool IsActive() const
Checks whether the enemy's main script is active.
Definition: Enemy.cpp:237
unsigned int GetLevel() const
Retrieves the enemy level.
Definition: Enemy.cpp:106
std::vector< Item > drop_
List of the items that can be dropped from the enemy.
Definition: Enemy.h:749
void SetStr(const unsigned int str)
Sets the enemy's strength stat.
Definition: Enemy.cpp:163
std::vector< Item > GetDrop() const
Retrieves the enemy possible item drops.
Definition: Enemy.cpp:130
unsigned int GetDex() const
Retrieves the enemy's dexterity stat.
Definition: Enemy.cpp:177
void ScriptGetPos() const
Retrieves the enemy position.
Definition: Enemy.cpp:219
void SetBackDamage(const float back_damage)
Sets the multiplier for the damage the enemy receives when attacked from the back.
Definition: Enemy.cpp:156
unsigned int mp_max_
Enemy's max MP.
Definition: Enemy.h:819
u8 mag
The enemy magic stat.
Definition: Enemy.h:122
std::vector< unsigned int > animations_
List of animations.
Definition: Enemy.h:716
bool IsVisible() const
Checks the enemy visibility.
Definition: Enemy.cpp:229
unsigned int dex_
Enemy dexterity stat.
Definition: Enemy.h:784
unsigned int spr_
Enemy spirit stat.
Definition: Enemy.h:779
void SetMeva(const unsigned int meva)
Sets the enemy's magic evasion stat.
Definition: Enemy.cpp:191
void SetMoney(const unsigned int money)
Sets the money gain upon defeating the enemy.
Definition: Enemy.cpp:120
std::vector< Item > steal_
List of the items that can be stolen from the enemy.
Definition: Enemy.h:744
std::vector< unsigned int > GetManipulateAttacks() const
Retrieves the list of attacks that can be used during the manipulated state.
Definition: Enemy.cpp:142
u32 money
Money given upon defeat.
Definition: Enemy.h:172
u8 eva
The enemy evasion stat.
Definition: Enemy.h:147
void SetHp(const unsigned int hp)
Sets the enemy's current HP.
Definition: Enemy.cpp:195
bool targeteable_
Indicates if the enemy can be targeted.
Definition: Enemy.h:839
u8 def
The enemy defense stat.
Definition: Enemy.h:127
unsigned int GetExp() const
Retrieves the EXP gain upon defeating the enemy.
Definition: Enemy.cpp:114
std::string name
The enemy name.
Definition: Enemy.h:107
void SetName(const Ogre::String &name)
Sets the enemy name.
Definition: Enemy.cpp:104
std::vector< Attack > GetAttacks() const
Retrieves the enemy attacks.
Definition: Enemy.cpp:126
u8 lck
The enemy luck stat.
Definition: Enemy.h:142
void AddDrop(const Item item)
Adds an item drop for the enemy.
Definition: Enemy.cpp:132
unsigned int GetAp() const
Retrieves the AP gain upon defeating the enemy.
Definition: Enemy.cpp:110
bool active_
Indicates if the enemy's main script is active.
Definition: Enemy.h:844
void SetFront(bool front)
Sets the enemy in or out the front row.
Definition: Enemy.cpp:227
const std::string GetName() const
Retrieves the enemy name.
Definition: Enemy.cpp:102
unsigned int level_
The enemy level.
Definition: Enemy.h:696
void AddManipulateAttack(const unsigned int attack)
Adds an attack usable during manipulation.
Definition: Enemy.cpp:144
unsigned int hp_
Enemy's current HP.
Definition: Enemy.h:804
bool IsTargeteable() const
Checks whether the enemy can be targeted.
Definition: Enemy.cpp:233
unsigned int mp_
Enemy's current MP.
Definition: Enemy.h:809
u32 ap
AP given upon defeat.
Definition: Enemy.h:167
bool visible_
Indicates if the enemy is visible.
Definition: Enemy.h:834
std::vector< unsigned int > GetAnimations() const
Retrieves the enemy animation IDs.
Definition: Enemy.cpp:122
u32 exp
Experience given upon defeat.
Definition: Enemy.h:162
int id_
The enemy ID.
Definition: Enemy.h:681
void SetExp(const unsigned int exp)
Sets the EXP gain upon defeating the enemy.
Definition: Enemy.cpp:116
void SetAp(unsigned int ap)
Sets the AP gain upon defeating the enemy.
Definition: Enemy.cpp:112
unsigned int GetMp() const
Retrieves the enemy's current MP.
Definition: Enemy.cpp:204
unsigned int str_
Enemy strength stat.
Definition: Enemy.h:764
u32 mp
The enemy MP.
Definition: Enemy.h:157
std::string model
Two-letter model code.
Definition: Enemy.h:220
unsigned int def_
Enemy defense stat.
Definition: Enemy.h:769
float GetBackDamage() const
Retrieves the multiplier for the damage the enemy receives when attacked from the back.
Definition: Enemy.cpp:154
unsigned int ap_
AP given upon defeating the enemy.
Definition: Enemy.h:706
unsigned int money_
Money given upon defeating the enemy.
Definition: Enemy.h:711
Enemy()
Constructor.
Definition: Enemy.h:234
unsigned int lck_
Enemy luck stat.
Definition: Enemy.h:789
int morph_
ID of the item the enemy can be morphed into.
Definition: Enemy.h:754
unsigned int GetMorph() const
Retrieves the ID of the item the monster can be morphed into.
Definition: Enemy.cpp:150
bool front_
Indicates if the enmy is in the frontline.
Definition: Enemy.h:829
void SetLck(const unsigned int lck)
Sets the enemy's luck stat.
Definition: Enemy.cpp:183
void SetDef(const unsigned int def)
Sets the enemy's defense stat.
Definition: Enemy.cpp:167
void SetModel(const std::string model)
Sets the enemy model.
Definition: Enemy.cpp:100
void SetTargeteable(bool targeteable)
Determines whether the enemy can be targeted.
Definition: Enemy.cpp:235
unsigned int exp_
EXP given upon defeating the enemy.
Definition: Enemy.h:701
void SetId(const int id)
Sets the enemy ID.
Definition: Enemy.cpp:96
int ScriptGetAttack(const unsigned int index)
Retrieves an attack.
Definition: Enemy.cpp:247
int ScriptGetAttackCount()
Retrieves the number of attacks of the enemy.
Definition: Enemy.cpp:245
Ogre::Vector3 & GetPos()
Retrieves the enemy position in the battlefield.
Definition: Enemy.cpp:215
void AddAttack(const Attack attack)
Adds an attack for the enemy.
Definition: Enemy.cpp:128
void SetActive(bool active)
Activates or deactivates the enemy main script.
Definition: Enemy.cpp:239
std::vector< Attack > attacks_
Enemy attacks.
Definition: Enemy.h:731
std::vector< Item > GetSteal() const
Retrieves the enemy possible item stelas.
Definition: Enemy.cpp:146
std::vector< Element > GetElements() const
Retrieves the list of the enemy elemental affinities.
Definition: Enemy.cpp:134
const std::string GetModel() const
Retrieves the enemy model.
Definition: Enemy.cpp:98
unsigned int eva_
Enemy evasion stat.
Definition: Enemy.h:794
virtual ~Enemy()
Destructor.
Definition: Enemy.cpp:89
int ScriptGetCameraForAttack(const unsigned int index)
Retrieves the camera for an attack.
Definition: Enemy.cpp:252
void SetCover(std::string cover)
Sets the flags for enemy covering.
Definition: Enemy.cpp:243
unsigned int morph
ID of the item the enemy can be morphed into.
Definition: Enemy.h:227
void AddSteal(const Item item)
Adds an item steal to the enemy.
Definition: Enemy.cpp:148
unsigned int GetEva() const
Retrieves the enemy's evasion stat.
Definition: Enemy.cpp:185
std::string cover_
Cover binary flags.
Definition: Enemy.h:849
void SetDex(const unsigned int dex)
Sets the enemy's dexterity stat.
Definition: Enemy.cpp:179
void SetVisible(bool visible)
Toggles the enemy visibility.
Definition: Enemy.cpp:231
unsigned int GetLck() const
Retrieves the enemy's luck stat.
Definition: Enemy.cpp:181
void SetMpMax(const unsigned int mp_max)
Sets the enemy's max MP.
Definition: Enemy.cpp:210
unsigned int meva_
Enemy magic evasion stat.
Definition: Enemy.h:799
void SetLevel(const unsigned int level)
Sets the enemy level.
Definition: Enemy.cpp:108
void SetPos(const Ogre::Vector3 &pos)
Sets the enemy position in the battlefield.
Definition: Enemy.cpp:217
void SetSpr(const unsigned int spr)
Sets the enemy's spirit stat.
Definition: Enemy.cpp:175
unsigned int GetStr() const
Retrieves the enemy's strength stat.
Definition: Enemy.cpp:161
unsigned int GetMoney() const
Retrieves the money gain upon defeating the enemy.
Definition: Enemy.cpp:118
std::vector< Element > elements_
Elemental affinities.
Definition: Enemy.h:721
void AddImmunity(const Immunity immunity)
Adds an immunity to the monster.
Definition: Enemy.cpp:140
unsigned int GetHpMax() const
Retrieves the enemy's max HP.
Definition: Enemy.cpp:197
u8 str
The enemy strength stat.
Definition: Enemy.h:117
Ogre::String name_
The name of the enemy.
Definition: Enemy.h:691
unsigned int GetMag() const
Retrieves the enemy's magic stat.
Definition: Enemy.cpp:169
void SetEva(const unsigned int eva)
Sets the enemy's evasion stat.
Definition: Enemy.cpp:187
float back_damage_
Multiplier for back damage.
Definition: Enemy.h:759
std::vector< unsigned int > manipulate_attacks_
List of attacks that can be used while manipulated.
Definition: Enemy.h:739
Ogre::String String
Definition: TypeDefine.h:37
Enemy attack data.
Definition: Enemy.h:52
int camera
Camera ID to use during the attack.
Definition: Enemy.h:64
unsigned int id
Attack ID.
Definition: Enemy.h:57
unsigned int id
The element ID.
Definition: Enemy.h:33
float factor
Damage modification factor when attacked by the element.
Definition: Enemy.h:46
Status immunity.
Definition: Enemy.h:86
float rate
Immunity rate.
Definition: Enemy.h:99
unsigned int status
Status ID.
Definition: Enemy.h:91
Data for drop and steal items.
Definition: Enemy.h:70
unsigned int id
Item ID.
Definition: Enemy.h:75
float rate
Steal or drop rate.
Definition: Enemy.h:80