diff --git a/CHANGELOG.md b/CHANGELOG.md index d3b43b63d9..c3495c3ed1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added a filter search function for crafting menu, use "input:_____" to search for recipe inputs - Added catalan (Catalonia) language translation - Sneaking with weapons drawn +- Stealth stat values on (some) armors ### Changed diff --git a/assets/common/items/armor/cloth/druid/back.ron b/assets/common/items/armor/cloth/druid/back.ron index 6cea0b35be..73e523287e 100644 --- a/assets/common/items/armor/cloth/druid/back.ron +++ b/assets/common/items/armor/cloth/druid/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 3.3, energy_reward: 0.034, crit_power: 0.0, - stealth: 0.0, + stealth: 0.034, ), )), quality: High, diff --git a/assets/common/items/armor/cloth/druid/belt.ron b/assets/common/items/armor/cloth/druid/belt.ron index 7bfc4c0825..7f9cfcf15d 100644 --- a/assets/common/items/armor/cloth/druid/belt.ron +++ b/assets/common/items/armor/cloth/druid/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 3.3, energy_reward: 0.034, crit_power: 0.0, - stealth: 0.0, + stealth: 0.034, ), )), quality: High, diff --git a/assets/common/items/armor/cloth/druid/chest.ron b/assets/common/items/armor/cloth/druid/chest.ron index dff8c9f0f3..945f44b57d 100644 --- a/assets/common/items/armor/cloth/druid/chest.ron +++ b/assets/common/items/armor/cloth/druid/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 19.8, energy_reward: 0.2, crit_power: 0.0, - stealth: 0.0, + stealth: 0.2, ), )), quality: High, diff --git a/assets/common/items/armor/cloth/druid/foot.ron b/assets/common/items/armor/cloth/druid/foot.ron index 4dd639a99c..38e8fd04bf 100644 --- a/assets/common/items/armor/cloth/druid/foot.ron +++ b/assets/common/items/armor/cloth/druid/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 6.6, energy_reward: 0.067, crit_power: 0.0, - stealth: 0.0, + stealth: 0.067, ), )), quality: High, diff --git a/assets/common/items/armor/cloth/druid/hand.ron b/assets/common/items/armor/cloth/druid/hand.ron index 3aabca3954..bfc156b2d5 100644 --- a/assets/common/items/armor/cloth/druid/hand.ron +++ b/assets/common/items/armor/cloth/druid/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 6.6, energy_reward: 0.067, crit_power: 0.0, - stealth: 0.0, + stealth: 0.067, ), )), quality: High, diff --git a/assets/common/items/armor/cloth/druid/pants.ron b/assets/common/items/armor/cloth/druid/pants.ron index 70debc99dd..ee13b630cc 100644 --- a/assets/common/items/armor/cloth/druid/pants.ron +++ b/assets/common/items/armor/cloth/druid/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 13.2, energy_reward: 0.134, crit_power: 0.0, - stealth: 0.0, + stealth: 0.134, ), )), quality: High, diff --git a/assets/common/items/armor/cloth/druid/shoulder.ron b/assets/common/items/armor/cloth/druid/shoulder.ron index d4b442f4d7..605b11214f 100644 --- a/assets/common/items/armor/cloth/druid/shoulder.ron +++ b/assets/common/items/armor/cloth/druid/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 13.2, energy_reward: 0.134, crit_power: 0.0, - stealth: 0.0, + stealth: 0.134, ), )), quality: High, diff --git a/assets/common/items/armor/cloth/linen/back.ron b/assets/common/items/armor/cloth/linen/back.ron index 1caf486e23..95b5f35d70 100644 --- a/assets/common/items/armor/cloth/linen/back.ron +++ b/assets/common/items/armor/cloth/linen/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0.8, energy_reward: 0.009, crit_power: 0.0, - stealth: 0.0, + stealth: 0.009, ), )), quality: Low, diff --git a/assets/common/items/armor/cloth/linen/belt.ron b/assets/common/items/armor/cloth/linen/belt.ron index 3c3a9cfb09..1ca81837c3 100644 --- a/assets/common/items/armor/cloth/linen/belt.ron +++ b/assets/common/items/armor/cloth/linen/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0.8, energy_reward: 0.009, crit_power: 0.0, - stealth: 0.0, + stealth: 0.009, ), )), quality: Low, diff --git a/assets/common/items/armor/cloth/linen/chest.ron b/assets/common/items/armor/cloth/linen/chest.ron index 34980bf48e..dfc9b267bd 100644 --- a/assets/common/items/armor/cloth/linen/chest.ron +++ b/assets/common/items/armor/cloth/linen/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 5.0, energy_reward: 0.051, crit_power: 0.0, - stealth: 0.0, + stealth: 0.051, ), )), quality: Low, diff --git a/assets/common/items/armor/cloth/linen/foot.ron b/assets/common/items/armor/cloth/linen/foot.ron index 6d666db6cb..53ea34addf 100644 --- a/assets/common/items/armor/cloth/linen/foot.ron +++ b/assets/common/items/armor/cloth/linen/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 1.7, energy_reward: 0.017, crit_power: 0.0, - stealth: 0.0, + stealth: 0.017, ), )), quality: Low, diff --git a/assets/common/items/armor/cloth/linen/hand.ron b/assets/common/items/armor/cloth/linen/hand.ron index 77c8cc5091..60b6a8e25d 100644 --- a/assets/common/items/armor/cloth/linen/hand.ron +++ b/assets/common/items/armor/cloth/linen/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 1.7, energy_reward: 0.017, crit_power: 0.0, - stealth: 0.0, + stealth: 0.017, ), )), quality: Low, diff --git a/assets/common/items/armor/cloth/linen/pants.ron b/assets/common/items/armor/cloth/linen/pants.ron index 7261b8ad73..eb7dfd8947 100644 --- a/assets/common/items/armor/cloth/linen/pants.ron +++ b/assets/common/items/armor/cloth/linen/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 3.3, energy_reward: 0.034, crit_power: 0.0, - stealth: 0.0, + stealth: 0.034, ), )), quality: Low, diff --git a/assets/common/items/armor/cloth/linen/shoulder.ron b/assets/common/items/armor/cloth/linen/shoulder.ron index 922b7846b5..819ab2c70e 100644 --- a/assets/common/items/armor/cloth/linen/shoulder.ron +++ b/assets/common/items/armor/cloth/linen/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 3.3, energy_reward: 0.034, crit_power: 0.0, - stealth: 0.0, + stealth: 0.034, ), )), quality: Low, diff --git a/assets/common/items/armor/cloth/moonweave/back.ron b/assets/common/items/armor/cloth/moonweave/back.ron index dc2e77895b..72aa5a3749 100644 --- a/assets/common/items/armor/cloth/moonweave/back.ron +++ b/assets/common/items/armor/cloth/moonweave/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 4.1, energy_reward: 0.042, crit_power: 0.0, - stealth: 0.0, + stealth: 0.042, ), )), quality: Epic, diff --git a/assets/common/items/armor/cloth/moonweave/belt.ron b/assets/common/items/armor/cloth/moonweave/belt.ron index 2f0c172f4e..cdc7ab5af5 100644 --- a/assets/common/items/armor/cloth/moonweave/belt.ron +++ b/assets/common/items/armor/cloth/moonweave/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 4.1, energy_reward: 0.042, crit_power: 0.0, - stealth: 0.0, + stealth: 0.042, ), )), quality: Epic, diff --git a/assets/common/items/armor/cloth/moonweave/chest.ron b/assets/common/items/armor/cloth/moonweave/chest.ron index 287d9f916c..e4a53d91b8 100644 --- a/assets/common/items/armor/cloth/moonweave/chest.ron +++ b/assets/common/items/armor/cloth/moonweave/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 24.8, energy_reward: 0.252, crit_power: 0.0, - stealth: 0.0, + stealth: 0.252, ), )), quality: Epic, diff --git a/assets/common/items/armor/cloth/moonweave/foot.ron b/assets/common/items/armor/cloth/moonweave/foot.ron index acae2ffb95..ab946c5578 100644 --- a/assets/common/items/armor/cloth/moonweave/foot.ron +++ b/assets/common/items/armor/cloth/moonweave/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 8.3, energy_reward: 0.084, crit_power: 0.0, - stealth: 0.0, + stealth: 0.084, ), )), quality: Epic, diff --git a/assets/common/items/armor/cloth/moonweave/hand.ron b/assets/common/items/armor/cloth/moonweave/hand.ron index 40b47155f8..785499ed9b 100644 --- a/assets/common/items/armor/cloth/moonweave/hand.ron +++ b/assets/common/items/armor/cloth/moonweave/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 8.3, energy_reward: 0.084, crit_power: 0.0, - stealth: 0.0, + stealth: 0.084, ), )), quality: Epic, diff --git a/assets/common/items/armor/cloth/moonweave/pants.ron b/assets/common/items/armor/cloth/moonweave/pants.ron index b87fdc4f18..544777e50a 100644 --- a/assets/common/items/armor/cloth/moonweave/pants.ron +++ b/assets/common/items/armor/cloth/moonweave/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 16.5, energy_reward: 0.168, crit_power: 0.0, - stealth: 0.0, + stealth: 0.168, ), )), quality: Epic, diff --git a/assets/common/items/armor/cloth/moonweave/shoulder.ron b/assets/common/items/armor/cloth/moonweave/shoulder.ron index 310719adec..c03c783cb6 100644 --- a/assets/common/items/armor/cloth/moonweave/shoulder.ron +++ b/assets/common/items/armor/cloth/moonweave/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 16.5, energy_reward: 0.168, crit_power: 0.0, - stealth: 0.0, + stealth: 0.168, ), )), quality: Epic, diff --git a/assets/common/items/armor/cloth/silken/back.ron b/assets/common/items/armor/cloth/silken/back.ron index 816626787e..65040dca56 100644 --- a/assets/common/items/armor/cloth/silken/back.ron +++ b/assets/common/items/armor/cloth/silken/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 2.5, energy_reward: 0.025, crit_power: 0.0, - stealth: 0.0, + stealth: 0.025, ), )), quality: Moderate, diff --git a/assets/common/items/armor/cloth/silken/belt.ron b/assets/common/items/armor/cloth/silken/belt.ron index 425f4d89cd..644cbcbbce 100644 --- a/assets/common/items/armor/cloth/silken/belt.ron +++ b/assets/common/items/armor/cloth/silken/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 2.5, energy_reward: 0.025, crit_power: 0.0, - stealth: 0.0, + stealth: 0.025, ), )), quality: Moderate, diff --git a/assets/common/items/armor/cloth/silken/chest.ron b/assets/common/items/armor/cloth/silken/chest.ron index bdcecee312..3400cfabb7 100644 --- a/assets/common/items/armor/cloth/silken/chest.ron +++ b/assets/common/items/armor/cloth/silken/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 14.9, energy_reward: 0.15, crit_power: 0.0, - stealth: 0.0, + stealth: 0.15, ), )), quality: Moderate, diff --git a/assets/common/items/armor/cloth/silken/foot.ron b/assets/common/items/armor/cloth/silken/foot.ron index 1f8ae1599c..a0f1354c00 100644 --- a/assets/common/items/armor/cloth/silken/foot.ron +++ b/assets/common/items/armor/cloth/silken/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 5.0, energy_reward: 0.05, crit_power: 0.0, - stealth: 0.0, + stealth: 0.05, ), )), quality: Moderate, diff --git a/assets/common/items/armor/cloth/silken/hand.ron b/assets/common/items/armor/cloth/silken/hand.ron index 8222c32389..8c446b1e06 100644 --- a/assets/common/items/armor/cloth/silken/hand.ron +++ b/assets/common/items/armor/cloth/silken/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 5.0, energy_reward: 0.05, crit_power: 0.0, - stealth: 0.0, + stealth: 0.05, ), )), quality: Moderate, diff --git a/assets/common/items/armor/cloth/silken/pants.ron b/assets/common/items/armor/cloth/silken/pants.ron index 01dcd6ac0a..87ff1cd4e7 100644 --- a/assets/common/items/armor/cloth/silken/pants.ron +++ b/assets/common/items/armor/cloth/silken/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 9.9, energy_reward: 0.1, crit_power: 0.0, - stealth: 0.0, + stealth: 0.1, ), )), quality: Moderate, diff --git a/assets/common/items/armor/cloth/silken/shoulder.ron b/assets/common/items/armor/cloth/silken/shoulder.ron index 35d25dbc56..6d7914bed1 100644 --- a/assets/common/items/armor/cloth/silken/shoulder.ron +++ b/assets/common/items/armor/cloth/silken/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 9.9, energy_reward: 0.1, crit_power: 0.0, - stealth: 0.0, + stealth: 0.1, ), )), quality: Moderate, diff --git a/assets/common/items/armor/cloth/sunsilk/back.ron b/assets/common/items/armor/cloth/sunsilk/back.ron index 499dde0ca7..d4536e1522 100644 --- a/assets/common/items/armor/cloth/sunsilk/back.ron +++ b/assets/common/items/armor/cloth/sunsilk/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 5.0, energy_reward: 0.05, crit_power: 0.0, - stealth: 0.0, + stealth: 0.05, ), )), quality: Legendary, diff --git a/assets/common/items/armor/cloth/sunsilk/belt.ron b/assets/common/items/armor/cloth/sunsilk/belt.ron index c871e73458..27047fe94d 100644 --- a/assets/common/items/armor/cloth/sunsilk/belt.ron +++ b/assets/common/items/armor/cloth/sunsilk/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 5.0, energy_reward: 0.05, crit_power: 0.0, - stealth: 0.0, + stealth: 0.05, ), )), quality: Legendary, diff --git a/assets/common/items/armor/cloth/sunsilk/chest.ron b/assets/common/items/armor/cloth/sunsilk/chest.ron index e5c2dacc50..0b0e8acefa 100644 --- a/assets/common/items/armor/cloth/sunsilk/chest.ron +++ b/assets/common/items/armor/cloth/sunsilk/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 30.0, energy_reward: 0.3, crit_power: 0.0, - stealth: 0.0, + stealth: 0.3, ), )), quality: Legendary, diff --git a/assets/common/items/armor/cloth/sunsilk/foot.ron b/assets/common/items/armor/cloth/sunsilk/foot.ron index d72f1f5885..384a570b86 100644 --- a/assets/common/items/armor/cloth/sunsilk/foot.ron +++ b/assets/common/items/armor/cloth/sunsilk/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 10.0, energy_reward: 0.1, crit_power: 0.0, - stealth: 0.0, + stealth: 0.1, ), )), quality: Legendary, diff --git a/assets/common/items/armor/cloth/sunsilk/hand.ron b/assets/common/items/armor/cloth/sunsilk/hand.ron index 659b31a805..c2667fec96 100644 --- a/assets/common/items/armor/cloth/sunsilk/hand.ron +++ b/assets/common/items/armor/cloth/sunsilk/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 10.0, energy_reward: 0.1, crit_power: 0.0, - stealth: 0.0, + stealth: 0.1, ), )), quality: Legendary, diff --git a/assets/common/items/armor/cloth/sunsilk/pants.ron b/assets/common/items/armor/cloth/sunsilk/pants.ron index 6970a77e8c..4ae3194ead 100644 --- a/assets/common/items/armor/cloth/sunsilk/pants.ron +++ b/assets/common/items/armor/cloth/sunsilk/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 20.0, energy_reward: 0.2, crit_power: 0.0, - stealth: 0.0, + stealth: 0.2, ), )), quality: Legendary, diff --git a/assets/common/items/armor/cloth/sunsilk/shoulder.ron b/assets/common/items/armor/cloth/sunsilk/shoulder.ron index 0b77df7347..58f9119d43 100644 --- a/assets/common/items/armor/cloth/sunsilk/shoulder.ron +++ b/assets/common/items/armor/cloth/sunsilk/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 20.0, energy_reward: 0.2, crit_power: 0.0, - stealth: 0.0, + stealth: 0.2, ), )), quality: Legendary, diff --git a/assets/common/items/armor/cloth/woolen/back.ron b/assets/common/items/armor/cloth/woolen/back.ron index 1a72134758..dd2afbbe85 100644 --- a/assets/common/items/armor/cloth/woolen/back.ron +++ b/assets/common/items/armor/cloth/woolen/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 1.7, energy_reward: 0.017, crit_power: 0.0, - stealth: 0.0, + stealth: 0.017, ), )), quality: Common, diff --git a/assets/common/items/armor/cloth/woolen/belt.ron b/assets/common/items/armor/cloth/woolen/belt.ron index c9986bafdb..547129cbdd 100644 --- a/assets/common/items/armor/cloth/woolen/belt.ron +++ b/assets/common/items/armor/cloth/woolen/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 1.7, energy_reward: 0.017, crit_power: 0.0, - stealth: 0.0, + stealth: 0.017, ), )), quality: Common, diff --git a/assets/common/items/armor/cloth/woolen/chest.ron b/assets/common/items/armor/cloth/woolen/chest.ron index 6849484a13..ab4d0b295d 100644 --- a/assets/common/items/armor/cloth/woolen/chest.ron +++ b/assets/common/items/armor/cloth/woolen/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 9.9, energy_reward: 0.099, crit_power: 0.0, - stealth: 0.0, + stealth: 0.099, ), )), quality: Common, diff --git a/assets/common/items/armor/cloth/woolen/foot.ron b/assets/common/items/armor/cloth/woolen/foot.ron index 10ddd95ed2..fa17a3f483 100644 --- a/assets/common/items/armor/cloth/woolen/foot.ron +++ b/assets/common/items/armor/cloth/woolen/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 3.3, energy_reward: 0.033, crit_power: 0.0, - stealth: 0.0, + stealth: 0.033, ), )), quality: Common, diff --git a/assets/common/items/armor/cloth/woolen/hand.ron b/assets/common/items/armor/cloth/woolen/hand.ron index 9d7e0c2319..0ce7b74d93 100644 --- a/assets/common/items/armor/cloth/woolen/hand.ron +++ b/assets/common/items/armor/cloth/woolen/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 3.3, energy_reward: 0.033, crit_power: 0.0, - stealth: 0.0, + stealth: 0.033, ), )), quality: Common, diff --git a/assets/common/items/armor/cloth/woolen/pants.ron b/assets/common/items/armor/cloth/woolen/pants.ron index 8f9f6bd5cd..dcb11ba481 100644 --- a/assets/common/items/armor/cloth/woolen/pants.ron +++ b/assets/common/items/armor/cloth/woolen/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 6.6, energy_reward: 0.066, crit_power: 0.0, - stealth: 0.0, + stealth: 0.066, ), )), quality: Common, diff --git a/assets/common/items/armor/cloth/woolen/shoulder.ron b/assets/common/items/armor/cloth/woolen/shoulder.ron index 4ec9b3f912..8d41605ee8 100644 --- a/assets/common/items/armor/cloth/woolen/shoulder.ron +++ b/assets/common/items/armor/cloth/woolen/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 6.6, energy_reward: 0.066, crit_power: 0.0, - stealth: 0.0, + stealth: 0.066, ), )), quality: Common, diff --git a/assets/common/items/armor/cultist/belt.ron b/assets/common/items/armor/cultist/belt.ron index 39662f95b5..595489f5c3 100644 --- a/assets/common/items/armor/cultist/belt.ron +++ b/assets/common/items/armor/cultist/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 2.0, energy_reward: 0.025, crit_power: 0.02, - stealth: 0.0, + stealth: 0.02, ), )), quality: Epic, diff --git a/assets/common/items/armor/cultist/chest.ron b/assets/common/items/armor/cultist/chest.ron index 218ae54668..dfbc93f4e6 100644 --- a/assets/common/items/armor/cultist/chest.ron +++ b/assets/common/items/armor/cultist/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 13.5, energy_reward: 0.135, crit_power: 0.125, - stealth: 0.0, + stealth: 0.125, ), )), quality: Epic, diff --git a/assets/common/items/armor/cultist/foot.ron b/assets/common/items/armor/cultist/foot.ron index 2d93397bf6..ac0af7c50f 100644 --- a/assets/common/items/armor/cultist/foot.ron +++ b/assets/common/items/armor/cultist/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 4.5, energy_reward: 0.045, crit_power: 0.04, - stealth: 0.0, + stealth: 0.04, ), )), quality: Epic, diff --git a/assets/common/items/armor/cultist/hand.ron b/assets/common/items/armor/cultist/hand.ron index 63148ed4b1..371ce19cb1 100644 --- a/assets/common/items/armor/cultist/hand.ron +++ b/assets/common/items/armor/cultist/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 4.5, energy_reward: 0.045, crit_power: 0.04, - stealth: 0.0, + stealth: 0.04, ), )), quality: Epic, diff --git a/assets/common/items/armor/cultist/pants.ron b/assets/common/items/armor/cultist/pants.ron index 2b0e9536c4..540855b886 100644 --- a/assets/common/items/armor/cultist/pants.ron +++ b/assets/common/items/armor/cultist/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 9.0, energy_reward: 0.1, crit_power: 0.08, - stealth: 0.0, + stealth: 0.08, ), )), quality: Epic, diff --git a/assets/common/items/armor/cultist/shoulder.ron b/assets/common/items/armor/cultist/shoulder.ron index 67e2509f5f..d9334b5866 100644 --- a/assets/common/items/armor/cultist/shoulder.ron +++ b/assets/common/items/armor/cultist/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 9.0, energy_reward: 0.1, crit_power: 0.08, - stealth: 0.0, + stealth: 0.08, ), )), quality: Epic, diff --git a/assets/common/items/armor/hide/carapace/back.ron b/assets/common/items/armor/hide/carapace/back.ron index 005a81d486..8b242c7647 100644 --- a/assets/common/items/armor/hide/carapace/back.ron +++ b/assets/common/items/armor/hide/carapace/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.067, - stealth: 0.0, + stealth: 0.067, ), )), quality: High, diff --git a/assets/common/items/armor/hide/carapace/belt.ron b/assets/common/items/armor/hide/carapace/belt.ron index f5e6b19499..0ce1c25a62 100644 --- a/assets/common/items/armor/hide/carapace/belt.ron +++ b/assets/common/items/armor/hide/carapace/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.067, - stealth: 0.0, + stealth: 0.067, ), )), quality: High, diff --git a/assets/common/items/armor/hide/carapace/chest.ron b/assets/common/items/armor/hide/carapace/chest.ron index a2adc469c5..f4fd77cfd3 100644 --- a/assets/common/items/armor/hide/carapace/chest.ron +++ b/assets/common/items/armor/hide/carapace/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.399, - stealth: 0.0, + stealth: 0.399, ), )), quality: High, diff --git a/assets/common/items/armor/hide/carapace/foot.ron b/assets/common/items/armor/hide/carapace/foot.ron index 32433005d4..9d6907abd2 100644 --- a/assets/common/items/armor/hide/carapace/foot.ron +++ b/assets/common/items/armor/hide/carapace/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.133, - stealth: 0.0, + stealth: 0.133, ), )), quality: High, diff --git a/assets/common/items/armor/hide/carapace/hand.ron b/assets/common/items/armor/hide/carapace/hand.ron index b22f659b34..f701512391 100644 --- a/assets/common/items/armor/hide/carapace/hand.ron +++ b/assets/common/items/armor/hide/carapace/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.133, - stealth: 0.0, + stealth: 0.133, ), )), quality: High, diff --git a/assets/common/items/armor/hide/carapace/pants.ron b/assets/common/items/armor/hide/carapace/pants.ron index e4c7c672b8..afd8e7b4bc 100644 --- a/assets/common/items/armor/hide/carapace/pants.ron +++ b/assets/common/items/armor/hide/carapace/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.266, - stealth: 0.0, + stealth: 0.266, ), )), quality: High, diff --git a/assets/common/items/armor/hide/carapace/shoulder.ron b/assets/common/items/armor/hide/carapace/shoulder.ron index 815471f5b7..efe922a93c 100644 --- a/assets/common/items/armor/hide/carapace/shoulder.ron +++ b/assets/common/items/armor/hide/carapace/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.266, - stealth: 0.0, + stealth: 0.266, ), )), quality: High, diff --git a/assets/common/items/armor/hide/dragonscale/back.ron b/assets/common/items/armor/hide/dragonscale/back.ron index 033b23e776..6455d9ec4b 100644 --- a/assets/common/items/armor/hide/dragonscale/back.ron +++ b/assets/common/items/armor/hide/dragonscale/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.1, - stealth: 0.0, + stealth: 0.1, ), )), quality: Legendary, diff --git a/assets/common/items/armor/hide/dragonscale/belt.ron b/assets/common/items/armor/hide/dragonscale/belt.ron index 71d0da7170..1f2e46a9b7 100644 --- a/assets/common/items/armor/hide/dragonscale/belt.ron +++ b/assets/common/items/armor/hide/dragonscale/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.1, - stealth: 0.0, + stealth: 0.1, ), )), quality: Legendary, diff --git a/assets/common/items/armor/hide/dragonscale/chest.ron b/assets/common/items/armor/hide/dragonscale/chest.ron index 17644ee241..4b247c71d6 100644 --- a/assets/common/items/armor/hide/dragonscale/chest.ron +++ b/assets/common/items/armor/hide/dragonscale/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.6, - stealth: 0.0, + stealth: 0.6, ), )), quality: Legendary, diff --git a/assets/common/items/armor/hide/dragonscale/foot.ron b/assets/common/items/armor/hide/dragonscale/foot.ron index fc047d7a0b..31dc68c61d 100644 --- a/assets/common/items/armor/hide/dragonscale/foot.ron +++ b/assets/common/items/armor/hide/dragonscale/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.2, - stealth: 0.0, + stealth: 0.2, ), )), quality: Legendary, diff --git a/assets/common/items/armor/hide/dragonscale/hand.ron b/assets/common/items/armor/hide/dragonscale/hand.ron index 86e690e2b4..d695225c13 100644 --- a/assets/common/items/armor/hide/dragonscale/hand.ron +++ b/assets/common/items/armor/hide/dragonscale/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.2, - stealth: 0.0, + stealth: 0.2, ), )), quality: Legendary, diff --git a/assets/common/items/armor/hide/dragonscale/pants.ron b/assets/common/items/armor/hide/dragonscale/pants.ron index 977a9b5674..7b6d5b1fe2 100644 --- a/assets/common/items/armor/hide/dragonscale/pants.ron +++ b/assets/common/items/armor/hide/dragonscale/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.4, - stealth: 0.0, + stealth: 0.4, ), )), quality: Legendary, diff --git a/assets/common/items/armor/hide/dragonscale/shoulder.ron b/assets/common/items/armor/hide/dragonscale/shoulder.ron index 62147fb3b1..f91e15073c 100644 --- a/assets/common/items/armor/hide/dragonscale/shoulder.ron +++ b/assets/common/items/armor/hide/dragonscale/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.4, - stealth: 0.0, + stealth: 0.4, ), )), quality: Legendary, diff --git a/assets/common/items/armor/hide/leather/back.ron b/assets/common/items/armor/hide/leather/back.ron index 4de72c0d67..c36a93202c 100644 --- a/assets/common/items/armor/hide/leather/back.ron +++ b/assets/common/items/armor/hide/leather/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.034, - stealth: 0.0, + stealth: 0.034, ), )), quality: Common, diff --git a/assets/common/items/armor/hide/leather/belt.ron b/assets/common/items/armor/hide/leather/belt.ron index 14f81b8e65..d32d140ab5 100644 --- a/assets/common/items/armor/hide/leather/belt.ron +++ b/assets/common/items/armor/hide/leather/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.034, - stealth: 0.0, + stealth: 0.034, ), )), quality: Common, diff --git a/assets/common/items/armor/hide/leather/chest.ron b/assets/common/items/armor/hide/leather/chest.ron index 811fdd7c86..f1c4aaa6a2 100644 --- a/assets/common/items/armor/hide/leather/chest.ron +++ b/assets/common/items/armor/hide/leather/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.201, - stealth: 0.0, + stealth: 0.034, ), )), quality: Common, diff --git a/assets/common/items/armor/hide/leather/foot.ron b/assets/common/items/armor/hide/leather/foot.ron index a6ac8a88c7..63195d60da 100644 --- a/assets/common/items/armor/hide/leather/foot.ron +++ b/assets/common/items/armor/hide/leather/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.067, - stealth: 0.0, + stealth: 0.067, ), )), quality: Common, diff --git a/assets/common/items/armor/hide/leather/hand.ron b/assets/common/items/armor/hide/leather/hand.ron index 79c12d1c10..2b96f7b96c 100644 --- a/assets/common/items/armor/hide/leather/hand.ron +++ b/assets/common/items/armor/hide/leather/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.067, - stealth: 0.0, + stealth: 0.067, ), )), quality: Common, diff --git a/assets/common/items/armor/hide/leather/pants.ron b/assets/common/items/armor/hide/leather/pants.ron index 6ff2ac8a48..5148803d70 100644 --- a/assets/common/items/armor/hide/leather/pants.ron +++ b/assets/common/items/armor/hide/leather/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.134, - stealth: 0.0, + stealth: 0.134, ), )), quality: Common, diff --git a/assets/common/items/armor/hide/leather/shoulder.ron b/assets/common/items/armor/hide/leather/shoulder.ron index bf6cc6565e..3f51e5dbba 100644 --- a/assets/common/items/armor/hide/leather/shoulder.ron +++ b/assets/common/items/armor/hide/leather/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.134, - stealth: 0.0, + stealth: 0.134, ), )), quality: Common, diff --git a/assets/common/items/armor/hide/primal/back.ron b/assets/common/items/armor/hide/primal/back.ron index 16d24fdce7..6b8e31aca0 100644 --- a/assets/common/items/armor/hide/primal/back.ron +++ b/assets/common/items/armor/hide/primal/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.084, - stealth: 0.0, + stealth: 0.084, ), )), quality: Epic, diff --git a/assets/common/items/armor/hide/primal/belt.ron b/assets/common/items/armor/hide/primal/belt.ron index cdc557df3d..b9c848fb2a 100644 --- a/assets/common/items/armor/hide/primal/belt.ron +++ b/assets/common/items/armor/hide/primal/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.084, - stealth: 0.0, + stealth: 0.084, ), )), quality: Epic, diff --git a/assets/common/items/armor/hide/primal/chest.ron b/assets/common/items/armor/hide/primal/chest.ron index 45bbd7edd0..ae8cf8434a 100644 --- a/assets/common/items/armor/hide/primal/chest.ron +++ b/assets/common/items/armor/hide/primal/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.501, - stealth: 0.0, + stealth: 0.501, ), )), quality: Epic, diff --git a/assets/common/items/armor/hide/primal/foot.ron b/assets/common/items/armor/hide/primal/foot.ron index cd1ed43bf6..e4e4d48e51 100644 --- a/assets/common/items/armor/hide/primal/foot.ron +++ b/assets/common/items/armor/hide/primal/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.167, - stealth: 0.0, + stealth: 0.167, ), )), quality: Epic, diff --git a/assets/common/items/armor/hide/primal/hand.ron b/assets/common/items/armor/hide/primal/hand.ron index 4391547500..aff402165c 100644 --- a/assets/common/items/armor/hide/primal/hand.ron +++ b/assets/common/items/armor/hide/primal/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.167, - stealth: 0.0, + stealth: 0.167, ), )), quality: Epic, diff --git a/assets/common/items/armor/hide/primal/pants.ron b/assets/common/items/armor/hide/primal/pants.ron index 0ae4458161..bec3af846b 100644 --- a/assets/common/items/armor/hide/primal/pants.ron +++ b/assets/common/items/armor/hide/primal/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.334, - stealth: 0.0, + stealth: 0.334, ), )), quality: Epic, diff --git a/assets/common/items/armor/hide/primal/shoulder.ron b/assets/common/items/armor/hide/primal/shoulder.ron index e82391403a..e05513d52e 100644 --- a/assets/common/items/armor/hide/primal/shoulder.ron +++ b/assets/common/items/armor/hide/primal/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.334, - stealth: 0.0, + stealth: 0.334, ), )), quality: Epic, diff --git a/assets/common/items/armor/hide/rawhide/back.ron b/assets/common/items/armor/hide/rawhide/back.ron index e814adacf5..7f2f8889c8 100644 --- a/assets/common/items/armor/hide/rawhide/back.ron +++ b/assets/common/items/armor/hide/rawhide/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.017, - stealth: 0.0, + stealth: 0.017, ), )), quality: Low, diff --git a/assets/common/items/armor/hide/rawhide/belt.ron b/assets/common/items/armor/hide/rawhide/belt.ron index 330e09ac4d..0b2b582eb2 100644 --- a/assets/common/items/armor/hide/rawhide/belt.ron +++ b/assets/common/items/armor/hide/rawhide/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.017, - stealth: 0.0, + stealth: 0.017, ), )), quality: Low, diff --git a/assets/common/items/armor/hide/rawhide/chest.ron b/assets/common/items/armor/hide/rawhide/chest.ron index 5b9e5f8c8e..9535cf38c8 100644 --- a/assets/common/items/armor/hide/rawhide/chest.ron +++ b/assets/common/items/armor/hide/rawhide/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.099, - stealth: 0.0, + stealth: 0.099, ), )), quality: Low, diff --git a/assets/common/items/armor/hide/rawhide/foot.ron b/assets/common/items/armor/hide/rawhide/foot.ron index d732487a38..c8b00d14b3 100644 --- a/assets/common/items/armor/hide/rawhide/foot.ron +++ b/assets/common/items/armor/hide/rawhide/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.033, - stealth: 0.0, + stealth: 0.033, ), )), quality: Low, diff --git a/assets/common/items/armor/hide/rawhide/hand.ron b/assets/common/items/armor/hide/rawhide/hand.ron index 204d7e3729..66f615ce60 100644 --- a/assets/common/items/armor/hide/rawhide/hand.ron +++ b/assets/common/items/armor/hide/rawhide/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.033, - stealth: 0.0, + stealth: 0.033, ), )), quality: Low, diff --git a/assets/common/items/armor/hide/rawhide/pants.ron b/assets/common/items/armor/hide/rawhide/pants.ron index 29ae6f3b80..1a2996d589 100644 --- a/assets/common/items/armor/hide/rawhide/pants.ron +++ b/assets/common/items/armor/hide/rawhide/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.066, - stealth: 0.0, + stealth: 0.066, ), )), quality: Low, diff --git a/assets/common/items/armor/hide/rawhide/shoulder.ron b/assets/common/items/armor/hide/rawhide/shoulder.ron index b4a20b9fd1..adc173c0ae 100644 --- a/assets/common/items/armor/hide/rawhide/shoulder.ron +++ b/assets/common/items/armor/hide/rawhide/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.066, - stealth: 0.0, + stealth: 0.066, ), )), quality: Low, diff --git a/assets/common/items/armor/hide/scale/back.ron b/assets/common/items/armor/hide/scale/back.ron index e473d11f5b..8ef6c62d53 100644 --- a/assets/common/items/armor/hide/scale/back.ron +++ b/assets/common/items/armor/hide/scale/back.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.05, - stealth: 0.0, + stealth: 0.05, ), )), quality: Moderate, diff --git a/assets/common/items/armor/hide/scale/belt.ron b/assets/common/items/armor/hide/scale/belt.ron index ebae5e1cfe..d8629fc490 100644 --- a/assets/common/items/armor/hide/scale/belt.ron +++ b/assets/common/items/armor/hide/scale/belt.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.05, - stealth: 0.0, + stealth: 0.05, ), )), quality: Moderate, diff --git a/assets/common/items/armor/hide/scale/chest.ron b/assets/common/items/armor/hide/scale/chest.ron index 4949f6b267..ae93fe0be5 100644 --- a/assets/common/items/armor/hide/scale/chest.ron +++ b/assets/common/items/armor/hide/scale/chest.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.3, - stealth: 0.0, + stealth: 0.3, ), )), quality: Moderate, diff --git a/assets/common/items/armor/hide/scale/foot.ron b/assets/common/items/armor/hide/scale/foot.ron index f4f5e85bc2..1b99ba609d 100644 --- a/assets/common/items/armor/hide/scale/foot.ron +++ b/assets/common/items/armor/hide/scale/foot.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.1, - stealth: 0.0, + stealth: 0.1, ), )), quality: Moderate, diff --git a/assets/common/items/armor/hide/scale/hand.ron b/assets/common/items/armor/hide/scale/hand.ron index 2aa5ffc13f..d27eed0118 100644 --- a/assets/common/items/armor/hide/scale/hand.ron +++ b/assets/common/items/armor/hide/scale/hand.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.1, - stealth: 0.0, + stealth: 0.1, ), )), quality: Moderate, diff --git a/assets/common/items/armor/hide/scale/pants.ron b/assets/common/items/armor/hide/scale/pants.ron index cb5571f857..94b3c48413 100644 --- a/assets/common/items/armor/hide/scale/pants.ron +++ b/assets/common/items/armor/hide/scale/pants.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.2, - stealth: 0.0, + stealth: 0.2, ), )), quality: Moderate, diff --git a/assets/common/items/armor/hide/scale/shoulder.ron b/assets/common/items/armor/hide/scale/shoulder.ron index a5ebd61c0e..c2dcb6fd76 100644 --- a/assets/common/items/armor/hide/scale/shoulder.ron +++ b/assets/common/items/armor/hide/scale/shoulder.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 0, energy_reward: 0.0, crit_power: 0.2, - stealth: 0.0, + stealth: 0.2, ), )), quality: Moderate, diff --git a/assets/common/items/armor/misc/back/dungeon_purple.ron b/assets/common/items/armor/misc/back/dungeon_purple.ron index aa786891e3..b4e41899a4 100644 --- a/assets/common/items/armor/misc/back/dungeon_purple.ron +++ b/assets/common/items/armor/misc/back/dungeon_purple.ron @@ -9,7 +9,7 @@ ItemDef( energy_max: 2.0, energy_reward: 0.025, crit_power: 0.02, - stealth: 0.0, + stealth: 0.02, ), )), quality: Epic, diff --git a/common/src/combat.rs b/common/src/combat.rs index c7f5ab685f..619cb30084 100644 --- a/common/src/combat.rs +++ b/common/src/combat.rs @@ -994,3 +994,22 @@ pub fn compute_max_energy_mod(inventory: Option<&Inventory>) -> f32 { .sum() }) } + +/// Computes the sneak coefficient from armor. Agent perception distances are +/// divided by the resulting f32. +#[cfg(not(target_arch = "wasm32"))] +pub fn compute_stealth_coefficient(inventory: Option<&Inventory>) -> f32 { + // Starts with a value of 2.0 when summing the stats from each armor piece, and + // defaults to a value of 2.0 if no inventory is equipped + inventory.map_or(2.0, |inv| { + inv.equipped_items() + .filter_map(|item| { + if let ItemKind::Armor(armor) = &item.kind() { + Some(armor.stealth()) + } else { + None + } + }) + .fold(2.0, |a, b| a + b.max(0.0)) + }) +} diff --git a/common/src/comp/inventory/item/armor.rs b/common/src/comp/inventory/item/armor.rs index 80ac97f12a..b66f218c24 100644 --- a/common/src/comp/inventory/item/armor.rs +++ b/common/src/comp/inventory/item/armor.rs @@ -43,6 +43,8 @@ pub struct Stats { /// Crit power is summed, and then added to the default crit multiplier of /// 1.25. Damage is multiplied by this value when an attack crits. crit_power: f32, + /// Stealth is summed along with the base stealth bonus (2.0), and then + /// the agent's perception distance is divided by this value stealth: f32, } diff --git a/server/src/sys/agent.rs b/server/src/sys/agent.rs index 061297bc80..dcb6fe4400 100644 --- a/server/src/sys/agent.rs +++ b/server/src/sys/agent.rs @@ -1,5 +1,6 @@ use crate::rtsim::{Entity as RtSimData, RtSim}; use common::{ + combat, comp::{ self, agent::{ @@ -168,7 +169,6 @@ const PARTIAL_PATH_DIST: f32 = 50.0; const SEPARATION_DIST: f32 = 10.0; const SEPARATION_BIAS: f32 = 0.8; const MAX_FLEE_DIST: f32 = 20.0; -const SNEAK_COEFFICIENT: f32 = 0.25; const AVG_FOLLOW_DIST: f32 = 6.0; const RETARGETING_THRESHOLD_SECONDS: f64 = 10.0; const HEALING_ITEM_THRESHOLD: f32 = 0.5; @@ -1529,16 +1529,16 @@ impl<'a> AgentData<'a> { let max_search_dist = agent.psyche.search_dist(); let max_sight_dist = agent.psyche.sight_dist; let max_listen_dist = agent.psyche.listen_dist; - let in_sight_dist = |e_pos: &Pos, e_char_state: Option<&CharacterState>| { - let search_dist = max_sight_dist - * if e_char_state.map_or(false, CharacterState::is_stealthy) { - // TODO: make sneak more effective based on a stat like e_stats.fitness - SNEAK_COEFFICIENT - } else { - 1.0 - }; - e_pos.0.distance_squared(self.pos.0) < search_dist.powi(2) - }; + let in_sight_dist = + |e_pos: &Pos, e_char_state: Option<&CharacterState>, inventory: &Inventory| { + let search_dist = max_sight_dist + / if e_char_state.map_or(false, CharacterState::is_stealthy) { + combat::compute_stealth_coefficient(Some(inventory)) + } else { + 1.0 + }; + e_pos.0.distance_squared(self.pos.0) < search_dist.powi(2) + }; let within_fov = |e_pos: &Pos| { (e_pos.0 - self.pos.0) @@ -1546,22 +1546,23 @@ impl<'a> AgentData<'a> { .map_or(true, |v| v.dot(*controller.inputs.look_dir) > 0.15) }; - let in_listen_dist = |e_pos: &Pos, e_char_state: Option<&CharacterState>| { - let listen_dist = max_listen_dist - * if e_char_state.map_or(false, CharacterState::is_stealthy) { - // TODO: make sneak more effective based on a stat like e_stats.fitness - SNEAK_COEFFICIENT - } else { - 1.0 - }; - // TODO implement proper sound system for agents - e_pos.0.distance_squared(self.pos.0) < listen_dist.powi(2) - }; + let in_listen_dist = + |e_pos: &Pos, e_char_state: Option<&CharacterState>, inventory: &Inventory| { + let listen_dist = max_listen_dist + / if e_char_state.map_or(false, CharacterState::is_stealthy) { + combat::compute_stealth_coefficient(Some(inventory)) + } else { + 1.0 + }; + // TODO implement proper sound system for agents + e_pos.0.distance_squared(self.pos.0) < listen_dist.powi(2) + }; - let within_reach = |e_pos: &Pos, e_char_state: Option<&CharacterState>| { - (in_sight_dist(e_pos, e_char_state) && within_fov(e_pos)) - || in_listen_dist(e_pos, e_char_state) - }; + let within_reach = + |e_pos: &Pos, e_char_state: Option<&CharacterState>, e_inventory: &Inventory| { + (in_sight_dist(e_pos, e_char_state, e_inventory) && within_fov(e_pos)) + || in_listen_dist(e_pos, e_char_state, e_inventory) + }; let owners_hostile = |e_alignment: Option<&Alignment>| { try_owner_alignment(self.alignment, read_data).map_or(false, |owner_alignment| { @@ -1662,7 +1663,7 @@ impl<'a> AgentData<'a> { Option<&Alignment>, Option<&CharacterState>, )| { - let can_target = within_reach(e_pos, e_char_state) + let can_target = within_reach(e_pos, e_char_state, e_inventory) && entity != *self.entity && !e_health.is_dead && !invulnerability_is_in_buffs(read_data.buffs.get(entity));