From 1bcde2b23a273c7ff6c5b5ea5346111084e01700 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Fri, 22 Jun 2018 14:49:47 +0200 Subject: Removes obsolete sanity checks. --- src/battlemap/struct/bm_attack.erl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/battlemap/struct/bm_attack.erl') 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. -- cgit v1.2.3-70-g09d2