X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=inline;f=src%2Fbattle%2FMonster.cpp;h=033614231ff0cea9ffec691b5c0dfcf307822901;hb=fbf5a98f8fd0da951e469003fe87d575a6bb30a4;hp=acbe6cf93bdacbd402eb4cff94ee6ce53396bb51;hpb=d7927b645a22776d6e1e1c209365e8f74c4350e9;p=l2e.git diff --git a/src/battle/Monster.cpp b/src/battle/Monster.cpp index acbe6cf..0336142 100644 --- a/src/battle/Monster.cpp +++ b/src/battle/Monster.cpp @@ -40,4 +40,13 @@ Monster::~Monster() { } + +void Monster::SubtractHealth(int amount) { + if (amount > Health()) { + health = 0; + } else { + health -= amount; + } +} + }