X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FMonster.cpp;h=ec179e488d3b5b0e19212204f0fff08a2585d9a1;hb=8639675fbf1d232ab8188dd283149ab650e10336;hp=acbe6cf93bdacbd402eb4cff94ee6ce53396bb51;hpb=d7927b645a22776d6e1e1c209365e8f74c4350e9;p=l2e.git diff --git a/src/battle/Monster.cpp b/src/battle/Monster.cpp index acbe6cf..ec179e4 100644 --- a/src/battle/Monster.cpp +++ b/src/battle/Monster.cpp @@ -21,13 +21,6 @@ Monster::Monster() , maxMana(0) , mana(0) -, attack(0) -, defense(0) -, agility(0) -, intelligence(0) -, gut(0) -, magicResistance(0) - , expReward(0) , goldReward(0) @@ -40,4 +33,13 @@ Monster::~Monster() { } + +void Monster::SubtractHealth(int amount) { + if (amount > Health()) { + health = 0; + } else { + health -= amount; + } +} + }