]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Hero.h
added spell selection battle state
[l2e.git] / src / battle / Hero.h
index 59512b61e3e067c5bc3772e6eed7a98a54159758..69db286c74d32fb69fa64a8ffe575439e90c0d4b 100644 (file)
@@ -31,10 +31,11 @@ public:
 
        Uint16 MaxMana() const { return maxMana; }
        Uint16 Mana() const { return mana; }
-       int RelativeMana(int max) const { return mana * max / maxMana; }
+       int RelativeMana(int max) const { return maxMana == 0 ? 0 : mana * max / maxMana; }
+       bool CanUseMagic() const { return maxMana > 0; }
 
        Uint8 IP() const { return ip; }
-       int RelativeIP(int max) const { return ip * max / 256; }
+       int RelativeIP(int max) const { return ip * max / 255; }
 
        Uint16 Attack() const { return attack; }
        Uint16 Defense() const { return defense; }