X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbattle%2FMonster.cpp;h=f0b9f3782f0587c1d289d671b669c73c970427b7;hb=1c36f0002e3778f05aca3e6836556cfff94a268e;hp=acbe6cf93bdacbd402eb4cff94ee6ce53396bb51;hpb=d7927b645a22776d6e1e1c209365e8f74c4350e9;p=l2e.git diff --git a/src/battle/Monster.cpp b/src/battle/Monster.cpp index acbe6cf..f0b9f37 100644 --- a/src/battle/Monster.cpp +++ b/src/battle/Monster.cpp @@ -16,18 +16,15 @@ Monster::Monster() , attackScript(0) , defenseScript(0) +, meleeAnimation(0) +, attackAnimation(0) +, spellAnimation(0) + , maxHealth(0) , health(0) , maxMana(0) , mana(0) -, attack(0) -, defense(0) -, agility(0) -, intelligence(0) -, gut(0) -, magicResistance(0) - , expReward(0) , goldReward(0) @@ -40,4 +37,13 @@ Monster::~Monster() { } + +void Monster::SubtractHealth(int amount) { + if (amount > Health()) { + health = 0; + } else { + health -= amount; + } +} + }