4 * Created on: Aug 6, 2012
13 namespace graphics { class Sprite; }
24 const char *Name() const { return name; }
25 Uint8 Level() const { return level; }
26 const graphics::Sprite *Sprite() const { return sprite; }
28 Uint16 MaxHealth() const { return maxHealth; }
29 Uint16 Health() const { return health; }
30 int RelativeHealth(int max) const { return health * max / maxHealth; }
32 Uint16 MaxMana() const { return maxMana; }
33 Uint16 Mana() const { return mana; }
34 int RelativeMana(int max) const { return maxMana == 0 ? 0 : mana * max / maxMana; }
35 bool CanUseMagic() const { return maxMana > 0; }
37 Uint8 IP() const { return ip; }
38 int RelativeIP(int max) const { return ip * max / 255; }
40 Uint16 Attack() const { return attack; }
41 Uint16 Defense() const { return defense; }
42 Uint16 Agility() const { return agility; }
43 Uint16 Intelligence() const { return intelligence; }
44 Uint16 Gut() const { return gut; }
45 Uint16 MagicResistance() const { return magicResistance; }
47 // temporary setters until loader is implemented
49 void SetName(const char *n) { name = n; }
50 void SetLevel(Uint8 l) { level = l; }
51 void SetSprite(graphics::Sprite *s) { sprite = s; }
53 void SetMaxHealth(Uint16 h) { maxHealth = h; }
54 void SetHealth(Uint16 h) { health = h; }
55 void SetMaxMana(Uint16 m) { maxMana = m; }
56 void SetMana(Uint16 m) { mana = m; }
57 void SetIP(Uint8 i) { ip = i; }
61 graphics::Sprite *sprite;
62 // TODO: equipment and spells lists
64 Uint16 maxHealth, health;
72 Uint16 magicResistance;
81 #endif /* BATTLE_HERO_H_ */