From: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Date: Wed, 3 Dec 2025 21:55:04 +0000 (+0100)
Subject: Change stamina slowdown to use a percentage-based threshold (#41691)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=bb2169dca42ce5339148093673fabaf396dff6a5;p=space-station-14.git
Change stamina slowdown to use a percentage-based threshold (#41691)
Change stamina to use a percentage based slowdown
---
diff --git a/Content.Shared/Damage/Components/StaminaComponent.cs b/Content.Shared/Damage/Components/StaminaComponent.cs
index b343b24403..9875d31349 100644
--- a/Content.Shared/Damage/Components/StaminaComponent.cs
+++ b/Content.Shared/Damage/Components/StaminaComponent.cs
@@ -85,10 +85,10 @@ public sealed partial class StaminaComponent : Component
public SoundSpecifier ForceStandSuccessSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg");
///
- /// Thresholds that determine an entity's slowdown as a function of stamina damage.
+ /// Thresholds that determine an entity's slowdown as a function of stamina damage, in percentages.
///
[DataField]
- public Dictionary StunModifierThresholds = new() { {0, 1f }, { 60, 0.7f }, { 80, 0.5f } };
+ public Dictionary StunModifierThresholds = new() { {0, 1f }, { 0.6, 0.7f }, { 0.8, 0.5f } };
#region Animation Data
diff --git a/Content.Shared/Damage/Systems/SharedStaminaSystem.cs b/Content.Shared/Damage/Systems/SharedStaminaSystem.cs
index 5a168f04a0..045052d1fa 100644
--- a/Content.Shared/Damage/Systems/SharedStaminaSystem.cs
+++ b/Content.Shared/Damage/Systems/SharedStaminaSystem.cs
@@ -442,7 +442,7 @@ public abstract partial class SharedStaminaSystem : EntitySystem
{
var key = thres.Key.Float();
- if (ent.Comp.StaminaDamage >= key && key > closest && closest < ent.Comp.CritThreshold)
+ if ((ent.Comp.StaminaDamage / ent.Comp.CritThreshold) >= key && key > closest && closest < 1f)
closest = thres.Key;
}