]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Hero.h
added simple damage calculation formula
[l2e.git] / src / battle / Hero.h
index 7abfb68fb35ae5f8a0cd16e243678546cf58074e..5676cf93047e8c1d268086d92908d776aa1bc5c8 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef BATTLE_HERO_H_
 #define BATTLE_HERO_H_
 
+#include "Stats.h"
+
 #include <vector>
 #include <SDL.h>
 
@@ -49,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; }
@@ -96,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; }
@@ -130,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;