]> git.localhorst.tv Git - l2e.git/blob - src/common/Capsule.h
b1039fa90e2474fe94d54204726a79d36af88a6d
[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         const char *ClassName() const;
27         const char *Alignment() const { return alignment; }
28         const char *Tribe() const;
29         const Spell *Attack1() const;
30         const Spell *Attack2() const;
31         const Spell *Attack3() const;
32
33         Uint16 MaxHealth() const;
34
35         Stats GetStats() const;
36
37         Uint8 Level() const { return level; }
38         int Experience() const { return experience; }
39         int NextLevel() const;
40
41         graphics::Sprite *BattleSprite();
42         const graphics::Sprite *BattleSprite() const;
43         graphics::Animation *MeleeAnimation();
44         graphics::Animation *AttackAnimation();
45         graphics::Animation *SpellAnimation();
46
47         static void CreateTypeDescription();
48         static void Construct(void *);
49
50 private:
51         struct Class {
52                 static const int TYPE_ID = 308;
53
54                 Class();
55
56                 static void CreateTypeDescription();
57                 static void Construct(void *);
58
59                 const char *name;
60                 const char *tribe;
61                 Spell *attacks[3];
62                 graphics::Sprite *battleSprite;
63                 graphics::Animation *meleeAnimation;
64                 graphics::Animation *attackAnimation;
65                 graphics::Animation *spellAnimation;
66
67                 int healthBoost;
68                 Stats statBoost;
69         };
70
71         Class &GetClass();
72         const Class &GetClass() const;
73
74         const char *name;
75         const char *alignment;
76
77         int maxHealth;
78
79         Stats stats;
80
81         int level;
82         int experience;
83
84         int *levelLadder;
85         int numLevels;
86
87         Class *classes;
88         int numClasses, curClass, maxClass;
89
90 };
91
92 }
93
94 #endif /* COMMON_CAPSULE_H_ */