X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2FMonster.h;h=6aaf1f46164e96a182dd1b7fe1f602a4c5b2248b;hb=092a2dd175a4001a495c84ee85211734fb928c83;hp=c12567257e01a33e69d45acbb0f451c18db4609e;hpb=0542849dfccfec1ce1477265fa0fee2401a8fb23;p=l2e.git diff --git a/src/battle/Monster.h b/src/battle/Monster.h index c125672..6aaf1f4 100644 --- a/src/battle/Monster.h +++ b/src/battle/Monster.h @@ -1,29 +1,28 @@ -/* - * Monster.h - * - * Created on: Aug 3, 2012 - * Author: holy - */ - #ifndef BATTLE_MONSTER_H_ #define BATTLE_MONSTER_H_ +namespace common { + class Item; +} +namespace graphics { + class Animation; + class Sprite; +} + #include "AttackChoice.h" -#include "Stats.h" -#include "../geometry/Vector.h" +#include "../common/Stats.h" +#include "../math/Vector.h" #include "../graphics/Animation.h" #include -namespace common { class Item; } -namespace graphics { - class Sprite; -} - namespace battle { class Monster { +public: + static const int TYPE_ID = 202; + public: Monster(); ~Monster(); @@ -42,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; } @@ -62,8 +61,8 @@ public: const graphics::Animation *AttackAnimation() const { return attackAnimation; } const graphics::Animation *SpellAnimation() const { return spellAnimation; } - geometry::Vector &Position() { return position; } - const geometry::Vector &Position() const { return position; } + math::Vector &Position() { return position; } + const math::Vector &Position() const { return position; } // temporary setters until loader is implemented public: @@ -74,7 +73,7 @@ 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 SetMeleeAnimation(const graphics::Animation *a) { meleeAnimation = a; } @@ -84,6 +83,9 @@ public: AttackChoice &GetAttackChoice() { return attackChoice; } const AttackChoice &GetAttackChoice() const { return attackChoice; } + static void CreateTypeDescription(); + static void Construct(void *); + private: const char *name; graphics::Sprite *sprite; @@ -97,19 +99,19 @@ private: graphics::AnimationRunner animation; - geometry::Vector position; + math::Vector 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; };