X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FHero.h;h=a0f1da47fc0af02833cc10f6bb00033d9de89afa;hb=HEAD;hp=f61d0ee95507b5ae009e25ea31ccd28d3469de63;hpb=1338442a6db3a706d09622188aad1cdfe183a70b;p=l2e.git diff --git a/src/common/Hero.h b/src/common/Hero.h index f61d0ee..a0f1da4 100644 --- a/src/common/Hero.h +++ b/src/common/Hero.h @@ -1,16 +1,18 @@ -/* - * Hero.h - * - * Created on: Oct 7, 2012 - * Author: holy - */ - #ifndef COMMON_HERO_H_ #define COMMON_HERO_H_ -#include "fwd.h" +namespace common { + class Item; + class LevelUp; + class Spell; + class Upgrade; +} +namespace graphics { + class Animation; + class Sprite; +} + #include "Stats.h" -#include "../graphics/fwd.h" #include "../map/Entity.h" #include @@ -37,6 +39,19 @@ public: EQUIP_COUNT, }; + enum UpgradeType { + UPGRADE_LVL, + UPGRADE_MHP, + UPGRADE_MMP, + UPGRADE_ATK, + UPGRADE_DFP, + UPGRADE_STR, + UPGRADE_AGL, + UPGRADE_INT, + UPGRADE_GUT, + UPGRADE_MGR, + }; + const char *Name() const { return name; } Uint16 MaxHealth() const { return maxHealth; } @@ -60,14 +75,15 @@ public: int Experience() const { return experience; } int NextLevel() const; + void AddExperience(int, std::vector &); + bool CanEquip(const Item &) const; bool CanInvoke(const Spell &) const; - Item *Equipment(EquipSlot i) { return equipment[i]; } const Item *Equipment(EquipSlot i) const { return equipment[i]; } bool Equipped(EquipSlot i) const { return equipment[i]; } void RemoveEquipment(EquipSlot i) { equipment[i] = 0; } - void SetEquipment(EquipSlot i, Item *item) { equipment[i] = item; } + void SetEquipment(EquipSlot i, const Item *item) { equipment[i] = item; } std::vector &Spells() { return spells; } const std::vector &Spells() const { return spells; } @@ -84,8 +100,9 @@ public: static void CreateTypeDescription(); static void Construct(void *); -// temporary setters public: + void SetMaxHealth(int h) { maxHealth = h; } + void SetHealth(int h) { health = h; } void AddSpell(Spell *s) { spells.push_back(s); } private: @@ -100,12 +117,12 @@ private: int level; int experience; - int *levelLadder; + LevelUp *levelLadder; int numLevels; int useMask; - Item *equipment[EQUIP_COUNT]; + const Item *equipment[EQUIP_COUNT]; // TODO: vector does not seem to be a good choice std::vector spells; @@ -121,4 +138,4 @@ private: } -#endif /* COMMON_HERO_H_ */ +#endif