ajout du combat

This commit is contained in:
marc barbier
2021-01-03 23:10:00 +01:00
parent 3eb12938ba
commit 13e2c1bab1
105 changed files with 126 additions and 16 deletions
+16
View File
@@ -60,5 +60,21 @@ public abstract class Card{
* @return
*/
public abstract int getCost();
/**
* diminue les point de vie de la carte
* @param amountOfHpToLose nombre de hp a perdre
* @return renvoie true sur si la carte est a 0hp
*/
public boolean takeDamage(int amountOfHpToLose)
{
if(health <= amountOfHpToLose)
{
health = 0;
}else {
health -= amountOfHpToLose;
}
return health == 0;
}
}