X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.h;h=69db286c74d32fb69fa64a8ffe575439e90c0d4b;hb=d7927b645a22776d6e1e1c209365e8f74c4350e9;hp=59512b61e3e067c5bc3772e6eed7a98a54159758;hpb=628b3a7276d0b330719e05504b23bafcf88f8fca;p=l2e.git diff --git a/src/battle/Hero.h b/src/battle/Hero.h index 59512b6..69db286 100644 --- a/src/battle/Hero.h +++ b/src/battle/Hero.h @@ -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; }