]> git.localhorst.tv Git - l2e.git/blob - src/common/Capsule.h
added capsule wheel and table
[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
44         Uint16 MaxHealth() const;
45
46         Stats GetStats() const;
47
48         Uint8 Level() const { return level; }
49         int Experience() const { return experience; }
50         int NextLevel() const;
51
52         graphics::Sprite *BattleSprite();
53         const graphics::Sprite *BattleSprite() const;
54         graphics::Animation *MeleeAnimation();
55         graphics::Animation *AttackAnimation();
56         graphics::Animation *SpellAnimation();
57
58         static void CreateTypeDescription();
59         static void Construct(void *);
60
61 private:
62         struct Class {
63                 static const int TYPE_ID = 308;
64
65                 Class();
66
67                 static void CreateTypeDescription();
68                 static void Construct(void *);
69
70                 const char *name;
71                 const char *tribe;
72                 Spell *attacks[3];
73                 graphics::Sprite *battleSprite;
74                 graphics::Animation *meleeAnimation;
75                 graphics::Animation *attackAnimation;
76                 graphics::Animation *spellAnimation;
77
78                 int healthBoost;
79                 Stats statBoost;
80         };
81
82         Class &GetClass();
83         const Class &GetClass() const;
84
85         const char *name;
86         const char *alignment;
87
88         geometry::Vector<int> alignmentCursor;
89         const graphics::Sprite *alignmentSprite;
90
91         int maxHealth;
92
93         Stats stats;
94
95         int level;
96         int experience;
97
98         int *levelLadder;
99         int numLevels;
100
101         Class *classes;
102         int numClasses, curClass, maxClass;
103
104 };
105
106 }
107
108 #endif /* COMMON_CAPSULE_H_ */