Created
March 26, 2020 19:06
-
-
Save Saafan/b7b2db67de0c3e410c500d1e4548d7cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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