Dead participants don't get block

This commit is contained in:
henriquenakashima 2020-09-26 18:28:08 -04:00
parent 11df4f1164
commit 956b8f5c82
2 changed files with 22 additions and 2 deletions

View file

@ -44,6 +44,10 @@ public class BattleParticipant
}
public int DealDamage(int damage) {
if (!IsAlive()) {
return 0;
}
int blockedDamage = Math.Min(damage, this.block);
if (blockedDamage > 0) {
this.block -= blockedDamage;
@ -56,6 +60,10 @@ public class BattleParticipant
}
public void CheckState() {
if (!IsAlive()) {
return;
}
if (this.hp <= 0) {
this.dead = true;
WipeStatus();
@ -74,10 +82,18 @@ public class BattleParticipant
}
public void AddBlock(int block) {
if (!IsAlive()) {
return;
}
this.block += block;
}
public void ResetBlock() {
if (!IsAlive()) {
return;
}
this.block = 0;
}
@ -90,6 +106,10 @@ public class BattleParticipant
}
public void IncreaseMaxHP(int amount) {
if (!IsAlive()) {
return;
}
this.maxHP += amount;
if (this.hp > 0) {
this.hp += amount;