From 91b6dd8b62e7f790e88b99d2e109245ccd1a9a99 Mon Sep 17 00:00:00 2001 From: CaYpeN1 Date: Sat, 23 Mar 2024 16:25:36 +0500 Subject: [PATCH] change stun to lying --- .../_White/Chemistry/NarcoticEffect.cs | 19 +++++++++---------- .../Chemistry/NarcoticEffectComponent.cs | 5 +---- 2 files changed, 10 insertions(+), 14 deletions(-) rename {Content.Server => Content.Shared}/_White/Chemistry/NarcoticEffect.cs (85%) rename {Content.Server => Content.Shared}/_White/Chemistry/NarcoticEffectComponent.cs (84%) diff --git a/Content.Server/_White/Chemistry/NarcoticEffect.cs b/Content.Shared/_White/Chemistry/NarcoticEffect.cs similarity index 85% rename from Content.Server/_White/Chemistry/NarcoticEffect.cs rename to Content.Shared/_White/Chemistry/NarcoticEffect.cs index 597992a46f..167741eb52 100644 --- a/Content.Server/_White/Chemistry/NarcoticEffect.cs +++ b/Content.Shared/_White/Chemistry/NarcoticEffect.cs @@ -1,24 +1,20 @@ using System.Threading; -using Content.Server.Speech.EntitySystems; -using Content.Server.Stunnable; using Content.Shared._White.Mood; using Content.Shared.Damage.Systems; using Content.Shared.Drunk; +using Content.Shared.Standing; using Content.Shared.StatusEffect; using Robust.Shared.Random; using Timer = Robust.Shared.Timing.Timer; -namespace Content.Server._White.Chemistry; +namespace Content.Shared._White.Chemistry; -/// -/// This handles system? -/// public sealed class NarcoticEffect : EntitySystem { - [Dependency] private readonly StunSystem _stun = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; [Dependency] private readonly StaminaSystem _stamina = default!; + [Dependency] private readonly StandingStateSystem _standingStateSystem = default!; /// public override void Initialize() @@ -43,6 +39,9 @@ public sealed class NarcoticEffect : EntitySystem private void Effects(EntityUid uid, NarcoticEffectComponent component, int index) { + if(!TryComp(uid, out var standingComp)) + return; + RaiseLocalEvent(uid, new MoodEffectEvent("Stimulator")); CancellationToken token = component.CancelTokenSource.Token; @@ -63,12 +62,12 @@ public sealed class NarcoticEffect : EntitySystem break; case NarcoticEffects.StunAndShake when _statusEffectsSystem.HasStatusEffect(uid, "Drunk", statusEffectsComp): - Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token); + Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token); _statusEffectsSystem.TryAddTime(uid, "Drunk", TimeSpan.FromSeconds(slur), statusEffectsComp); break; case NarcoticEffects.Stun: - Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token); + Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token); break; case NarcoticEffects.TremorAndShake: @@ -85,7 +84,7 @@ public sealed class NarcoticEffect : EntitySystem break; case NarcoticEffects.StunAndShake: - Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token); + Timer.SpawnRepeating(timer, () => _standingStateSystem.TryLieDown(uid, standingComp), token); _statusEffectsSystem.TryAddStatusEffect(uid, "Drunk", TimeSpan.FromSeconds(slur), true, statusEffectsComp); break; } diff --git a/Content.Server/_White/Chemistry/NarcoticEffectComponent.cs b/Content.Shared/_White/Chemistry/NarcoticEffectComponent.cs similarity index 84% rename from Content.Server/_White/Chemistry/NarcoticEffectComponent.cs rename to Content.Shared/_White/Chemistry/NarcoticEffectComponent.cs index b992ad33d8..f23182685e 100644 --- a/Content.Server/_White/Chemistry/NarcoticEffectComponent.cs +++ b/Content.Shared/_White/Chemistry/NarcoticEffectComponent.cs @@ -1,7 +1,7 @@ using System.Threading; using Robust.Shared.Serialization; -namespace Content.Server._White.Chemistry; +namespace Content.Shared._White.Chemistry; /// /// This is used for... @@ -9,9 +9,6 @@ namespace Content.Server._White.Chemistry; [RegisterComponent] public sealed partial class NarcoticEffectComponent : Component { - [ViewVariables(VVAccess.ReadWrite), DataField] - public float StunTime = 0.7f; - [ViewVariables(VVAccess.ReadWrite), DataField] public CancellationTokenSource CancelTokenSource = new();