From ec050d9e70cca73463ac6dedbba658afa64faea7 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Wed, 21 Feb 2018 13:30:20 +0100 Subject: Fixes Accuracy & Dodge stats. --- src/type/statistics.erl | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/type/statistics.erl b/src/type/statistics.erl index bced96f..0668fea 100644 --- a/src/type/statistics.erl +++ b/src/type/statistics.erl @@ -100,8 +100,8 @@ calc_for (Att, _Wp) -> dodges = min_max ( - 5, - 75, + 0, + 100, sudden_exp_growth ( average @@ -134,7 +134,22 @@ calc_for (Att, _Wp) -> damage_min = 0, damage_max = 100, accuracy = - already_high_slow_growth(attributes:get_dexterity(Att)), + % Hitting should involve this stat (not with this formula though), but + % also the target's dodge stat, with three possible results: + % - Missed + % - Grazed (Halved damage) + % - Hit + % Stat = (target.dodge - char.accuracy) + % Roll = RAND(0, 100) + % if (Roll >= (Stat * 2)): Hit + % else if (Roll >= Stat): Grazed + % else: Missed. + min_max + ( + 0, + 100, + sudden_squared_growth(attributes:get_dexterity(Att)) + ), double_hits = min_max(0, 100, sudden_squared_growth(attributes:get_speed(Att))), critical_hits = -- cgit v1.2.3-70-g09d2