4 * Created on: Aug 3, 2012
8 #ifndef BATTLE_MONSTER_H_
9 #define BATTLE_MONSTER_H_
15 namespace common { class Item; }
30 const char *Name() const { return name; }
31 Uint8 Level() const { return level; }
32 const graphics::Sprite *Sprite() const { return sprite; }
34 Uint16 MaxHealth() const { return maxHealth; }
35 Uint16 Health() const { return health; }
36 int RelativeHealth(int max) const { return health * max / maxHealth; }
37 void SubtractHealth(int amount);
39 Uint16 MaxMana() const { return maxMana; }
40 Uint16 Mana() const { return mana; }
41 int RelativeMana(int max) const { return mana * max / maxMana; }
43 Stats &GetStats() { return stats; }
44 const Stats &GetStats() const { return stats; }
46 Uint16 ExpReward() const { return expReward; }
47 Uint16 GoldReward() const { return goldReward; }
49 const common::Item *DropItem() const { return dropItem; }
50 Uint8 DropChance() const { return dropChance; }
52 const /* Script */ void *AttackScript() { return attackScript; }
53 const /* Script */ void *DefenseScript() { return defenseScript; }
55 graphics::Animation *MeleeAnimation() { return meleeAnimation; }
56 const graphics::Animation *MeleeAnimation() const { return meleeAnimation; }
57 graphics::Animation *AttackAnimation() { return attackAnimation; }
58 const graphics::Animation *AttackAnimation() const { return attackAnimation; }
59 graphics::Animation *SpellAnimation() { return spellAnimation; }
60 const graphics::Animation *SpellAnimation() const { return spellAnimation; }
62 // temporary setters until loader is implemented
64 void SetName(const char *n) { name = n; }
65 void SetSprite(graphics::Sprite *s) { sprite = s; }
66 void SetLevel(Uint8 l) { level = l; }
67 void SetMaxHealth(Uint16 m) { maxHealth = m; }
68 void SetHealth(Uint16 h) { health = h; }
69 void SetMaxMana(Uint16 m) { maxMana = m; }
70 void SetMana(Uint16 m) { mana = m; }
71 void SetStats(const Stats &s) { stats = s; }
72 void SetReward(Uint16 exp, Uint16 gold) { expReward = exp; goldReward = gold; }
74 void SetMeleeAnimation(graphics::Animation *a) { meleeAnimation = a; }
75 void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; }
76 void SetSpellAnimation(graphics::Animation *a) { spellAnimation = a; }
80 graphics::Sprite *sprite;
81 common::Item *dropItem;
82 /* Script */ void *attackScript;
83 /* Script */ void *defenseScript;
85 graphics::Animation *meleeAnimation;
86 graphics::Animation *attackAnimation;
87 graphics::Animation *spellAnimation;
89 Uint16 maxHealth, health;
94 Uint16 expReward, goldReward;
103 #endif /* BATTLE_MONSTER_H_ */