4 * Created on: Aug 6, 2012
14 namespace common { class Spell; }
15 namespace graphics { class Sprite; }
26 const char *Name() const { return name; }
27 Uint8 Level() const { return level; }
28 const graphics::Sprite *Sprite() const { return sprite; }
30 const std::vector<const common::Spell *> &Spells() const { return spells; }
32 Uint16 MaxHealth() const { return maxHealth; }
33 Uint16 Health() const { return health; }
34 int RelativeHealth(int max) const { return health * max / maxHealth; }
36 Uint16 MaxMana() const { return maxMana; }
37 Uint16 Mana() const { return mana; }
38 int RelativeMana(int max) const { return maxMana == 0 ? 0 : mana * max / maxMana; }
39 bool CanUseMagic() const { return maxMana > 0; }
41 Uint8 IP() const { return ip; }
42 int RelativeIP(int max) const { return ip * max / 255; }
44 Uint16 Attack() const { return attack; }
45 Uint16 Defense() const { return defense; }
46 Uint16 Agility() const { return agility; }
47 Uint16 Intelligence() const { return intelligence; }
48 Uint16 Gut() const { return gut; }
49 Uint16 MagicResistance() const { return magicResistance; }
51 // temporary setters until loader is implemented
53 void SetName(const char *n) { name = n; }
54 void SetLevel(Uint8 l) { level = l; }
55 void SetSprite(graphics::Sprite *s) { sprite = s; }
57 void SetMaxHealth(Uint16 h) { maxHealth = h; }
58 void SetHealth(Uint16 h) { health = h; }
59 void SetMaxMana(Uint16 m) { maxMana = m; }
60 void SetMana(Uint16 m) { mana = m; }
61 void SetIP(Uint8 i) { ip = i; }
63 void AddSpell(const common::Spell *s) { spells.push_back(s); }
67 graphics::Sprite *sprite;
69 // TODO: vector does not seem to be a good choice
70 std::vector<const common::Spell *> spells;
71 // TODO: equipment list
73 Uint16 maxHealth, health;
81 Uint16 magicResistance;
90 #endif /* BATTLE_HERO_H_ */