]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Monster.h
removed lazy fwd headers
[l2e.git] / src / battle / Monster.h
index e4d787e741e87856be256f9f626554b78d49263b..6aaf1f46164e96a182dd1b7fe1f602a4c5b2248b 100644 (file)
@@ -1,27 +1,28 @@
-/*
- * Monster.h
- *
- *  Created on: Aug 3, 2012
- *      Author: holy
- */
-
 #ifndef BATTLE_MONSTER_H_
 #define BATTLE_MONSTER_H_
 
-#include "Stats.h"
-
-#include <SDL.h>
-
-namespace common { class Item; }
+namespace common {
+       class Item;
+}
 namespace graphics {
        class Animation;
        class Sprite;
 }
 
+#include "AttackChoice.h"
+#include "../common/Stats.h"
+#include "../math/Vector.h"
+#include "../graphics/Animation.h"
+
+#include <SDL.h>
+
 namespace battle {
 
 class Monster {
 
+public:
+       static const int TYPE_ID = 202;
+
 public:
        Monster();
        ~Monster();
@@ -40,8 +41,8 @@ public:
        Uint16 Mana() const { return mana; }
        int RelativeMana(int max) const { return mana * max / maxMana; }
 
-       Stats &GetStats() { return stats; }
-       const Stats &GetStats() const { return stats; }
+       common::Stats &GetStats() { return stats; }
+       const common::Stats &GetStats() const { return stats; }
 
        Uint16 ExpReward() const { return expReward; }
        Uint16 GoldReward() const { return goldReward; }
@@ -52,11 +53,17 @@ public:
        const /* Script */ void *AttackScript() { return attackScript; }
        const /* Script */ void *DefenseScript() { return defenseScript; }
 
-       graphics::Animation *AttackAnimation() { return attackAnimation; }
+       graphics::AnimationRunner &GetAnimation() { return animation; }
+       const graphics::AnimationRunner &GetAnimation() const { return animation; }
+       void SetAnimation(const graphics::AnimationRunner &a) { animation = a; }
+
+       const graphics::Animation *MeleeAnimation() const { return meleeAnimation; }
        const graphics::Animation *AttackAnimation() const { return attackAnimation; }
-       graphics::Animation *SpellAnimation() { return spellAnimation; }
        const graphics::Animation *SpellAnimation() const { return spellAnimation; }
 
+       math::Vector<int> &Position() { return position; }
+       const math::Vector<int> &Position() const { return position; }
+
 // temporary setters until loader is implemented
 public:
        void SetName(const char *n) { name = n; }
@@ -66,11 +73,18 @@ public:
        void SetHealth(Uint16 h) { health = h; }
        void SetMaxMana(Uint16 m) { maxMana = m; }
        void SetMana(Uint16 m) { mana = m; }
-       void SetStats(const Stats &s) { stats = s; }
+       void SetStats(const common::Stats &s) { stats = s; }
        void SetReward(Uint16 exp, Uint16 gold) { expReward = exp; goldReward = gold; }
 
-       void SetAttackAnimation(graphics::Animation *a) { attackAnimation = a; }
-       void SetSpellAnimation(graphics::Animation *a) { spellAnimation = a; }
+       void SetMeleeAnimation(const graphics::Animation *a) { meleeAnimation = a; }
+       void SetAttackAnimation(const graphics::Animation *a) { attackAnimation = a; }
+       void SetSpellAnimation(const graphics::Animation *a) { spellAnimation = a; }
+
+       AttackChoice &GetAttackChoice() { return attackChoice; }
+       const AttackChoice &GetAttackChoice() const { return attackChoice; }
+
+       static void CreateTypeDescription();
+       static void Construct(void *);
 
 private:
        const char *name;
@@ -79,18 +93,25 @@ private:
        /* Script */ void *attackScript;
        /* Script */ void *defenseScript;
 
-       graphics::Animation *attackAnimation;
-       graphics::Animation *spellAnimation;
+       const graphics::Animation *meleeAnimation;
+       const graphics::Animation *attackAnimation;
+       const graphics::Animation *spellAnimation;
+
+       graphics::AnimationRunner animation;
+
+       math::Vector<int> position;
+
+       AttackChoice attackChoice;
 
-       Uint16 maxHealth, health;
-       Uint16 maxMana, mana;
+       int maxHealth, health;
+       int maxMana, mana;
 
-       Stats stats;
+       common::Stats stats;
 
-       Uint16 expReward, goldReward;
+       int expReward, goldReward;
 
-       Uint8 level;
-       Uint8 dropChance;
+       int level;
+       int dropChance;
 
 };