summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/struct/sh_armor.erl34
-rw-r--r--src/shared/struct/sh_statistics.erl6
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 =