From 109222e5d576fe37ed2a7d2e82997afeb4bc61dd Mon Sep 17 00:00:00 2001 From: PixelTK <85175107+PixelTheKermit@users.noreply.github.com> Date: Mon, 21 Aug 2023 19:18:57 +0100 Subject: [PATCH] unhardcode the stun time (#19396) --- Content.Shared/Damage/Components/StaminaComponent.cs | 6 ++++++ Content.Shared/Damage/Systems/StaminaSystem.cs | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Damage/Components/StaminaComponent.cs b/Content.Shared/Damage/Components/StaminaComponent.cs index f75d4ec2fc..9f745c9df1 100644 --- a/Content.Shared/Damage/Components/StaminaComponent.cs +++ b/Content.Shared/Damage/Components/StaminaComponent.cs @@ -39,6 +39,12 @@ public sealed class StaminaComponent : Component [ViewVariables(VVAccess.ReadWrite), DataField("critThreshold")] public float CritThreshold = 100f; + /// + /// How long will this mob be stunned for? + /// + [ViewVariables(VVAccess.ReadWrite), DataField("stunTime")] + public TimeSpan StunTime = TimeSpan.FromSeconds(6); + /// /// To avoid continuously updating our data we track the last time we updated so we can extrapolate our current stamina. /// diff --git a/Content.Shared/Damage/Systems/StaminaSystem.cs b/Content.Shared/Damage/Systems/StaminaSystem.cs index 31abbf039c..7bf2941dac 100644 --- a/Content.Shared/Damage/Systems/StaminaSystem.cs +++ b/Content.Shared/Damage/Systems/StaminaSystem.cs @@ -394,11 +394,10 @@ public sealed partial class StaminaSystem : EntitySystem component.Critical = true; component.StaminaDamage = component.CritThreshold; - var stunTime = TimeSpan.FromSeconds(6); - _stunSystem.TryParalyze(uid, stunTime, true); + _stunSystem.TryParalyze(uid, component.StunTime, true); // Give them buffer before being able to be re-stunned - component.NextUpdate = _timing.CurTime + stunTime + StamCritBufferTime; + component.NextUpdate = _timing.CurTime + component.StunTime + StamCritBufferTime; EnsureComp(uid); Dirty(component); _adminLogger.Add(LogType.Stamina, LogImpact.Medium, $"{ToPrettyString(uid):user} entered stamina crit");