diff --git a/Assets/Battle/BattleParticipant.cs b/Assets/Battle/BattleParticipant.cs index 977b6b9..2255095 100644 --- a/Assets/Battle/BattleParticipant.cs +++ b/Assets/Battle/BattleParticipant.cs @@ -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; diff --git a/TODO.txt b/TODO.txt index d09279a..0b576fb 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,5 +5,5 @@ - Show on who enemies will use the cards - Extend BattleState to be more than hero turn true/false - Remove UI from dead participants -- Dead participants do not get block -- GolemCharge art \ No newline at end of file +- GolemCharge art +- Create BattleInput \ No newline at end of file