summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-01-22 12:55:26 +0100 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-01-22 12:55:26 +0100 |
commit | bf751b384f9207226fc8b7ec662eac32d8bc81eb (patch) | |
tree | da1c04075029c06d0af6c5f4b8bb3402c2d060ae /src/type/statistics.erl | |
parent | b056dfc549d445b8cc6a16c8076888289a1db9e0 (diff) |
Links the fragments of new stats to the old ones.
Diffstat (limited to 'src/type/statistics.erl')
-rw-r--r-- | src/type/statistics.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/type/statistics.erl b/src/type/statistics.erl index bfdb2de..bced96f 100644 --- a/src/type/statistics.erl +++ b/src/type/statistics.erl @@ -48,7 +48,14 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -float_to_int (F) -> trunc(math:ceil(F)). +ceil (F) -> + I = trunc(F), + case (F > I) of + true -> (I + 1); + _ -> I + end. + +float_to_int (F) -> trunc(ceil(F)). min_max (Min, Max, V) -> min(Max, max(Min, V)). average ([]) -> 0; @@ -85,7 +92,7 @@ get_accuracy (Stats) -> Stats#statistics.accuracy. get_double_hits (Stats) -> Stats#statistics.double_hits. get_critical_hits (Stats) -> Stats#statistics.critical_hits. -calc_for (Att, Wp) -> +calc_for (Att, _Wp) -> #statistics { movement_points = gentle_squared_growth(attributes:get_speed(Att)), |