5 #include "AttackChoice.h"
6 #include "../common/fwd.h"
7 #include "../common/Hero.h"
8 #include "../common/Stats.h"
9 #include "../geometry/Vector.h"
10 #include "../graphics/Animation.h"
11 #include "../graphics/fwd.h"
12 #include "../graphics/Menu.h"
27 const char *Name() const { return master->Name(); }
28 Uint8 Level() const { return master->Level(); }
29 const graphics::Sprite *Sprite() const { return master->BattleSprite(); }
31 const std::vector<const common::Spell *> &Spells() const { return master->Spells(); }
33 Uint16 MaxHealth() const { return master->MaxHealth(); }
34 Uint16 Health() const { return master->Health(); }
35 int RelativeHealth(int max) const { return Health() * max / MaxHealth(); }
36 void SubtractHealth(int amount) { master->SubtractHealth(amount); }
38 Uint16 MaxMana() const { return master->MaxMana(); }
39 Uint16 Mana() const { return master->Mana(); }
40 int RelativeMana(int max) const { return MaxMana() == 0 ? 0 : Mana() * max / MaxMana(); }
41 bool CanUseMagic() const { return MaxMana() > 0; }
43 Uint8 MaxIP() const { return master->MaxIP(); }
44 Uint8 IP() const { return master->IP(); }
45 int RelativeIP(int max) const { return IP() * max / MaxIP(); }
47 common::Stats &GetStats() { return stats; }
48 const common::Stats &GetStats() const { return stats; }
50 const common::Item *Weapon() const { return master->Equipment(common::Hero::EQUIP_WEAPON); }
51 const common::Item *Armor() const { return master->Equipment(common::Hero::EQUIP_ARMOR); }
52 const common::Item *Shield() const { return master->Equipment(common::Hero::EQUIP_SHIELD); }
53 const common::Item *Helmet() const { return master->Equipment(common::Hero::EQUIP_HELMET); }
54 const common::Item *Ring() const { return master->Equipment(common::Hero::EQUIP_RING); }
55 const common::Item *Jewel() const { return master->Equipment(common::Hero::EQUIP_JEWEL); }
57 bool HasWeapon() const { return master->Equipped(common::Hero::EQUIP_WEAPON); }
58 bool HasArmor() const { return master->Equipped(common::Hero::EQUIP_ARMOR); }
59 bool HasShield() const { return master->Equipped(common::Hero::EQUIP_SHIELD); }
60 bool HasHelmet() const { return master->Equipped(common::Hero::EQUIP_HELMET); }
61 bool HasRing() const { return master->Equipped(common::Hero::EQUIP_RING); }
62 bool HasJewel() const { return master->Equipped(common::Hero::EQUIP_JEWEL); }
64 graphics::AnimationRunner &GetAnimation() { return animation; }
65 const graphics::AnimationRunner &GetAnimation() const { return animation; }
66 void SetAnimation(const graphics::AnimationRunner &a) { animation = a; }
68 const graphics::Animation *MeleeAnimation() const { return master->MeleeAnimation(); }
69 const graphics::Animation *AttackAnimation() const { return master->AttackAnimation(); }
70 const graphics::Animation *SpellAnimation() const { return master->SpellAnimation(); }
72 geometry::Vector<int> &Position() { return position; }
73 const geometry::Vector<int> &Position() const { return position; }
75 graphics::Menu<const common::Spell *> &SpellMenu() { return spellMenu; }
76 const graphics::Menu<const common::Spell *> &SpellMenu() const { return spellMenu; }
77 graphics::Menu<const common::Item *> &IkariMenu() { return ikariMenu; }
78 const graphics::Menu<const common::Item *> &IkariMenu() const { return ikariMenu; }
80 AttackChoice &GetAttackChoice() { return attackChoice; }
81 const AttackChoice &GetAttackChoice() const { return attackChoice; }
84 void UpdateSpellMenu();
85 void UpdateIkariMenu(const Resources *);
90 graphics::AnimationRunner animation;
92 geometry::Vector<int> position;
94 graphics::Menu<const common::Spell *> spellMenu;
95 graphics::Menu<const common::Item *> ikariMenu;
97 AttackChoice attackChoice;
105 #endif /* BATTLE_HERO_H_ */