This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/items/Heal.cpp

36 lines
496 B
C++
Raw Normal View History

2013-07-06 19:21:25 +00:00
/*
* SlowHeal.cpp
*
* Created on: 06.07.2013
* Author: Felix
*/
#include "Heal.h"
#include "../abstract/Character.h"
2013-07-10 21:41:24 +00:00
Heal::Heal() :
Gadget("Heal") {
}
2013-07-06 19:21:25 +00:00
void
Heal::onUse(Character& character) {
mCharacter = &character;
mHealedTotal = 0;
}
void
Heal::onThink(int elapsed) {
if (mHealedTotal < 50 && mTimer.isExpired()) {
mCharacter->onDamage(-1);
mHealedTotal += 1;
mTimer.restart(sf::milliseconds(75));
}
}
sf::Time
Heal::getCooldownTime() {
return sf::seconds(5);
}