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