X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FSpell.h;h=0f864b81bda0c3c8bd42373e24cf324e82c9a3b1;hb=dc2dcbbfa1298bed46a4190fbd337c7ef83cc8af;hp=38d2395125d1df4aa403d9aa130c752b4979003b;hpb=d872d756e64b8f1f57cba64ae19f479f8eab3927;p=l2e.git diff --git a/src/common/Spell.h b/src/common/Spell.h index 38d2395..0f864b8 100644 --- a/src/common/Spell.h +++ b/src/common/Spell.h @@ -15,6 +15,9 @@ namespace common { class Spell { +public: + static const int TYPE_ID = 304; + public: Spell(); @@ -23,8 +26,8 @@ public: Uint16 Value() const { return value; } Uint8 Cost() const { return cost; } - bool CanUseOnStatusScreen() const { return usability & USABILITY_STATUS; } - bool CanUseInBattle() const { return usability & USABILITY_BATTLE; } + bool CanUseOnStatusScreen() const { return status; } + bool CanUseInBattle() const { return battle; } TargetingMode &GetTargetingMode() { return targetingMode; } const TargetingMode &GetTargetingMode() const { return targetingMode; } @@ -32,36 +35,27 @@ public: HeroGroup &UsableBy() { return usableBy; } const HeroGroup &UsableBy() const { return usableBy; } - // TODO: add missing spell properties - // temporary setters public: void SetName(const char *n) { name = n; } void SetCost(Uint8 c) { cost = c; } - void SetUsableInBattle() { usability |= USABILITY_BATTLE; } + void SetUsableInBattle() { battle = true; } -private: - enum Usability { - // USABILITY_UNUSED = 1, - // USABILITY_UNUSED = 2, - // USABILITY_UNUSED = 4, - // USABILITY_UNUSED = 8, - // USABILITY_UNUSED = 16, - // USABILITY_UNUSED = 32, - USABILITY_STATUS = 64, - USABILITY_BATTLE = 128, - }; + static void CreateTypeDescription(); + static void Construct(void *); private: const char *name; - Uint16 value; + int value; - Uint8 cost; - Uint8 usability; + int cost; TargetingMode targetingMode; HeroGroup usableBy; + bool status; + bool battle; + }; }