school/cs142/lab10/archer.cpp

22 lines
418 B
C++
Raw Normal View History

2016-04-06 20:45:34 -07:00
#include "archer.h"
archer::archer(string name, int max_hp, int strength, int speed, int magic) :
fighter(name, max_hp, strength, speed, magic), original_speed(speed) {}
int archer::getDamage() {
return speed;
}
void archer::reset() {
hp = max_hp;
speed = original_speed;
}
bool archer::useAbility() {
speed++;
return true;
}
int archer::get_original_speed() {
return original_speed;
}