]> git.localhorst.tv Git - l2e.git/blob - src/battle/Monster.cpp
initialized monster animations and enabled -Wall compiler flag
[l2e.git] / src / battle / Monster.cpp
1 /*
2  * Monster.cpp
3  *
4  *  Created on: Aug 3, 2012
5  *      Author: holy
6  */
7
8 #include "Monster.h"
9
10 namespace battle {
11
12 Monster::Monster()
13 : name("")
14 , sprite(0)
15 , dropItem(0)
16 , attackScript(0)
17 , defenseScript(0)
18
19 , meleeAnimation(0)
20 , attackAnimation(0)
21 , spellAnimation(0)
22
23 , maxHealth(0)
24 , health(0)
25 , maxMana(0)
26 , mana(0)
27
28 , expReward(0)
29 , goldReward(0)
30
31 , level(0)
32 , dropChance(0) {
33
34 }
35
36 Monster::~Monster() {
37
38 }
39
40
41 void Monster::SubtractHealth(int amount) {
42         if (amount > Health()) {
43                 health = 0;
44         } else {
45                 health -= amount;
46         }
47 }
48
49 }