diff --git a/Content.Server/Nyanotrasen/Item/ShockCollar/ShockCollarSystem.cs b/Content.Server/Nyanotrasen/Item/ShockCollar/ShockCollarSystem.cs index d6bba3b0d76..0390bc19db7 100644 --- a/Content.Server/Nyanotrasen/Item/ShockCollar/ShockCollarSystem.cs +++ b/Content.Server/Nyanotrasen/Item/ShockCollar/ShockCollarSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Mobs.Components; +using Content.Shared.Timing; using Content.Server.Explosion.EntitySystems; // Why is trigger under explosions by the way? Even doors already use it. using Content.Server.Electrocution; using Robust.Shared.Containers; @@ -9,6 +10,8 @@ public sealed partial class ShockCollarSystem : EntitySystem { [Dependency] private readonly SharedContainerSystem _container = default!; [Dependency] private readonly ElectrocutionSystem _electrocutionSystem = default!; + [Dependency] private readonly UseDelaySystem _useDelay = default!; + public override void Initialize() { base.Initialize(); @@ -25,6 +28,13 @@ private void OnTrigger(EntityUid uid, ShockCollarComponent component, TriggerEve if (!HasComp(containerEnt)) // If it's not a mob we don't care return; + // DeltaV: prevent clocks from instantly killing people + TryComp(uid, out var useDelay); + if (_useDelay.ActiveDelay(uid, useDelay)) + return; + + _useDelay.BeginDelay(uid, useDelay); + _electrocutionSystem.TryDoElectrocution(containerEnt, null, 5, TimeSpan.FromSeconds(2), true); } } diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/shock_collar.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/shock_collar.yml index 396db81819d..35cdcae6589 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/shock_collar.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Devices/shock_collar.yml @@ -2,13 +2,15 @@ parent: ClothingNeckBase id: ShockCollar name: shock collar - description: Shocking. Placeholder sprite. + description: Shocking. # DeltaV: sprite is fine components: - type: Sprite sprite: Nyanotrasen/Clothing/Neck/Misc/shock.rsi - type: Clothing sprite: Nyanotrasen/Clothing/Neck/Misc/shock.rsi - type: ShockCollar + - type: UseDelay + delay: 3 # DeltaV: prevent clocks instakilling people - type: TriggerOnSignal - type: DeviceNetwork deviceNetId: Wireless