summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-06-27 12:05:37 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-06-27 12:05:37 +0200 |
commit | 825c07c6559230f930fbe38db10cfa56d3e0747c (patch) | |
tree | dcfd2f9f073a5212cd81d830abc0125d9d8dd866 /src/shared | |
parent | 161c7870644e8c45f741a8f33e149737ae7cdad2 (diff) |
Small changes in stats calculation.
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/struct/sh_armor.erl | 34 | ||||
-rw-r--r-- | src/shared/struct/sh_statistics.erl | 6 |
2 files changed, 30 insertions, 10 deletions
diff --git a/src/shared/struct/sh_armor.erl b/src/shared/struct/sh_armor.erl index dcbb379..1fda4eb 100644 --- a/src/shared/struct/sh_armor.erl +++ b/src/shared/struct/sh_armor.erl @@ -115,31 +115,47 @@ random_id () -> sh_roll:between(0, 4). ) -> sh_attributes:type(). apply_to_attributes (Ar, Att) -> + Constitution = sh_attributes:get_constitution(Att), Dexterity = sh_attributes:get_dexterity(Att), Speed = sh_attributes:get_speed(Att), Strength = sh_attributes:get_strength(Att), Mind = sh_attributes:get_mind(Att), Impact = sh_math_util:ceil(20.0 * Ar#armor.coef), + HalfImpact = sh_math_util:ceil(10.0 * Ar#armor.coef), Category = Ar#armor.category, case Category of kinetic -> sh_attributes:set_unsafe_mind((Mind - Impact), Att); - leather -> sh_attributes:set_unsafe_dexterity((Dexterity - Impact), Att); + leather -> + sh_attributes:set_unsafe_constitution + ( + (Constitution - HalfImpact), + sh_attributes:set_unsafe_dexterity((Dexterity - HalfImpact), Att) + ); + chain -> - sh_attributes:set_unsafe_dexterity + sh_attributes:set_unsafe_constitution ( - (Dexterity - Impact), - sh_attributes:set_unsafe_speed((Speed - Impact), Att) + (Constitution - HalfImpact), + sh_attributes:set_unsafe_dexterity + ( + (Dexterity - HalfImpact), + sh_attributes:set_unsafe_speed((Speed - Impact), Att) + ) ); plate -> - sh_attributes:set_unsafe_dexterity + sh_attributes:set_unsafe_constitution ( - (Dexterity - Impact), - sh_attributes:set_unsafe_speed + (Constitution - HalfImpact), + sh_attributes:set_unsafe_dexterity ( - (Speed - Impact), - sh_attributes:set_unsafe_strength((Strength - Impact), Att) + (Dexterity - HalfImpact), + sh_attributes:set_unsafe_speed + ( + (Speed - Impact), + sh_attributes:set_unsafe_strength((Strength - Impact), Att) + ) ) ) end. diff --git a/src/shared/struct/sh_statistics.erl b/src/shared/struct/sh_statistics.erl index 8f273b1..497cf41 100644 --- a/src/shared/struct/sh_statistics.erl +++ b/src/shared/struct/sh_statistics.erl @@ -174,7 +174,11 @@ new (BaseAttributes, WeaponIDs, ArmorID) -> ( average([Mind, Constitution, Constitution, Speed, Speed, Speed]) ), - health = gentle_squared_growth(Constitution), + health = + gentle_squared_growth + ( + average([Constitution, Constitution, Constitution, Mind]) + ), dodges = min_max(0, 100, sudden_exp_growth(average([Dexterity, Mind, Speed]))), parries = |