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