From 79b2d1dd4f114bc31105df0e554f9c1f18c87e5d Mon Sep 17 00:00:00 2001 From: nsensfel Date: Wed, 29 Aug 2018 14:38:07 +0200 Subject: Updates btl_attack.erl, fixes small mistakes. --- src/shared/struct/shr_omnimods.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/shared/struct/shr_omnimods.erl') diff --git a/src/shared/struct/shr_omnimods.erl b/src/shared/struct/shr_omnimods.erl index 31d61f2..f0ccdc5 100644 --- a/src/shared/struct/shr_omnimods.erl +++ b/src/shared/struct/shr_omnimods.erl @@ -197,8 +197,9 @@ get_attack_damage (AttackModifier, AttackerOmnimods, DefenderOmnimods) -> dict:fold ( fun (Name, BaseDmg, CurrentResult) -> + NormDmg = max(0, BaseDmg), ModifiedDmg = - (shr_math_util:ceil(BaseDmg * AttackModifier) - BaseDefense), + (shr_math_util:ceil(NormDmg * AttackModifier) - BaseDefense), case dict:find(Name, DefenderOmnimodsDefmods) of {ok, Def} when (Def >= ModifiedDmg) -> CurrentResult; {ok, Def} -> (CurrentResult + (ModifiedDmg - Def)); -- cgit v1.2.3-70-g09d2