summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-06-08 13:12:16 +0200
committernsensfel <SpamShield0@noot-noot.org>2018-06-08 13:12:16 +0200
commit0416d506aa9d20f2b65ce0123e9c54798a00411e (patch)
tree17aef6e682148d5b3c291a519246e3259bf9d0df /src
parent05aae9baa2b61882be578d9660687fb2d0eb1f47 (diff)
Equipment penalties should not increase attributes
Diffstat (limited to 'src')
-rw-r--r--src/battlemap/query/bm_load_state.erl15
-rw-r--r--src/shared/struct/sh_armor.erl2
-rw-r--r--src/shared/struct/sh_statistics.erl6
-rw-r--r--src/shared/struct/sh_weapon.erl2
4 files changed, 14 insertions, 11 deletions
diff --git a/src/battlemap/query/bm_load_state.erl b/src/battlemap/query/bm_load_state.erl
index 9234dff..1406b4e 100644
--- a/src/battlemap/query/bm_load_state.erl
+++ b/src/battlemap/query/bm_load_state.erl
@@ -102,12 +102,15 @@ generate_reply (QueryState, Input) ->
bm_battle:get_used_armor_ids(Battle)
),
- jiffy:encode
- (
- [SetTimeline, SetMap | AddWeaponList]
- ++ AddArmorList
- ++ AddCharList
- ).
+ OutputList =
+ (
+ [SetTimeline, SetMap | AddWeaponList]
+ ++ AddArmorList
+ ++ AddCharList
+ ),
+ Output = jiffy:encode(OutputList),
+
+ Output.
-spec handle (binary()) -> binary().
handle (Req) ->
diff --git a/src/shared/struct/sh_armor.erl b/src/shared/struct/sh_armor.erl
index 3ff1a61..04b82d6 100644
--- a/src/shared/struct/sh_armor.erl
+++ b/src/shared/struct/sh_armor.erl
@@ -118,7 +118,7 @@ apply_to_attributes (Ar, Att) ->
Speed = sh_attributes:get_speed(Att),
Strength = sh_attributes:get_strength(Att),
Mind = sh_attributes:get_mind(Att),
- Impact = erlang:ceil(-20.0 * Ar#armor.coef),
+ Impact = erlang:ceil(20.0 * Ar#armor.coef),
Category = Ar#armor.category,
case Category of
diff --git a/src/shared/struct/sh_statistics.erl b/src/shared/struct/sh_statistics.erl
index e2b8543..d2dfb1c 100644
--- a/src/shared/struct/sh_statistics.erl
+++ b/src/shared/struct/sh_statistics.erl
@@ -72,17 +72,17 @@ average (L) -> lists:sum(L) / length(L).
% V | 010 | 030 | 050 | 070 | 100 |
% F | 004 | 023 | 058 | 104 | 200 |
-spec gentle_squared_growth (number()) -> non_neg_integer().
-gentle_squared_growth (V) -> float_to_int(math:pow(V, 1.8) / 20).
+gentle_squared_growth (V) -> float_to_int(math:pow(V, 1.8) / 20.0).
% V | 010 | 030 | 050 | 070 | 100 |
% F | 001 | 005 | 018 | 041 | 100 |
-spec sudden_squared_growth (number()) -> non_neg_integer().
-sudden_squared_growth (V) -> float_to_int(math:pow(V, 2.5) / 1000).
+sudden_squared_growth (V) -> float_to_int(math:pow(V, 2.5) / 1000.0).
% V | 010 | 030 | 050 | 070 | 100 |
% F | 002 | 006 | 016 | 049 | 256 |
-spec sudden_exp_growth (number()) -> non_neg_integer().
-sudden_exp_growth (V) -> float_to_int(math:pow(4, V / 25)).
+sudden_exp_growth (V) -> float_to_int(math:pow(4.0, V / 25.0)).
% V | 010 | 030 | 050 | 070 | 100 |
% F | 040 | 066 | 079 | 088 | 099 |
diff --git a/src/shared/struct/sh_weapon.erl b/src/shared/struct/sh_weapon.erl
index 6bd3425..db402af 100644
--- a/src/shared/struct/sh_weapon.erl
+++ b/src/shared/struct/sh_weapon.erl
@@ -396,7 +396,7 @@ apply_to_attributes (Weapon, Attributes) ->
RangeModifier = Weapon#weapon.range_mod,
DamageModifier = Weapon#weapon.damage_mod,
- Impact = (-20.0 * Weapon#weapon.coef),
+ Impact = (20.0 * Weapon#weapon.coef),
FullImpact = erlang:ceil(Impact),
QuarterImpact = erlang:ceil(Impact / 4.0),