From 4f4987582ee41e2c68aad3b467b40eaed2ae9111 Mon Sep 17 00:00:00 2001 From: nsensfel Date: Mon, 16 Sep 2019 17:44:51 +0200 Subject: Changes to the omnimods scale function. --- src/shared/struct/shr_omnimods.erl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/shared') 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(); -- cgit v1.2.3-70-g09d2