X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FHero.cpp;h=a3361c6045e0e368bfcbde718d51e80cfcde96ea;hb=9cfff98ffce0529c685fbd5aa52e213c295449a1;hp=ab3b23e9b9c396e023516e539f640501a76ff831;hpb=fbf5a98f8fd0da951e469003fe87d575a6bb30a4;p=l2e.git diff --git a/src/battle/Hero.cpp b/src/battle/Hero.cpp index ab3b23e..a3361c6 100644 --- a/src/battle/Hero.cpp +++ b/src/battle/Hero.cpp @@ -29,13 +29,6 @@ Hero::Hero() , maxMana(0) , mana(0) -, attack(0) -, defense(0) -, agility(0) -, intelligence(0) -, gut(0) -, magicResistance(0) - , level(0) , ip(0) { @@ -51,6 +44,12 @@ void Hero::SubtractHealth(int amount) { health = 0; } else { health -= amount; + int ipGain(amount * 255 / health); + if (ip + ipGain > 255) { + ip = 255; + } else { + ip += ipGain; + } } }