Button to deal damage to random participant

This commit is contained in:
henriquenakashima 2020-09-17 23:31:49 -04:00
parent 778228bc6b
commit 581d9d7811
2 changed files with 15 additions and 2 deletions

View file

@ -8,6 +8,10 @@ public class BattleParticipant
protected int hp;
protected int maxHP;
public void init() {
this.hp = this.maxHP;
}
public string getDisplayName() {
return this.displayName;
}
@ -20,7 +24,8 @@ public class BattleParticipant
return this.maxHP;
}
public void init() {
this.hp = this.maxHP;
public void dealDamage(int damage) {
this.hp -= damage;
if (this.hp < 0) this.hp = 0;
}
}