X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbattle%2FHero.h;h=d5284ae3d9a9f78f5bf3661be526d73ad04d9c94;hb=f89e79ad6fdc3009657e81f3dc3765d661f4899c;hp=3274fe21b64d7a2cb373d9a12bce7c061a77abff;hpb=3f2e68e7a2377db6d1738934150f34b80bdbd0e0;p=l2e.git diff --git a/src/battle/Hero.h b/src/battle/Hero.h index 3274fe2..d5284ae 100644 --- a/src/battle/Hero.h +++ b/src/battle/Hero.h @@ -15,7 +15,10 @@ namespace common { class Item; class Spell; } -namespace graphics { class Sprite; } +namespace graphics { + class Animation; + class Sprite; +} namespace battle { @@ -52,6 +55,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; } @@ -66,8 +76,12 @@ public: bool HasRing() const { return ring; } bool HasJewel() const { return jewel; } - int AttackFrames() const { return attackFrames; } - int SpellFrames() const { return spellFrames; } + 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: @@ -81,35 +95,37 @@ 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 SetAttackFrames(int num) { attackFrames = num; } - void SetSpellFrames(int num) { spellFrames = num; } + 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; 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; // TODO: vector does not seem to be a good choice std::vector spells; - int attackFrames; - int spellFrames; - Uint16 maxHealth, health; Uint16 maxMana, mana;