I am passing all tests except for the one testing for 12 points when a wizard has a spell prepared. However, this is the implementation I have for that class, and I cannot tell why it is failing:
class Wizard extends Fighter {
public boolean hasPreparedSpell = false;
@Override
boolean isVulnerable() {
return !hasPreparedSpell;
}
@Override
int getDamagePoints(Fighter fighter) {
if (!fighter.isVulnerable()) {
return 12;
}
return 3;
}
void prepareSpell() {
hasPreparedSpell = true;
}
public String toString() {
return "Fighter is a Wizard";
}
}