12 #include "AttackChoice.h"
13 #include "../common/Hero.h"
14 #include "../common/Stats.h"
15 #include "../graphics/Animation.h"
16 #include "../graphics/Menu.h"
31 const char *Name() const { return master->Name(); }
32 Uint8 Level() const { return master->Level(); }
33 const graphics::Sprite *Sprite() const { return master->BattleSprite(); }
35 const std::vector<const common::Spell *> &Spells() const { return master->Spells(); }
37 Uint16 MaxHealth() const { return master->MaxHealth(); }
38 Uint16 Health() const { return master->Health(); }
39 int RelativeHealth(int max) const { return Health() * max / MaxHealth(); }
40 void SubtractHealth(int amount) { master->SubtractHealth(amount); }
42 Uint16 MaxMana() const { return master->MaxMana(); }
43 Uint16 Mana() const { return master->Mana(); }
44 int RelativeMana(int max) const { return MaxMana() == 0 ? 0 : Mana() * max / MaxMana(); }
45 bool CanUseMagic() const { return MaxMana() > 0; }
47 Uint8 MaxIP() const { return master->MaxIP(); }
48 Uint8 IP() const { return master->IP(); }
49 int RelativeIP(int max) const { return IP() * max / MaxIP(); }
51 common::Stats &GetStats() { return stats; }
52 const common::Stats &GetStats() const { return stats; }
54 const common::Item *Weapon() const { return master->Equipment(common::Hero::EQUIP_WEAPON); }
55 const common::Item *Armor() const { return master->Equipment(common::Hero::EQUIP_ARMOR); }
56 const common::Item *Shield() const { return master->Equipment(common::Hero::EQUIP_SHIELD); }
57 const common::Item *Helmet() const { return master->Equipment(common::Hero::EQUIP_HELMET); }
58 const common::Item *Ring() const { return master->Equipment(common::Hero::EQUIP_RING); }
59 const common::Item *Jewel() const { return master->Equipment(common::Hero::EQUIP_JEWEL); }
61 bool HasWeapon() const { return master->Equipped(common::Hero::EQUIP_WEAPON); }
62 bool HasArmor() const { return master->Equipped(common::Hero::EQUIP_ARMOR); }
63 bool HasShield() const { return master->Equipped(common::Hero::EQUIP_SHIELD); }
64 bool HasHelmet() const { return master->Equipped(common::Hero::EQUIP_HELMET); }
65 bool HasRing() const { return master->Equipped(common::Hero::EQUIP_RING); }
66 bool HasJewel() const { return master->Equipped(common::Hero::EQUIP_JEWEL); }
68 graphics::AnimationRunner &GetAnimation() { return animation; }
69 const graphics::AnimationRunner &GetAnimation() const { return animation; }
70 void SetAnimation(const graphics::AnimationRunner &a) { animation = a; }
72 const graphics::Animation *MeleeAnimation() const { return master->MeleeAnimation(); }
73 const graphics::Animation *AttackAnimation() const { return master->AttackAnimation(); }
74 const graphics::Animation *SpellAnimation() const { return master->SpellAnimation(); }
76 math::Vector<int> &Position() { return position; }
77 const math::Vector<int> &Position() const { return position; }
79 graphics::Menu<const common::Spell *> &SpellMenu() { return spellMenu; }
80 const graphics::Menu<const common::Spell *> &SpellMenu() const { return spellMenu; }
81 graphics::Menu<const common::Item *> &IkariMenu() { return ikariMenu; }
82 const graphics::Menu<const common::Item *> &IkariMenu() const { return ikariMenu; }
84 AttackChoice &GetAttackChoice() { return attackChoice; }
85 const AttackChoice &GetAttackChoice() const { return attackChoice; }
88 void UpdateSpellMenu();
89 void UpdateIkariMenu(const Resources *);
94 graphics::AnimationRunner animation;
96 math::Vector<int> position;
98 graphics::Menu<const common::Spell *> spellMenu;
99 graphics::Menu<const common::Item *> ikariMenu;
101 AttackChoice attackChoice;