adding cs142 code
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user