]> git.localhorst.tv Git - l2e.git/blob - src/common/Spell.h
handle dead hero in BattleState
[l2e.git] / src / common / Spell.h
1 /*
2  * Spell.h
3  *
4  *  Created on: Aug 10, 2012
5  *      Author: holy
6  */
7
8 #ifndef COMMON_SPELL_H_
9 #define COMMON_SPELL_H_
10
11 #include "HeroGroup.h"
12 #include "TargetingMode.h"
13
14 namespace common {
15
16 class Spell {
17
18 public:
19         Spell();
20
21 public:
22         const char *Name() const { return name; }
23         Uint16 Value() const { return value; }
24         Uint8 Cost() const { return cost; }
25
26         bool CanUseOnStatusScreen() const { return usability & USABILITY_STATUS; }
27         bool CanUseInBattle() const { return usability & USABILITY_BATTLE; }
28
29         TargetingMode &GetTargetingMode() { return targetingMode; }
30         const TargetingMode &GetTargetingMode() const { return targetingMode; }
31
32         HeroGroup &UsableBy() { return usableBy; }
33         const HeroGroup &UsableBy() const { return usableBy; }
34
35         // TODO: add missing spell properties
36
37 // temporary setters
38 public:
39         void SetName(const char *n) { name = n; }
40         void SetCost(Uint8 c) { cost = c; }
41         void SetUsableInBattle() { usability |= USABILITY_BATTLE; }
42
43 private:
44         enum Usability {
45                 // USABILITY_UNUSED = 1,
46                 // USABILITY_UNUSED = 2,
47                 // USABILITY_UNUSED = 4,
48                 // USABILITY_UNUSED = 8,
49                 // USABILITY_UNUSED = 16,
50                 // USABILITY_UNUSED = 32,
51                 USABILITY_STATUS = 64,
52                 USABILITY_BATTLE = 128,
53         };
54
55 private:
56         const char *name;
57
58         Uint16 value;
59
60         Uint8 cost;
61         Uint8 usability;
62         TargetingMode targetingMode;
63         HeroGroup usableBy;
64
65 };
66
67 }
68
69 #endif /* COMMON_SPELL_H_ */