]> git.localhorst.tv Git - l2e.git/blob - src/battle/Monster.cpp
apply damage indicated by attack selection
[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 , attack(0)
25 , defense(0)
26 , agility(0)
27 , intelligence(0)
28 , gut(0)
29 , magicResistance(0)
30
31 , expReward(0)
32 , goldReward(0)
33
34 , level(0)
35 , dropChance(0) {
36
37 }
38
39 Monster::~Monster() {
40
41 }
42
43
44 void Monster::SubtractHealth(int amount) {
45         if (amount > Health()) {
46                 health = 0;
47         } else {
48                 health -= amount;
49         }
50 }
51
52 }