16 lines
378 B
C++
16 lines
378 B
C++
#include "Healer.h"
|
|
#include "Actor.h"
|
|
#include "Destructible.h"
|
|
|
|
Healer::Healer(float amount) : amount(amount) {
|
|
}
|
|
|
|
bool Healer::use(Actor* owner, Actor* wearer) {
|
|
if (wearer->destructible) {
|
|
float amountHealed = wearer->destructible->heal(amount);
|
|
if (amountHealed > 0) {
|
|
return Pickable::use(owner, wearer);
|
|
}
|
|
}
|
|
return false;
|
|
} |