From 6f5e1b2489cf1300c5973c9ced7654512fecb722 Mon Sep 17 00:00:00 2001 From: klen Date: Fri, 7 Aug 2026 09:19:02 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20=D0=9A=D0=94=20=D0=B1=D0=BB=D1=8E=D1=81=D0=BF=D0=B5=D0=B9?= =?UTF-8?q?=D1=81=20=D0=BA=D1=80=D0=B8=D1=81=D1=82=D0=B0=D0=BB=D0=BB=D0=B0?= =?UTF-8?q?=D0=BC.=20=D0=95=D0=BB=D0=B5-=D0=B5=D0=BB=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Teleportation/Systems/RandomTeleportSystem.cs | 12 ++++++++---- .../Entities/Objects/Materials/materials.yml | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs b/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs index 2c66e56572d..1d8533d9ff6 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,6 +6,7 @@ using Content.Shared.Interaction.Events; using Content.Shared.Stacks; using Content.Shared.Teleportation; +using Content.Shared.Timing; namespace Content.Goobstation.Server.Teleportation.Systems; @@ -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!; + [Dependency] private readonly UseDelaySystem _useDelay = default!; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnUseInHand); } @@ -28,9 +28,15 @@ private void OnUseInHand(EntityUid uid, RandomTeleportOnUseComponent component, if (args.Handled) return; + if (_useDelay.IsDelayed(uid)) + return; + if (!_sharedRtp.RandomTeleport(args.User, component, out var wp)) return; + args.Handled = true; + _useDelay.TryResetDelay(uid); + 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 From 89bed44ca9af6a2b58cae1af2fdd530ce03d37df Mon Sep 17 00:00:00 2001 From: klen Date: Fri, 7 Aug 2026 20:28:58 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=97=D0=B0=D0=B1=D1=8B=D0=BB=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=82=D1=8B,=20=D0=B4=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=B8=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Teleportation/Systems/RandomTeleportSystem.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs b/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs index 1d8533d9ff6..c68ddf901d3 100644 --- a/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs +++ b/Content.Goobstation.Server/Teleportation/Systems/RandomTeleportSystem.cs @@ -6,8 +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,8 +15,8 @@ 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(); @@ -27,16 +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))