From 6f455b7513c676901502e49f49897854b2a8d06e Mon Sep 17 00:00:00 2001 From: CaYpeN1 Date: Thu, 21 Mar 2024 14:58:15 +0500 Subject: [PATCH] =?UTF-8?q?tweak:=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=81=D1=82=D0=B0=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_White/Chemistry/NarcoticEffect.cs | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Content.Server/_White/Chemistry/NarcoticEffect.cs b/Content.Server/_White/Chemistry/NarcoticEffect.cs index bb2a2d7254..7d21fc433d 100644 --- a/Content.Server/_White/Chemistry/NarcoticEffect.cs +++ b/Content.Server/_White/Chemistry/NarcoticEffect.cs @@ -1,10 +1,11 @@ using System.Threading; -using Content.Server.Speech.EntitySystems; -using Content.Server.Stunnable; using Content.Shared._White.Mood; +using Content.Shared.Damage; +using Content.Shared.Damage.Prototypes; using Content.Shared.Damage.Systems; using Content.Shared.Drunk; using Content.Shared.StatusEffect; +using Robust.Shared.Prototypes; using Robust.Shared.Random; using Timer = Robust.Shared.Timing.Timer; @@ -15,8 +16,9 @@ namespace Content.Server._White.Chemistry; /// public sealed class NarcoticEffect : EntitySystem { - [Dependency] private readonly StunSystem _stun = default!; + [Dependency] private readonly DamageableSystem _damageableSystem = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!; + [Dependency] private static readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; [Dependency] private readonly StaminaSystem _stamina = default!; @@ -43,6 +45,7 @@ public sealed class NarcoticEffect : EntitySystem private void Effects(EntityUid uid, NarcoticEffectComponent component, int index) { + var damageSpecifier = new DamageSpecifier(_prototypeManager.Index("Poison"), 5); RaiseLocalEvent(uid, new MoodEffectEvent("Stimulator")); CancellationToken token = component.cancelTokenSource.Token; @@ -62,13 +65,13 @@ public sealed class NarcoticEffect : EntitySystem _statusEffectsSystem.TryAddTime(uid, "Drunk", TimeSpan.FromSeconds(slur), statusEffectsComp); break; - case "StunAndShake" when _statusEffectsSystem.HasStatusEffect(uid, "Drunk", statusEffectsComp): - Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token); + case "DamageAndShake" when _statusEffectsSystem.HasStatusEffect(uid, "Drunk", statusEffectsComp): + _damageableSystem.TryChangeDamage(uid, damageSpecifier, true, false); _statusEffectsSystem.TryAddTime(uid, "Drunk", TimeSpan.FromSeconds(slur), statusEffectsComp); break; - case "Stun": - Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token); + case "Damage": + _damageableSystem.TryChangeDamage(uid, damageSpecifier, true, false); break; case "TremorAndShake": @@ -84,8 +87,8 @@ public sealed class NarcoticEffect : EntitySystem _statusEffectsSystem.TryAddStatusEffect(uid, "Drunk", TimeSpan.FromSeconds(slur), true, statusEffectsComp); break; - case "StunAndShake": - Timer.SpawnRepeating(timer, () => _stun.TryParalyze(uid, TimeSpan.FromSeconds(component.StunTime), true), token); + case "DamageAndShake": + _damageableSystem.TryChangeDamage(uid, damageSpecifier, true, false); _statusEffectsSystem.TryAddStatusEffect(uid, "Drunk", TimeSpan.FromSeconds(slur), true, statusEffectsComp); break; }