]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/Capsule.h
extracted common capsule base
[l2e.git] / src / common / Capsule.h
diff --git a/src/common/Capsule.h b/src/common/Capsule.h
new file mode 100644 (file)
index 0000000..575a40c
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef COMMON_CAPSULE_H_
+#define COMMON_CAPSULE_H_
+
+namespace graphics {
+       class Animation;
+       class Sprite;
+}
+
+#include "../common/Stats.h"
+
+#include <SDL.h>
+
+namespace common {
+
+class Spell;
+
+class Capsule {
+
+public:
+       static const int TYPE_ID = 307;
+
+public:
+       Capsule();
+
+       const char *Name() const { return name; }
+       const char *Alignment() const { return alignment; }
+
+       Uint16 MaxHealth() const;
+
+       Stats GetStats();
+
+       Uint8 Level() const { return level; }
+       int Experience() const { return experience; }
+       int NextLevel() const;
+
+       graphics::Sprite *BattleSprite();
+       const graphics::Sprite *BattleSprite() const;
+       graphics::Animation *MeleeAnimation();
+       graphics::Animation *AttackAnimation();
+       graphics::Animation *SpellAnimation();
+
+       static void CreateTypeDescription();
+       static void Construct(void *);
+
+private:
+       struct Class {
+               static const int TYPE_ID = 308;
+
+               Class();
+
+               static void CreateTypeDescription();
+               static void Construct(void *);
+
+               const char *name;
+               const char *tribe;
+               Spell *attacks[3];
+               graphics::Sprite *battleSprite;
+               graphics::Animation *meleeAnimation;
+               graphics::Animation *attackAnimation;
+               graphics::Animation *spellAnimation;
+
+               int healthBoost;
+               Stats statBoost;
+       };
+
+       Class &GetClass();
+       const Class &GetClass() const;
+
+       const char *name;
+       const char *alignment;
+
+       int maxHealth;
+
+       Stats stats;
+
+       int level;
+       int experience;
+
+       int *levelLadder;
+       int numLevels;
+
+       Class *classes;
+       int numClasses, curClass, maxClass;
+
+};
+
+}
+
+#endif /* COMMON_CAPSULE_H_ */