]> git.localhorst.tv Git - l2e.git/blob - src/battle/Capsule.h
include capsule in victory messages
[l2e.git] / src / battle / Capsule.h
1 #ifndef BATTLE_CAPSULE_H_
2 #define BATTLE_CAPSULE_H_
3
4 namespace common {
5         class Capsule;
6 }
7 namespace math {
8         template<class>
9         class Vector;
10 }
11
12 #include "AttackChoice.h"
13 #include "../common/Stats.h"
14 #include "../graphics/Animation.h"
15 #include "../graphics/Menu.h"
16
17 #include <SDL.h>
18
19 namespace battle {
20
21 class Capsule {
22
23 public:
24         Capsule(common::Capsule *master = 0);
25
26 public:
27         bool Active() const { return master; }
28         common::Capsule &Master() { return *master; }
29         const common::Capsule &Master() const { return *master; }
30
31
32         const char *Name() const;
33         Uint8 Level() const;
34         const graphics::Sprite *Sprite() const;
35
36         Uint16 MaxHealth() const;
37         Uint16 Health() const;
38         int RelativeHealth(int max) const;
39         void SubtractHealth(int amount);
40
41         common::Stats &GetStats() { return stats; }
42         const common::Stats &GetStats() const { return stats; }
43
44         graphics::AnimationRunner &GetAnimation() { return animation; }
45         const graphics::AnimationRunner &GetAnimation() const { return animation; }
46         void SetAnimation(const graphics::AnimationRunner &a) { animation = a; }
47
48         const graphics::Animation *MeleeAnimation() const;
49         const graphics::Animation *AttackAnimation() const;
50         const graphics::Animation *SpellAnimation() const;
51
52         math::Vector<int> &Position() { return position; }
53         const math::Vector<int> &Position() const { return position; }
54
55         AttackChoice &GetAttackChoice() { return attackChoice; }
56         const AttackChoice &GetAttackChoice() const { return attackChoice; }
57
58 private:
59         common::Capsule *master;
60
61         int health;
62
63         graphics::AnimationRunner animation;
64         math::Vector<int> position;
65         AttackChoice attackChoice;
66         common::Stats stats;
67
68 };
69
70 }
71
72 #endif