]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/Spell.h
implemented inventory item swapping
[l2e.git] / src / common / Spell.h
index 9bf0a4b8c5b6b689d3f600db671be15ea162dd6d..0f864b81bda0c3c8bd42373e24cf324e82c9a3b1 100644 (file)
@@ -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; }
@@ -36,21 +39,10 @@ public:
 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();
-
-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 Construct(void *);
 
 private:
        const char *name;
@@ -58,10 +50,12 @@ private:
        int value;
 
        int cost;
-       Uint8 usability;
        TargetingMode targetingMode;
        HeroGroup usableBy;
 
+       bool status;
+       bool battle;
+
 };
 
 }