diff --git a/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs b/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs index 2c66e56572d..c68ddf901d3 100644 --- a/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs +++ b/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs @@ -1,5 +1,4 @@ // SPDX-License-Identifier: AGPL-3.0-or-later - using Content.Goobstation.Shared.Teleportation.Systems; using Content.Server.Administration.Logs; using Content.Server.Stack; @@ -7,7 +6,8 @@ using Content.Shared.Interaction.Events; using Content.Shared.Stacks; using Content.Shared.Teleportation; - +// Arcane +using Content.Shared.Timing; namespace Content.Goobstation.Server.Teleportation.Systems; public sealed class RandomTeleportSystem : EntitySystem @@ -15,11 +15,11 @@ public sealed class RandomTeleportSystem : EntitySystem [Dependency] private readonly IAdminLogManager _alog = default!; [Dependency] private readonly StackSystem _stack = default!; [Dependency] private readonly SharedRandomTeleportSystem _sharedRtp = default!; - + // Arcane + [Dependency] private readonly UseDelaySystem _useDelay = default!; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnUseInHand); } @@ -27,10 +27,16 @@ private void OnUseInHand(EntityUid uid, RandomTeleportOnUseComponent component, { if (args.Handled) return; - + // Arcane-Start + if (_useDelay.IsDelayed(uid)) + return; + // Arcane-Start-End if (!_sharedRtp.RandomTeleport(args.User, component, out var wp)) return; - + // Arcane-Start + args.Handled = true; + _useDelay.TryResetDelay(uid); + // Arcane-Start-End if (component.ConsumeOnUse) { if (TryComp(uid, out var stack)) @@ -38,11 +44,9 @@ private void OnUseInHand(EntityUid uid, RandomTeleportOnUseComponent component, _stack.SetCount(uid, stack.Count - 1, stack); return; } - // It's consumed on use and it's not a stack so delete it QueueDel(uid); } - _alog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(args.User):actor} randomly teleported to {wp!} using {ToPrettyString(uid)}"); } } diff --git a/Resources/Prototypes/_Goobstation/Entities/Objects/Materials/materials.yml b/Resources/Prototypes/_Goobstation/Entities/Objects/Materials/materials.yml index 05adf1f4a84..1dbd421b7d6 100644 --- a/Resources/Prototypes/_Goobstation/Entities/Objects/Materials/materials.yml +++ b/Resources/Prototypes/_Goobstation/Entities/Objects/Materials/materials.yml @@ -6,6 +6,10 @@ name: bluespace crystal suffix: Full components: +# Arcane-Start + - type: UseDelay + delay: 15 +# Arcane-Start-End - type: Stack stackType: BSCrystal baseLayer: base @@ -117,4 +121,4 @@ suffix: Single components: - type: Stack - count: 1 \ No newline at end of file + count: 1