Skip to content

Instantly share code, notes, and snippets.

@Saafan
Created March 26, 2020 19:06
Show Gist options
  • Save Saafan/b7b2db67de0c3e410c500d1e4548d7cb to your computer and use it in GitHub Desktop.
Save Saafan/b7b2db67de0c3e410c500d1e4548d7cb to your computer and use it in GitHub Desktop.
public void attack(Minion target) {
if(!target.isDivine())
target.setCurrentHP(target.currentHP - this.getAttack());
else
target.setDivine(false);
if(!isDivine())
setCurrentHP(currentHP - target.getAttack());
else
setDivine(false);
}
public void attack(Hero target) throws InvalidTargetException {
if(getName().equals("Icehowl"))
throw new InvalidTargetException("This minion is icehowl and it cannot attack heros");
target.setCurrentHP(target.getCurrentHP() - attack);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment