X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.h;h=5676cf93047e8c1d268086d92908d776aa1bc5c8;hb=591ecc2d7ecb0b41144be9b64c09801ac0a28131;hp=d5284ae3d9a9f78f5bf3661be526d73ad04d9c94;hpb=c0068263474818f39e704eee12f753c0419f7708;p=l2e.git diff --git a/src/battle/Hero.h b/src/battle/Hero.h index d5284ae..5676cf9 100644 --- a/src/battle/Hero.h +++ b/src/battle/Hero.h @@ -8,6 +8,8 @@ #ifndef BATTLE_HERO_H_ #define BATTLE_HERO_H_ +#include "Stats.h" + #include #include @@ -38,6 +40,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; } @@ -48,12 +51,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; } @@ -95,6 +94,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; } @@ -129,12 +130,7 @@ private: Uint16 maxHealth, health; Uint16 maxMana, mana; - Uint16 attack; - Uint16 defense; - Uint16 agility; - Uint16 intelligence; - Uint16 gut; - Uint16 magicResistance; + Stats stats; Uint8 level; Uint8 ip;