]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/Spell.h
added spells
[l2e.git] / src / common / Spell.h
diff --git a/src/common/Spell.h b/src/common/Spell.h
new file mode 100644 (file)
index 0000000..38d2395
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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:
+       Spell();
+
+public:
+       const char *Name() const { return name; }
+       Uint16 Value() const { return value; }
+       Uint8 Cost() const { return cost; }
+
+       bool CanUseOnStatusScreen() const { return usability & USABILITY_STATUS; }
+       bool CanUseInBattle() const { return usability & USABILITY_BATTLE; }
+
+       TargetingMode &GetTargetingMode() { return targetingMode; }
+       const TargetingMode &GetTargetingMode() const { return targetingMode; }
+
+       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; }
+
+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;
+
+       Uint16 value;
+
+       Uint8 cost;
+       Uint8 usability;
+       TargetingMode targetingMode;
+       HeroGroup usableBy;
+
+};
+
+}
+
+#endif /* COMMON_SPELL_H_ */