]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/Monster.h
added attack targets selection state
[l2e.git] / src / battle / Monster.h
index adebbb28703670c949a3490649d992efcbf6bbdf..d3a7162111939c1f887cf4c63fa548f4575b0beb 100644 (file)
@@ -10,6 +10,8 @@
 
 #include <SDL.h>
 
+namespace graphics { class Sprite; }
+
 namespace battle {
 
 class Monster {
@@ -21,15 +23,15 @@ public:
 public:
        const char *Name() const { return name; }
        Uint8 Level() const { return level; }
-       const /* Sprite */ void *Sprite() const { return sprite; }
+       const graphics::Sprite *Sprite() const { return sprite; }
 
        Uint16 MaxHealth() const { return maxHealth; }
        Uint16 Health() const { return health; }
-       int RelativeHealth(int max) { return health * max / maxHealth; }
+       int RelativeHealth(int max) const { return health * max / maxHealth; }
 
        Uint16 MaxMana() const { return maxMana; }
        Uint16 Mana() const { return mana; }
-       int RelativeMana(int max) { return mana * max / maxMana; }
+       int RelativeMana(int max) const { return mana * max / maxMana; }
 
        Uint16 Attack() const { return attack; }
        Uint16 Defense() const { return defense; }
@@ -47,9 +49,15 @@ public:
        const /* Script */ void *AttackScript() { return attackScript; }
        const /* Script */ void *DefenseScript() { return defenseScript; }
 
+// temporary setters until loader is implemented
+public:
+       void SetSprite(graphics::Sprite *s) { sprite = s; }
+       void SetMaxHealth(Uint16 m) { maxHealth = m; }
+       void SetHealth(Uint16 h) { health = h; }
+
 private:
        const char *name;
-       /* Sprite */ void *sprite;
+       graphics::Sprite *sprite;
        /* Item */ void *dropItem;
        /* Script */ void *attackScript;
        /* Script */ void *defenseScript;