From 04369f067b8ab5b674a55467cc4dad98a9359273 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 17 May 2016 08:44:01 -0400 Subject: better mob combat stuff --- include/mob.hpp | 17 +++++++++++++++++ include/ui.hpp | 6 ++++++ 2 files changed, 23 insertions(+) (limited to 'include') 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 +#include + #include #include #include @@ -13,8 +16,12 @@ using namespace tinyxml2; extern Player *player; extern std::string currentXML; +using Drop = std::tuple; + class Mob : public Entity { protected: + std::forward_list 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); }; diff --git a/include/ui.hpp b/include/ui.hpp index 099bebf..b950b4b 100644 --- a/include/ui.hpp +++ b/include/ui.hpp @@ -94,6 +94,12 @@ namespace ui { float putText(const float x,const float y,const char *str,...); + /** + * This function is a facility for logic events to draw text; the text + * will be prepared then drawn in the render loop. + */ + void putTextL(vec2 c,const char *str, ...); + /* * Creates a dialogBox text string (format: `name`: `text`). This function simply sets up * variables that are drawn in ui::draw(). When the dialog box exists player control is -- cgit v1.2.3