X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FSpell.h;h=2cb14ef94d9ec3e5771e791472e77b95d2f31807;hb=7b3710c47f24e64e0d01378a4564730bcb2f6ef2;hp=eb8fa02928605b2e84b2aa37084fbdc994a43405;hpb=b02da898c7c8a08141df4e797774a61cf5e0163f;p=l2e.git diff --git a/src/common/Spell.h b/src/common/Spell.h index eb8fa02..2cb14ef 100644 --- a/src/common/Spell.h +++ b/src/common/Spell.h @@ -1,20 +1,15 @@ -/* - * Spell.h - * - * Created on: Aug 10, 2012 - * Author: holy - */ - #ifndef COMMON_SPELL_H_ #define COMMON_SPELL_H_ -#include "HeroGroup.h" #include "TargetingMode.h" namespace common { class Spell { +public: + static const int TYPE_ID = 304; + public: Spell(); @@ -23,48 +18,39 @@ 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; } - HeroGroup &UsableBy() { return usableBy; } - const HeroGroup &UsableBy() const { return usableBy; } + int HeroMask() const { return heroMask; } + + static bool Less(const Spell *, const Spell *); // 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; } static void CreateTypeDescription(); static void Construct(void *); -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, - }; - private: const char *name; int value; int cost; - Uint8 usability; TargetingMode targetingMode; - HeroGroup usableBy; + int heroMask; + + bool status; + bool battle; }; } -#endif /* COMMON_SPELL_H_ */ +#endif