aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2016-05-02 08:46:48 -0400
committerdrumsetmonkey <abelleisle@roadrunner.com>2016-05-02 08:46:48 -0400
commit13cd55136ffd09afd9f4828a00716ed9f94f0e0b (patch)
treed7841da0e6c1b1e4c2c5dc0dd2b492e4fcaeee18 /include
parentc61cbf691bee6dec791c3a161145ae16b448ac2b (diff)
Sword
Diffstat (limited to 'include')
-rw-r--r--include/entities.hpp6
-rw-r--r--include/inventory.hpp23
-rw-r--r--include/world.hpp2
3 files changed, 31 insertions, 0 deletions
diff --git a/include/entities.hpp b/include/entities.hpp
index f8780df..5417dac 100644
--- a/include/entities.hpp
+++ b/include/entities.hpp
@@ -254,6 +254,12 @@ public:
// causes the entity to take a player-inflicted hit
void takeHit(unsigned int _health, unsigned int cooldown);
+ // returns the amount of cool down before next hit
+ unsigned int coolDown();
+
+ // set the cool down
+ void setCooldown(unsigned int c);
+
// handles hits if they've been taken
void handleHits(void);
diff --git a/include/inventory.hpp b/include/inventory.hpp
index a41d4d4..bee2fbd 100644
--- a/include/inventory.hpp
+++ b/include/inventory.hpp
@@ -8,11 +8,17 @@
#define DEBUG
+class Entity;
+
/**
* The base item class
* This stores the name, width, height, and texture(s)
*/
class Item {
+private:
+ bool beingUsed;
+
+ std::vector<Entity*> interact;
public:
// what we want to call each item
std::string name;
@@ -29,6 +35,16 @@ public:
// how much the item is rotated in the hand
float rotation = 0.0f;
+ // return if the item is currently in use
+ virtual bool inUse();
+
+ // set the state of the item
+ virtual void setUse(bool use);
+
+ // add entities to the list of those being interacted
+ virtual void addInteract(Entity* e);
+ virtual void addInteract(std::vector<Entity*> e);
+
/**
* The function we use to call the child classes ability
* Note: Since this function is abstract, we HAVE to create one for each
@@ -73,6 +89,8 @@ private:
*/
float damage;
+ Ray hitbox;
+
//can touch this
public:
/**
@@ -82,6 +100,9 @@ public:
//TODO move
float getDamage();
+ // set the damage of the sword
+ void setDamage(float d);
+
/**
* handles the swinging of the sword
*/
@@ -187,6 +208,8 @@ public:
~Inventory(void); // Free's allocated memory
int useCurrent();
+ void currentAddInteract(Entity* e);
+ void currentAddInteract(std::vector<Entity*> e);
int addItem(std::string name,uint count);
int takeItem(std::string name,uint count);
diff --git a/include/world.hpp b/include/world.hpp
index 0aea879..0aba564 100644
--- a/include/world.hpp
+++ b/include/world.hpp
@@ -186,6 +186,8 @@ public:
// gets a pointer to the most recently added mob
Mob *getLastMob(void);
+ std::vector<Entity*> getMobs(void);
+
// gets the nearest interactable entity to the given one
Entity *getNearInteractable(Entity &e);