4 * Created on: Aug 6, 2012
12 #include "AttackChoice.h"
13 #include "../common/fwd.h"
14 #include "../common/Hero.h"
15 #include "../common/Stats.h"
16 #include "../geometry/Vector.h"
17 #include "../graphics/Animation.h"
18 #include "../graphics/fwd.h"
19 #include "../graphics/Menu.h"
34 const char *Name() const { return master->Name(); }
35 Uint8 Level() const { return master->Level(); }
36 const graphics::Sprite *Sprite() const { return master->BattleSprite(); }
38 const std::vector<const common::Spell *> &Spells() const { return master->Spells(); }
40 Uint16 MaxHealth() const { return master->MaxHealth(); }
41 Uint16 Health() const { return master->Health(); }
42 int RelativeHealth(int max) const { return Health() * max / MaxHealth(); }
43 void SubtractHealth(int amount) { master->SubtractHealth(amount); }
45 Uint16 MaxMana() const { return master->MaxMana(); }
46 Uint16 Mana() const { return master->Mana(); }
47 int RelativeMana(int max) const { return MaxMana() == 0 ? 0 : Mana() * max / MaxMana(); }
48 bool CanUseMagic() const { return MaxMana() > 0; }
50 Uint8 MaxIP() const { return master->MaxIP(); }
51 Uint8 IP() const { return master->IP(); }
52 int RelativeIP(int max) const { return IP() * max / MaxIP(); }
54 common::Stats &GetStats() { return stats; }
55 const common::Stats &GetStats() const { return stats; }
57 common::Item *Weapon() { return master->Weapon(); }
58 common::Item *Armor() { return master->Armor(); }
59 common::Item *Shield() { return master->Shield(); }
60 common::Item *Helmet() { return master->Helmet(); }
61 common::Item *Ring() { return master->Ring(); }
62 common::Item *Jewel() { return master->Jewel(); }
64 const common::Item *Weapon() const { return master->Weapon(); }
65 const common::Item *Armor() const { return master->Armor(); }
66 const common::Item *Shield() const { return master->Shield(); }
67 const common::Item *Helmet() const { return master->Helmet(); }
68 const common::Item *Ring() const { return master->Ring(); }
69 const common::Item *Jewel() const { return master->Jewel(); }
71 bool HasWeapon() const { return master->HasWeapon(); }
72 bool HasArmor() const { return master->HasArmor(); }
73 bool HasShield() const { return master->HasShield(); }
74 bool HasHelmet() const { return master->HasHelmet(); }
75 bool HasRing() const { return master->HasRing(); }
76 bool HasJewel() const { return master->HasJewel(); }
78 graphics::AnimationRunner &GetAnimation() { return animation; }
79 const graphics::AnimationRunner &GetAnimation() const { return animation; }
80 void SetAnimation(const graphics::AnimationRunner &a) { animation = a; }
82 const graphics::Animation *MeleeAnimation() const { return master->MeleeAnimation(); }
83 const graphics::Animation *AttackAnimation() const { return master->AttackAnimation(); }
84 const graphics::Animation *SpellAnimation() const { return master->SpellAnimation(); }
86 geometry::Vector<int> &Position() { return position; }
87 const geometry::Vector<int> &Position() const { return position; }
89 graphics::Menu<const common::Spell *> &SpellMenu() { return spellMenu; }
90 const graphics::Menu<const common::Spell *> &SpellMenu() const { return spellMenu; }
91 graphics::Menu<const common::Item *> &IkariMenu() { return ikariMenu; }
92 const graphics::Menu<const common::Item *> &IkariMenu() const { return ikariMenu; }
94 AttackChoice &GetAttackChoice() { return attackChoice; }
95 const AttackChoice &GetAttackChoice() const { return attackChoice; }
98 void UpdateSpellMenu();
99 void UpdateIkariMenu(const Resources *);
102 common::Hero *master;
104 graphics::AnimationRunner animation;
106 geometry::Vector<int> position;
108 graphics::Menu<const common::Spell *> spellMenu;
109 graphics::Menu<const common::Item *> ikariMenu;
111 AttackChoice attackChoice;
119 #endif /* BATTLE_HERO_H_ */