aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-07-29 23:02:00 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-07-29 23:02:00 +0200
commit65c103dae552d511a0ec3bd03ef402ecc71501e3 (patch)
treed84ce3a7354470c82ba44f310a1746451a36287b
parent19b7081bee9b5c9c9a56592aa2ae4ffedfd591b5 (diff)
downloadtacticians-server-65c103dae552d511a0ec3bd03ef402ecc71501e3.zip
tacticians-server-65c103dae552d511a0ec3bd03ef402ecc71501e3.tar.bz2
Working on a different way to balance stats...
-rw-r--r--include/base_attributes.hrl105
-rw-r--r--src/balancer/struct/blc_armor.erl7
2 files changed, 103 insertions, 9 deletions
diff --git a/include/base_attributes.hrl b/include/base_attributes.hrl
index 2ceb6f7..86d123d 100644
--- a/include/base_attributes.hrl
+++ b/include/base_attributes.hrl
@@ -1,8 +1,97 @@
-%%%%
-% Base value for character attributes.
-
--define(BASE_DAMAGE_MODIFIER_ATTRIBUTE, 100).
--define(BASE_MOVEMENT_POINTS_ATTRIBUTE, 32).
--define(BASE_HEALTH_ATTRIBUTE, 100).
--define(BASE_DODGE_ATTRIBUTE, 50).
--define(BASE_DEFENSE_SCORE, 50).
+-define(ATTRIBUTE_DAMAGE_MODIFIER_MIN, 0).
+-define(ATTRIBUTE_DAMAGE_MODIFIER_MAX, 300).
+-define(ATTRIBUTE_DAMAGE_MODIFIER_DEFAULT, 100).
+-define
+(
+ ATTRIBUTE_DAMAGE_MODIFIER_SCALE_FACTOR,
+ (
+ (?ATTRIBUTE_DAMAGE_MODIFIER_DEFAULT - ?ATTRIBUTE_DAMAGE_MODIFIER_MIN)
+ / (?ATTRIBUTE_DAMAGE_MODIFIER_MAX - ?ATTRIBUTE_DAMAGE_MODIFIER_MIN)
+ )
+).
+-define
+(
+ ATTRIBUTE_DAMAGE_MODIFIER_SCALE_UNIT,
+ (?ATTRIBUTE_DAMAGE_MODIFIER_SCALE_FACTOR * ?ATTRIBUTE_DAMAGE_MODIFIER_MAX)
+)
+
+-define(ATTRIBUTE_MOVEMENT_POINTS_MIN, 8).
+-define(ATTRIBUTE_MOVEMENT_POINTS_MAX, 200).
+-define(ATTRIBUTE_MOVEMENT_POINTS_DEFAULT, 32).
+-define
+(
+ ATTRIBUTE_MOVEMENT_POINTS_SCALE_FACTOR,
+ (
+ (?ATTRIBUTE_MOVEMENT_POINTS_DEFAULT - ?ATTRIBUTE_MOVEMENT_POINTS_MIN)
+ / (?ATTRIBUTE_MOVEMENT_POINTS_MAX - ?ATTRIBUTE_MOVEMENT_POINTS_MIN)
+ )
+).
+-define
+(
+ ATTRIBUTE_MOVEMENT_POINTS_SCALE_UNIT,
+ (?ATTRIBUTE_MOVEMENT_POINTS_SCALE_FACTOR * ?ATTRIBUTE_MOVEMENT_POINTS_MAX)
+)
+
+-define(ATTRIBUTE_HEALTH_MIN, 1).
+-define(ATTRIBUTE_HEALTH_MAX, 500).
+-define(ATTRIBUTE_HEALTH_DEFAULT, 100).
+-define
+(
+ ATTRIBUTE_HEALTH_SCALE_FACTOR,
+ (
+ (?ATTRIBUTE_HEALTH_DEFAULT - ?ATTRIBUTE_HEALTH_MIN)
+ / (?ATTRIBUTE_HEALTH_MAX - ?ATTRIBUTE_HEALTH_MIN)
+ )
+).
+-define
+(
+ ATTRIBUTE_HEALTH_SCALE_UNIT,
+ (?ATTRIBUTE_HEALTH_SCALE_FACTOR * ?ATTRIBUTE_HEALTH_MAX)
+)
+
+-define(ATTRIBUTE_DODGE_MIN, 1).
+-define(ATTRIBUTE_DODGE_MAX, 175).
+-define(ATTRIBUTE_DODGE_DEFAULT, 50).
+-define
+(
+ ATTRIBUTE_DODGE_SCALE_FACTOR,
+ (
+ (?ATTRIBUTE_DODGE_DEFAULT - ?ATTRIBUTE_DODGE_MIN)
+ / (?ATTRIBUTE_DODGE_MAX - ?ATTRIBUTE_DODGE_MIN)
+ )
+).
+-define
+(
+ ATTRIBUTE_DODGE_SCALE_UNIT,
+ (?ATTRIBUTE_DODGE_SCALE_FACTOR * ?ATTRIBUTE_DODGE_MAX)
+)
+
+-define(ATTRIBUTE_DEFENSE_SCORE_MIN, 0).
+-define(ATTRIBUTE_DEFENSE_SCORE_MAX, 300).
+-define(ATTRIBUTE_DEFENSE_SCORE_BASE, 50).
+-define
+(
+ ATTRIBUTE_DEFENSE_SCORE_SCALE_FACTOR,
+ (
+ (?ATTRIBUTE_DEFENSE_SCORE_DEFAULT - ?ATTRIBUTE_DEFENSE_SCORE_MIN)
+ / (?ATTRIBUTE_DEFENSE_SCORE_MAX - ?ATTRIBUTE_DEFENSE_SCORE_MIN)
+ )
+).
+-define
+(
+ ATTRIBUTE_DEFENSE_SCORE_SCALE_UNIT,
+ (?ATTRIBUTE_DEFENSE_SCORE_SCALE_FACTOR * ?ATTRIBUTE_DEFENSE_SCORE_MAX)
+)
+
+-define
+(
+ ATTRIBUTE_POINTS,
+ trunc
+ (
+ (?ATTRIBUTE_DAMAGE_MODIFIER_SCALE_FACTOR * 100)
+ + (?ATTRIBUTE_MOVEMENT_POINTS_SCALE_FACTOR * 100)
+ + (?ATTRIBUTE_HEALTH_SCALE_FACTOR * 100)
+ + (?ATTRIBUTE_DODGE_SCALE_FACTOR * 100)
+ + (?ATTRIBUTE_DEFENSE_SCORE_FACTOR * 100)
+ )
+).
diff --git a/src/balancer/struct/blc_armor.erl b/src/balancer/struct/blc_armor.erl
index fd44abb..c465413 100644
--- a/src/balancer/struct/blc_armor.erl
+++ b/src/balancer/struct/blc_armor.erl
@@ -175,7 +175,12 @@ get_maximum_factor_with_movement_points (Value, BaseValue, MovementPoints) ->
case (MvtPointsBaseMod > 0) of
false -> 1.0;
- true -> (Value / (MvtPointsBaseMod * (BaseValue / ?BASE_MOVEMENT_POINTS_ATTRIBUTE)))
+ true ->
+ (
+ Value
+ /
+ (MvtPointsBaseMod * (BaseValue / ?BASE_MOVEMENT_POINTS_ATTRIBUTE))
+ )
end.
-spec proto_armor_auto_dodge