X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FMonster.cpp;h=f0b9f3782f0587c1d289d671b669c73c970427b7;hb=520af5a8ef4fdfd4156377d4fccd93eecd450f0f;hp=1a52b7911004a7fb4e4d16a0a11a4f28d78bfc25;hpb=6a3e02e15c1626958540626bf2ccf39f8e365ca5;p=l2e.git diff --git a/src/battle/Monster.cpp b/src/battle/Monster.cpp index 1a52b79..f0b9f37 100644 --- a/src/battle/Monster.cpp +++ b/src/battle/Monster.cpp @@ -9,14 +9,41 @@ namespace battle { -Monster::Monster() { - // TODO Auto-generated constructor stub +Monster::Monster() +: name("") +, sprite(0) +, dropItem(0) +, attackScript(0) +, defenseScript(0) + +, meleeAnimation(0) +, attackAnimation(0) +, spellAnimation(0) + +, maxHealth(0) +, health(0) +, maxMana(0) +, mana(0) + +, expReward(0) +, goldReward(0) + +, level(0) +, dropChance(0) { } Monster::~Monster() { - // TODO Auto-generated destructor stub } -} /* namespace battle */ + +void Monster::SubtractHealth(int amount) { + if (amount > Health()) { + health = 0; + } else { + health -= amount; + } +} + +}