X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FMonster.h;h=6013ebe47a027bf4fad44ca172ffa749a3945f6a;hb=8639675fbf1d232ab8188dd283149ab650e10336;hp=adebbb28703670c949a3490649d992efcbf6bbdf;hpb=6a3e02e15c1626958540626bf2ccf39f8e365ca5;p=l2e.git diff --git a/src/battle/Monster.h b/src/battle/Monster.h index adebbb2..6013ebe 100644 --- a/src/battle/Monster.h +++ b/src/battle/Monster.h @@ -8,8 +8,16 @@ #ifndef BATTLE_MONSTER_H_ #define BATTLE_MONSTER_H_ +#include "Stats.h" + #include +namespace common { class Item; } +namespace graphics { + class Animation; + class Sprite; +} + namespace battle { class Monster { @@ -21,48 +29,67 @@ public: public: const char *Name() const { return name; } Uint8 Level() const { return level; } - const /* Sprite */ void *Sprite() const { return sprite; } + const graphics::Sprite *Sprite() const { return sprite; } Uint16 MaxHealth() const { return maxHealth; } Uint16 Health() const { return health; } - int RelativeHealth(int max) { return health * max / maxHealth; } + int RelativeHealth(int max) const { return health * max / maxHealth; } + void SubtractHealth(int amount); Uint16 MaxMana() const { return maxMana; } Uint16 Mana() const { return mana; } - int RelativeMana(int max) { return mana * max / maxMana; } + int RelativeMana(int max) const { return mana * max / maxMana; } - Uint16 Attack() const { return attack; } - Uint16 Defense() const { return defense; } - Uint16 Agility() const { return agility; } - Uint16 Intelligence() const { return intelligence; } - Uint16 Gut() const { return gut; } - Uint16 MagicResistance() const { return magicResistance; } + Stats &GetStats() { return stats; } + const Stats &GetStats() const { return stats; } Uint16 ExpReward() const { return expReward; } Uint16 GoldReward() const { return goldReward; } - const /* Item */ void *DropItem() const { return dropItem; } + const common::Item *DropItem() const { return dropItem; } Uint8 DropChance() const { return dropChance; } const /* Script */ void *AttackScript() { return attackScript; } const /* Script */ void *DefenseScript() { return defenseScript; } + graphics::Animation *MeleeAnimation() { return meleeAnimation; } + const graphics::Animation *MeleeAnimation() const { return meleeAnimation; } + graphics::Animation *AttackAnimation() { return attackAnimation; } + const graphics::Animation *AttackAnimation() const { return attackAnimation; } + graphics::Animation *SpellAnimation() { return spellAnimation; } + const graphics::Animation *SpellAnimation() const { return spellAnimation; } + +// temporary setters until loader is implemented +public: + void SetName(const char *n) { name = n; } + void SetSprite(graphics::Sprite *s) { sprite = s; } + void SetLevel(Uint8 l) { level = l; } + void SetMaxHealth(Uint16 m) { maxHealth = m; } + void SetHealth(Uint16 h) { health = h; } + void SetMaxMana(Uint16 m) { maxMana = m; } + void SetMana(Uint16 m) { mana = m; } + void SetStats(const Stats &s) { stats = s; } + void SetReward(Uint16 exp, Uint16 gold) { expReward = exp; goldReward = gold; } + + void SetMeleeAnimation(graphics::Animation *a) { meleeAnimation = a; } + void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; } + void SetSpellAnimation(graphics::Animation *a) { spellAnimation = a; } + private: const char *name; - /* Sprite */ void *sprite; - /* Item */ void *dropItem; + graphics::Sprite *sprite; + common::Item *dropItem; /* Script */ void *attackScript; /* Script */ void *defenseScript; + graphics::Animation *meleeAnimation; + graphics::Animation *attackAnimation; + graphics::Animation *spellAnimation; + Uint16 maxHealth, health; Uint16 maxMana, mana; - Uint16 attack; - Uint16 defense; - Uint16 agility; - Uint16 intelligence; - Uint16 gut; - Uint16 magicResistance; + Stats stats; Uint16 expReward, goldReward;