X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FMonster.cpp;h=033614231ff0cea9ffec691b5c0dfcf307822901;hb=fbf5a98f8fd0da951e469003fe87d575a6bb30a4;hp=acbe6cf93bdacbd402eb4cff94ee6ce53396bb51;hpb=a01c2f05b5a6493d7fe097eb15e5337a095992ae;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; + } +} + }