]> git.localhorst.tv Git - l2e.git/blob - src/battle/Monster.cpp
added simple damage calculation formula
[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 , maxHealth(0)
20 , health(0)
21 , maxMana(0)
22 , mana(0)
23
24 , expReward(0)
25 , goldReward(0)
26
27 , level(0)
28 , dropChance(0) {
29
30 }
31
32 Monster::~Monster() {
33
34 }
35
36
37 void Monster::SubtractHealth(int amount) {
38         if (amount > Health()) {
39                 health = 0;
40         } else {
41                 health -= amount;
42         }
43 }
44
45 }