]> git.localhorst.tv Git - l2e.git/blob - src/battle/Monster.h
apply damage indicated by attack selection
[l2e.git] / src / battle / Monster.h
1 /*
2  * Monster.h
3  *
4  *  Created on: Aug 3, 2012
5  *      Author: holy
6  */
7
8 #ifndef BATTLE_MONSTER_H_
9 #define BATTLE_MONSTER_H_
10
11 #include <SDL.h>
12
13 namespace graphics { class Sprite; }
14
15 namespace battle {
16
17 class Monster {
18
19 public:
20         Monster();
21         ~Monster();
22
23 public:
24         const char *Name() const { return name; }
25         Uint8 Level() const { return level; }
26         const graphics::Sprite *Sprite() const { return sprite; }
27
28         Uint16 MaxHealth() const { return maxHealth; }
29         Uint16 Health() const { return health; }
30         int RelativeHealth(int max) const { return health * max / maxHealth; }
31         void SubtractHealth(int amount);
32
33         Uint16 MaxMana() const { return maxMana; }
34         Uint16 Mana() const { return mana; }
35         int RelativeMana(int max) const { return mana * max / maxMana; }
36
37         Uint16 Attack() const { return attack; }
38         Uint16 Defense() const { return defense; }
39         Uint16 Agility() const { return agility; }
40         Uint16 Intelligence() const { return intelligence; }
41         Uint16 Gut() const { return gut; }
42         Uint16 MagicResistance() const { return magicResistance; }
43
44         Uint16 ExpReward() const { return expReward; }
45         Uint16 GoldReward() const { return goldReward; }
46
47         const /* Item */ void *DropItem() const { return dropItem; }
48         Uint8 DropChance() const { return dropChance; }
49
50         const /* Script */ void *AttackScript() { return attackScript; }
51         const /* Script */ void *DefenseScript() { return defenseScript; }
52
53 // temporary setters until loader is implemented
54 public:
55         void SetName(const char *n) { name = n; }
56         void SetSprite(graphics::Sprite *s) { sprite = s; }
57         void SetMaxHealth(Uint16 m) { maxHealth = m; }
58         void SetHealth(Uint16 h) { health = h; }
59
60 private:
61         const char *name;
62         graphics::Sprite *sprite;
63         /* Item */ void *dropItem;
64         /* Script */ void *attackScript;
65         /* Script */ void *defenseScript;
66
67         Uint16 maxHealth, health;
68         Uint16 maxMana, mana;
69
70         Uint16 attack;
71         Uint16 defense;
72         Uint16 agility;
73         Uint16 intelligence;
74         Uint16 gut;
75         Uint16 magicResistance;
76
77         Uint16 expReward, goldReward;
78
79         Uint8 level;
80         Uint8 dropChance;
81
82 };
83
84 }
85
86 #endif /* BATTLE_MONSTER_H_ */