]> git.localhorst.tv Git - l2e.git/blob - src/battle/Hero.h
added Hero class for battle state
[l2e.git] / src / battle / Hero.h
1 /*
2  * Hero.h
3  *
4  *  Created on: Aug 6, 2012
5  *      Author: holy
6  */
7
8 #ifndef BATTLE_HERO_H_
9 #define BATTLE_HERO_H_
10
11 #include <SDL.h>
12
13 namespace graphics { class Sprite; }
14
15 namespace battle {
16
17 class Hero {
18
19 public:
20         Hero();
21         ~Hero();
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) { return health * max / maxHealth; }
31
32         Uint16 MaxMana() const { return maxMana; }
33         Uint16 Mana() const { return mana; }
34         int RelativeMana(int max) { return mana * max / maxMana; }
35
36         Uint16 Attack() const { return attack; }
37         Uint16 Defense() const { return defense; }
38         Uint16 Agility() const { return agility; }
39         Uint16 Intelligence() const { return intelligence; }
40         Uint16 Gut() const { return gut; }
41         Uint16 MagicResistance() const { return magicResistance; }
42
43 // temporary setters until loader is implemented
44 public:
45         void SetSprite(graphics::Sprite *s) { sprite = s; }
46
47 private:
48         const char *name;
49         graphics::Sprite *sprite;
50         // TODO: equipment and spells lists
51
52         Uint16 maxHealth, health;
53         Uint16 maxMana, mana;
54
55         Uint16 attack;
56         Uint16 defense;
57         Uint16 agility;
58         Uint16 intelligence;
59         Uint16 gut;
60         Uint16 magicResistance;
61
62         Uint8 level;
63
64 };
65
66 }
67
68 #endif /* BATTLE_HERO_H_ */