summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-08-29 14:38:07 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-08-29 14:38:07 +0200
commit79b2d1dd4f114bc31105df0e554f9c1f18c87e5d (patch)
treefbb70a8d76e6435d0ca04f332c53733ffd8bc0a5 /src/shared/struct/shr_omnimods.erl
parent9b424b11dbea33a41b2129daf232557515de9db1 (diff)
Updates btl_attack.erl, fixes small mistakes.
Diffstat (limited to 'src/shared/struct/shr_omnimods.erl')
-rw-r--r--src/shared/struct/shr_omnimods.erl3
1 files changed, 2 insertions, 1 deletions
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));