X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.h;h=7abfb68fb35ae5f8a0cd16e243678546cf58074e;hb=fbf5a98f8fd0da951e469003fe87d575a6bb30a4;hp=97a21c23377d177d855db1bbdcda0194266bbf24;hpb=854e5229c3f30bf88aa08d7f0aff56a1411c3367;p=l2e.git diff --git a/src/battle/Hero.h b/src/battle/Hero.h index 97a21c2..7abfb68 100644 --- a/src/battle/Hero.h +++ b/src/battle/Hero.h @@ -38,6 +38,7 @@ public: Uint16 MaxHealth() const { return maxHealth; } Uint16 Health() const { return health; } int RelativeHealth(int max) const { return Health() * max / MaxHealth(); } + void SubtractHealth(int amount); Uint16 MaxMana() const { return maxMana; } Uint16 Mana() const { return mana; } @@ -55,6 +56,13 @@ public: Uint16 Gut() const { return gut; } Uint16 MagicResistance() const { return magicResistance; } + common::Item *Weapon() { return weapon; } + common::Item *Armor() { return armor; } + common::Item *Shield() { return shield; } + common::Item *Helmet() { return helmet; } + common::Item *Ring() { return ring; } + common::Item *Jewel() { return jewel; } + const common::Item *Weapon() const { return weapon; } const common::Item *Armor() const { return armor; } const common::Item *Shield() const { return shield; } @@ -69,6 +77,8 @@ public: bool HasRing() const { return ring; } bool HasJewel() const { return jewel; } + 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; } @@ -86,15 +96,16 @@ public: void SetMana(Uint16 m) { mana = m; } void SetIP(Uint8 i) { ip = i; } - void SetWeapon(const common::Item *i) { weapon = i; } - void SetArmor(const common::Item *i) { armor = i; } - void SetShield(const common::Item *i) { shield = i; } - void SetHelmet(const common::Item *i) { helmet = i; } - void SetRing(const common::Item *i) { ring = i; } - void SetJewel(const common::Item *i) { jewel = i; } + void SetWeapon(common::Item *i) { weapon = i; } + void SetArmor(common::Item *i) { armor = i; } + void SetShield(common::Item *i) { shield = i; } + void SetHelmet(common::Item *i) { helmet = i; } + void SetRing(common::Item *i) { ring = i; } + void SetJewel(common::Item *i) { jewel = i; } void AddSpell(const common::Spell *s) { spells.push_back(s); } + void SetMeleeAnimation(graphics::Animation *a) { meleeAnimation = a; } void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; } void SetSpellAnimation(graphics::Animation *a) { spellAnimation = a; } @@ -102,13 +113,14 @@ private: const char *name; graphics::Sprite *sprite; - const common::Item *weapon; - const common::Item *armor; - const common::Item *shield; - const common::Item *helmet; - const common::Item *ring; - const common::Item *jewel; + common::Item *weapon; + common::Item *armor; + common::Item *shield; + common::Item *helmet; + common::Item *ring; + common::Item *jewel; + graphics::Animation *meleeAnimation; graphics::Animation *attackAnimation; graphics::Animation *spellAnimation;