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; }