aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-07-16 10:40:29 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-07-16 10:40:29 +0200
commite35aeff71429bd1d3a023195e0ad6dd77d1be5a8 (patch)
treed30f6aa3aa3dfc7d3f1189f48235cc3b9064dc49
parent376380677223c0dffe891b34498dd29a63a07bc8 (diff)
downloadtacticians-server-e35aeff71429bd1d3a023195e0ad6dd77d1be5a8.zip
tacticians-server-e35aeff71429bd1d3a023195e0ad6dd77d1be5a8.tar.bz2
Fixing equations using my phone.
-rw-r--r--src/balancer/struct/blc_armor.erl32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/balancer/struct/blc_armor.erl b/src/balancer/struct/blc_armor.erl
index 12f439e..e5664f2 100644
--- a/src/balancer/struct/blc_armor.erl
+++ b/src/balancer/struct/blc_armor.erl
@@ -148,7 +148,20 @@ apply_defense_score_modifier (AbsModifier, Mod, S0DescSortedDefense) ->
)
-> non_neg_integer().
get_maximum_movement_points_with_factors (Value, BaseValue, Factor) ->
- math:floor((Value * ?BASE_MOVEMENT_POINTS_ATTRIBUTE) / (BaseValue * Factor)).
+ case (Factor == 0) of
+ true -> (?BASE_MOVEMENT_POINTS_ATTRIBUTE * 3);
+ false ->
+ (
+ (
+ Value
+ /
+ (
+ Factor
+ * (BaseValue / ?BASE_MOVEMENT_POINTS_ATTRIBUTE)
+ )
+ )
+ )
+ end.
-spec get_maximum_factor_with_movement_points
(
@@ -158,17 +171,12 @@ get_maximum_movement_points_with_factors (Value, BaseValue, Factor) ->
)
-> float().
get_maximum_factor_with_movement_points (Value, BaseValue, MovementPoints) ->
- (
- Value
- /
- (
- (
- (MovementPoints / ?BASE_MOVEMENT_POINTS_ATTRIBUTE)
- + 1
- )
- * BaseValue
- )
- ).
+ MvtPointsBaseMod = (MovementPoints - ?BASE_MOVEMENT_POINTS_ATTRIBUTE),
+
+ case MvtPointsBaseMod of
+ false -> 1.0;
+ true -> (Value / (MvtPointsBaseMod * (BaseValue / ?BASE_MOVEMENT_POINTS_ATTRIBUTE)))
+ end.
-spec proto_armor_auto_dodge
(