]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Change stamina slowdown to use a percentage-based threshold (#41691)
authorSlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
Wed, 3 Dec 2025 21:55:04 +0000 (22:55 +0100)
committerGitHub <noreply@github.com>
Wed, 3 Dec 2025 21:55:04 +0000 (21:55 +0000)
Change stamina to use a percentage based slowdown

Content.Shared/Damage/Components/StaminaComponent.cs
Content.Shared/Damage/Systems/SharedStaminaSystem.cs

index b343b24403717c92e86a7bd21069765ed6296b9b..9875d313491ea6658dc8168e41d0a7b3fefa96a3 100644 (file)
@@ -85,10 +85,10 @@ public sealed partial class StaminaComponent : Component
     public SoundSpecifier ForceStandSuccessSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg");
 
     /// <summary>
-    /// 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.
     /// </summary>
     [DataField]
-    public Dictionary<FixedPoint2, float> StunModifierThresholds = new() { {0, 1f }, { 60, 0.7f }, { 80, 0.5f } };
+    public Dictionary<FixedPoint2, float> StunModifierThresholds = new() { {0, 1f }, { 0.6, 0.7f }, { 0.8, 0.5f } };
 
     #region Animation Data
 
index 5a168f04a092bb52ffa26c672c77defad2951f68..045052d1facdfc7323417a8415a5852651df6aaa 100644 (file)
@@ -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;
         }