]> git.localhorst.tv Git - l2e.git/blob - src/common/Capsule.h
8d4791d20b2e4d20c2ed8c59dda9882115ce7bae
[l2e.git] / src / common / Capsule.h
1 #ifndef COMMON_CAPSULE_H_
2 #define COMMON_CAPSULE_H_
3
4 namespace graphics {
5         class Animation;
6         class Sprite;
7 }
8
9 #include "../common/Stats.h"
10
11 #include <SDL.h>
12
13 namespace common {
14
15 class Spell;
16
17 class Capsule {
18
19 public:
20         static const int TYPE_ID = 307;
21
22 public:
23         Capsule();
24
25         const char *Name() const { return name; }
26         void SetName(const char *n) { name = n; }
27         const char *ClassName() const;
28         const char *Alignment() const { return alignment; }
29         const char *Tribe() const;
30         const Spell *Attack1() const;
31         const Spell *Attack2() const;
32         const Spell *Attack3() const;
33
34         Uint16 MaxHealth() const;
35
36         Stats GetStats() const;
37
38         Uint8 Level() const { return level; }
39         int Experience() const { return experience; }
40         int NextLevel() const;
41
42         graphics::Sprite *BattleSprite();
43         const graphics::Sprite *BattleSprite() const;
44         graphics::Animation *MeleeAnimation();
45         graphics::Animation *AttackAnimation();
46         graphics::Animation *SpellAnimation();
47
48         static void CreateTypeDescription();
49         static void Construct(void *);
50
51 private:
52         struct Class {
53                 static const int TYPE_ID = 308;
54
55                 Class();
56
57                 static void CreateTypeDescription();
58                 static void Construct(void *);
59
60                 const char *name;
61                 const char *tribe;
62                 Spell *attacks[3];
63                 graphics::Sprite *battleSprite;
64                 graphics::Animation *meleeAnimation;
65                 graphics::Animation *attackAnimation;
66                 graphics::Animation *spellAnimation;
67
68                 int healthBoost;
69                 Stats statBoost;
70         };
71
72         Class &GetClass();
73         const Class &GetClass() const;
74
75         const char *name;
76         const char *alignment;
77
78         int maxHealth;
79
80         Stats stats;
81
82         int level;
83         int experience;
84
85         int *levelLadder;
86         int numLevels;
87
88         Class *classes;
89         int numClasses, curClass, maxClass;
90
91 };
92
93 }
94
95 #endif /* COMMON_CAPSULE_H_ */