X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.h;h=c15c2dcbc08bf4d25cc73f7b0734b54ef4463760;hb=b02da898c7c8a08141df4e797774a61cf5e0163f;hp=7abfb68fb35ae5f8a0cd16e243678546cf58074e;hpb=fbf5a98f8fd0da951e469003fe87d575a6bb30a4;p=l2e.git diff --git a/src/battle/Hero.h b/src/battle/Hero.h index 7abfb68..c15c2dc 100644 --- a/src/battle/Hero.h +++ b/src/battle/Hero.h @@ -8,6 +8,12 @@ #ifndef BATTLE_HERO_H_ #define BATTLE_HERO_H_ +#include "AttackChoice.h" +#include "Stats.h" +#include "../geometry/Vector.h" +#include "../graphics/Animation.h" +#include "../graphics/Menu.h" + #include #include @@ -16,12 +22,13 @@ namespace common { class Spell; } namespace graphics { - class Animation; class Sprite; } namespace battle { +class Resources; + class Hero { public: @@ -49,12 +56,8 @@ public: Uint8 IP() const { return ip; } int RelativeIP(int max) const { return IP() * max / MaxIP(); } - 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; } common::Item *Weapon() { return weapon; } common::Item *Armor() { return armor; } @@ -77,13 +80,29 @@ public: bool HasRing() const { return ring; } bool HasJewel() const { return jewel; } - graphics::Animation *MeleeAnimation() { return meleeAnimation; } + graphics::AnimationRunner &GetAnimation() { return animation; } + const graphics::AnimationRunner &GetAnimation() const { return animation; } + void SetAnimation(const graphics::AnimationRunner &a) { animation = a; } + 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; } + geometry::Vector &Position() { return position; } + const geometry::Vector &Position() const { return position; } + + graphics::Menu &SpellMenu() { return spellMenu; } + const graphics::Menu &SpellMenu() const { return spellMenu; } + graphics::Menu &IkariMenu() { return ikariMenu; } + const graphics::Menu &IkariMenu() const { return ikariMenu; } + + AttackChoice &GetAttackChoice() { return attackChoice; } + const AttackChoice &GetAttackChoice() const { return attackChoice; } + +public: + void UpdateSpellMenu(); + void UpdateIkariMenu(const Resources *); + // temporary setters until loader is implemented public: void SetName(const char *n) { name = n; } @@ -96,6 +115,8 @@ public: void SetMana(Uint16 m) { mana = m; } void SetIP(Uint8 i) { ip = i; } + void SetStats(const Stats &s) { stats = s; } + void SetWeapon(common::Item *i) { weapon = i; } void SetArmor(common::Item *i) { armor = i; } void SetShield(common::Item *i) { shield = i; } @@ -105,9 +126,12 @@ public: 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; } + void SetMeleeAnimation(const graphics::Animation *a) { meleeAnimation = a; } + void SetAttackAnimation(const graphics::Animation *a) { attackAnimation = a; } + void SetSpellAnimation(const graphics::Animation *a) { spellAnimation = a; } + + static void CreateTypeDescription(); + static void Construct(void *); private: const char *name; @@ -120,25 +144,29 @@ private: common::Item *ring; common::Item *jewel; - graphics::Animation *meleeAnimation; - graphics::Animation *attackAnimation; - graphics::Animation *spellAnimation; + const graphics::Animation *meleeAnimation; + const graphics::Animation *attackAnimation; + const graphics::Animation *spellAnimation; + + graphics::AnimationRunner animation; + + geometry::Vector position; + + graphics::Menu spellMenu; + graphics::Menu ikariMenu; + + AttackChoice attackChoice; // TODO: vector does not seem to be a good choice std::vector spells; - Uint16 maxHealth, health; - Uint16 maxMana, mana; + int maxHealth, health; + int maxMana, mana; - Uint16 attack; - Uint16 defense; - Uint16 agility; - Uint16 intelligence; - Uint16 gut; - Uint16 magicResistance; + Stats stats; - Uint8 level; - Uint8 ip; + int level; + int ip; };