Fix healcounter
This commit is contained in:
parent
817da7bd60
commit
1809dafb73
2 changed files with 4 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue