summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'src/battlemap/struct/bm_attack.erl')
-rw-r--r-- | src/battlemap/struct/bm_attack.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/battlemap/struct/bm_attack.erl b/src/battlemap/struct/bm_attack.erl index af55606..ce3af53 100644 --- a/src/battlemap/struct/bm_attack.erl +++ b/src/battlemap/struct/bm_attack.erl @@ -201,14 +201,14 @@ when Damage = Attack#attack.damage, case AttackerHealth of - 0 -> + N when (N =< 0) -> {nothing, AttackerHealth, DefenderHealth}; _ -> { Attack, AttackerHealth, - max(0, (DefenderHealth - Damage)) + (DefenderHealth - Damage) } end; apply_to_healths @@ -228,14 +228,15 @@ when ) -> Damage = Attack#attack.damage, + %% This actually allows you to parry the counter of a dead character. case DefenderHealth of - 0 -> + N when (N =< 0) -> {nothing, AttackerHealth, DefenderHealth}; _ -> { Attack, - max(0, (AttackerHealth - Damage)), + (AttackerHealth - Damage), DefenderHealth } end. |