aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2019-09-16 17:44:51 +0200
committernsensfel <SpamShield0@noot-noot.org>2019-09-16 17:44:51 +0200
commit4f4987582ee41e2c68aad3b467b40eaed2ae9111 (patch)
treea7d33297d40327529184d02155a44d1439f9a45b
parent81bc9e28ed8569bfab3c8c3ac3ec07009986b261 (diff)
downloadtacticians-server-4f4987582ee41e2c68aad3b467b40eaed2ae9111.zip
tacticians-server-4f4987582ee41e2c68aad3b467b40eaed2ae9111.tar.bz2
Changes to the omnimods scale function.
-rw-r--r--src/shared/struct/shr_omnimods.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/shared/struct/shr_omnimods.erl b/src/shared/struct/shr_omnimods.erl
index c31e372..a913799 100644
--- a/src/shared/struct/shr_omnimods.erl
+++ b/src/shared/struct/shr_omnimods.erl
@@ -94,7 +94,17 @@
(float(), attribute_mods()) -> attribute_mods();
(float(), damage_type_mods()) -> damage_type_mods().
apply_coefficient_to_mods (Coef, Mods) ->
- dict:map(fun (_Name, Val) -> shr_math_util:ceil(Coef * Val) end, Mods).
+ dict:map
+ (
+ fun (_Name, S0Value) ->
+ S1Value = (Coef * S0Value),
+ case S1Value >= 0 of
+ true -> shr_math_util:ceil(S1Value);
+ false -> floor(S1Value)
+ end
+ end,
+ Mods
+ ).
-spec merge_mods
(attribute_mods(), attribute_mods()) -> attribute_mods();