aboutsummaryrefslogtreecommitdiffstats
path: root/include/mob.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mob.hpp')
-rw-r--r--include/mob.hpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/mob.hpp b/include/mob.hpp
index 00cd396..4425159 100644
--- a/include/mob.hpp
+++ b/include/mob.hpp
@@ -1,6 +1,9 @@
#ifndef MOB_H_
#define MOB_H_
+#include <forward_list>
+#include <tuple>
+
#include <common.hpp>
#include <entities.hpp>
#include <gametime.hpp>
@@ -13,8 +16,12 @@ using namespace tinyxml2;
extern Player *player;
extern std::string currentXML;
+using Drop = std::tuple<std::string, unsigned int, float>;
+
class Mob : public Entity {
protected:
+ std::forward_list<Drop> drop;
+
unsigned int actCounter;
unsigned int actCounterInitial;
bool ridable;
@@ -29,6 +36,10 @@ public:
void wander(void);
void ride(Entity *e);
virtual void act(void) =0;
+
+ virtual void onHit(unsigned int) =0;
+ virtual void onDeath(void);
+
virtual bool bindTex(void) =0;
virtual void createFromXML(const XMLElement *e) =0;
};
@@ -46,6 +57,7 @@ public:
Page(void);
void act(void);
+ void onHit(unsigned int);
bool bindTex(void);
void createFromXML(const XMLElement *e);
};
@@ -55,6 +67,7 @@ public:
Door(void);
void act(void);
+ void onHit(unsigned int);
bool bindTex(void);
void createFromXML(const XMLElement *e);
};
@@ -64,6 +77,7 @@ public:
Cat(void);
void act(void);
+ void onHit(unsigned int);
bool bindTex(void);
void createFromXML(const XMLElement *e);
};
@@ -73,6 +87,7 @@ public:
Rabbit(void);
void act(void);
+ void onHit(unsigned int);
bool bindTex(void);
void createFromXML(const XMLElement *e);
};
@@ -84,6 +99,7 @@ public:
Bird(void);
void act(void);
+ void onHit(unsigned int);
bool bindTex(void);
void createFromXML(const XMLElement *e);
};
@@ -96,6 +112,7 @@ public:
Trigger(void);
void act(void);
+ void onHit(unsigned int);
bool bindTex(void);
void createFromXML(const XMLElement *e);
};