summaryrefslogtreecommitdiff |
diff options
author | nsensfel <SpamShield0@noot-noot.org> | 2018-06-07 16:44:26 +0200 |
---|---|---|
committer | nsensfel <SpamShield0@noot-noot.org> | 2018-06-07 16:44:26 +0200 |
commit | 2155e43a7acdbc91ef561ae1cfd06eae297020e7 (patch) | |
tree | aa404375e1c307484d2ddf709bab1597d26466f4 /src/shared/struct/sh_statistics.erl | |
parent | 54250bfbaf0eeeceaec86cde2df39797f83397fd (diff) |
add_{armor,weapon}, coefs, db stores stats.
Diffstat (limited to 'src/shared/struct/sh_statistics.erl')
-rw-r--r-- | src/shared/struct/sh_statistics.erl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/shared/struct/sh_statistics.erl b/src/shared/struct/sh_statistics.erl index 92cd8d6..e2b8543 100644 --- a/src/shared/struct/sh_statistics.erl +++ b/src/shared/struct/sh_statistics.erl @@ -47,7 +47,7 @@ -export ( [ - new/2 + new/3 ] ). @@ -144,14 +144,21 @@ get_damages (Stats) -> -spec new ( sh_attributes:type(), - {sh_weapon:id(), sh_weapon:id()} + {sh_weapon:id(), sh_weapon:id()}, + sh_armor:id() ) -> type(). -new (BaseAttributes, WeaponIDs) -> +new (BaseAttributes, WeaponIDs, ArmorID) -> {ActiveWeaponID, _} = WeaponIDs, ActiveWeapon = sh_weapon:from_id(ActiveWeaponID), {MinDamage, MaxDamage} = sh_weapon:get_damages(ActiveWeapon), - Attributes = sh_weapon:apply_to_attributes(BaseAttributes, ActiveWeapon), + Armor = sh_armor:from_id(ArmorID), + Attributes = + sh_armor:apply_to_attributes + ( + Armor, + sh_weapon:apply_to_attributes(ActiveWeapon, BaseAttributes) + ), Constitution = sh_attributes:get_constitution(Attributes), Dexterity = sh_attributes:get_dexterity(Attributes), Intelligence = sh_attributes:get_intelligence(Attributes), |