diff --git a/src/Actor.cpp b/src/Actor.cpp index 4ea232a..36cc94d 100644 --- a/src/Actor.cpp +++ b/src/Actor.cpp @@ -21,11 +21,11 @@ void Actor::update() { bt->tick(this); } if (health < health_max) { + healcounter--; if (healcounter <= 0) { - health++; + heal(1); healcounter = 4; } - healcounter--; } if (health <= 0) { kill(); diff --git a/src/Actor.h b/src/Actor.h index 25db2ca..27eb1f0 100644 --- a/src/Actor.h +++ b/src/Actor.h @@ -31,11 +31,12 @@ protected: float range; bool alive; ActorFactions faction; + Actor(Tilemap *map, vec2i pos); public: int id; std::string name; - Actor(Tilemap *map, vec2i pos); + Actor(Tilemap *map, vec2i pos, std::string datakey); bool is_alive(){ return alive; }; void attack(vec2i dpos); // basic melee attack void attack(Actor* act);