From 6babeb4e2ca92ff6e02e2d761762393848d9d3b3 Mon Sep 17 00:00:00 2001 From: Spatison <137375981+Spatison@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:59:42 +0300 Subject: [PATCH] tweak: neglecting time when using scrap --- Content.Shared/Prying/Components/PryingComponent.cs | 1 + Content.Shared/Prying/Systems/PryingSystem.cs | 11 +++++++++-- .../Tools/Components/ToolTileCompatibleComponent.cs | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Prying/Components/PryingComponent.cs b/Content.Shared/Prying/Components/PryingComponent.cs index 7a7f304d8f..4bb4f175a0 100644 --- a/Content.Shared/Prying/Components/PryingComponent.cs +++ b/Content.Shared/Prying/Components/PryingComponent.cs @@ -75,6 +75,7 @@ public record struct GetPryTimeModifierEvent public readonly EntityUid User; public float PryTimeModifier = 1.0f; public float BaseTime = 5.0f; + public float Neglect = 5f; // WD EDIT public GetPryTimeModifierEvent(EntityUid user) { diff --git a/Content.Shared/Prying/Systems/PryingSystem.cs b/Content.Shared/Prying/Systems/PryingSystem.cs index fa7a135e6c..8dc6efd4de 100644 --- a/Content.Shared/Prying/Systems/PryingSystem.cs +++ b/Content.Shared/Prying/Systems/PryingSystem.cs @@ -133,7 +133,14 @@ private bool StartPry(EntityUid target, EntityUid user, EntityUid? tool, float t var modEv = new GetPryTimeModifierEvent(user); RaiseLocalEvent(target, ref modEv); - var doAfterArgs = new DoAfterArgs(EntityManager, user, TimeSpan.FromSeconds(modEv.BaseTime * modEv.PryTimeModifier / toolModifier), new DoorPryDoAfterEvent(), target, target, tool) + + // WD EDIT START + var time = modEv.BaseTime * modEv.PryTimeModifier / toolModifier; + + if (time <= modEv.Neglect) + time = 0; + + var doAfterArgs = new DoAfterArgs(EntityManager, user, TimeSpan.FromSeconds(time), new DoorPryDoAfterEvent(), target, target, tool) // WD EDIT END { BreakOnDamage = true, BreakOnUserMove = true, @@ -167,7 +174,7 @@ private void OnDoAfter(EntityUid uid, DoorComponent door, DoorPryDoAfterEvent ar return; } - if (args.Used != null && comp != null) + if (args.Used != null && comp != null && door.State is not DoorState.Closing and not DoorState.Opening) // WD EDIT { _audioSystem.PlayPredicted(comp.UseSound, args.Used.Value, args.User); } diff --git a/Content.Shared/Tools/Components/ToolTileCompatibleComponent.cs b/Content.Shared/Tools/Components/ToolTileCompatibleComponent.cs index caac41a3de..4bddf5a2fd 100644 --- a/Content.Shared/Tools/Components/ToolTileCompatibleComponent.cs +++ b/Content.Shared/Tools/Components/ToolTileCompatibleComponent.cs @@ -18,7 +18,7 @@ public sealed partial class ToolTileCompatibleComponent : Component /// The time it takes to modify the tile. /// [DataField, ViewVariables(VVAccess.ReadWrite)] - public TimeSpan Delay = TimeSpan.FromSeconds(1); + public TimeSpan Delay = TimeSpan.FromSeconds(0); // WD EDIT /// /// Whether or not the tile being modified must be unobstructed