| summaryrefslogtreecommitdiff | 
diff options
| author | nsensfel <SpamShield0@noot-noot.org> | 2018-01-18 16:34:36 +0100 | 
|---|---|---|
| committer | nsensfel <SpamShield0@noot-noot.org> | 2018-01-18 16:34:36 +0100 | 
| commit | e49029992c2f43c29f4d4610b54eb549e7212dab (patch) | |
| tree | dbdc093e930ebd8e2cd5c5ce4d948b02f08dc7ae /src | |
| parent | 71c2f5c128785058c4f11b7d36aeb43c85cccc5f (diff) | |
Maybe found a formula for mvt_pts = f(speed).
Diffstat (limited to 'src')
| -rw-r--r-- | src/type/statistics.erl | 73 | 
1 files changed, 73 insertions, 0 deletions
| diff --git a/src/type/statistics.erl b/src/type/statistics.erl new file mode 100644 index 0000000..ad92917 --- /dev/null +++ b/src/type/statistics.erl @@ -0,0 +1,73 @@ +-module(statistics). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +-record +( +   statistics, +   { +      movement_points, +      health, +      dodges, +      parries, +      damage_min, +      damage_max, +      accuracy, +      double_hits, +      critical_hits +   } +). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% Accessors +-export +( +   [ +      get_movement_points/1, +      get_health/1, +      get_dodges/1, +      get_parries/1, +      get_damage_min/1, +      get_damage_max/1, +      get_accuracy/1, +      get_double_hits/1, +      get_critical_hits/1 +   ] +). + +-export +( +   [ +      calc_for/2 +   ] +). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%% Accessors +get_movement_points (Stats) -> Stats#statistics.movement_points. +get_health (Stats) -> Stats#statistics.health. +get_dodges (Stats) -> Stats#statistics.dodges. +get_parries (Stats) -> Stats#statistics.parries. +get_damage_min (Stats) -> Stats#statistics.damage_min. +get_damage_max (Stats) -> Stats#statistics.damage_max. +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) -> +   #statistics +   { +      movement_points = +         trunc(math:ceil(math:pow(attributes:get_speed(Att), 1.8)/20)), +      health = +         trunc(math:ceil(math:pow(attributes:get_constitution(Att), 1.8)/20)) +   }. | 


