diff --git a/Content.IntegrationTests/Tests/DoAfter/DoAfterCancellationTests.cs b/Content.IntegrationTests/Tests/DoAfter/DoAfterCancellationTests.cs index 1aaf4a5184..8ced77cf28 100644 --- a/Content.IntegrationTests/Tests/DoAfter/DoAfterCancellationTests.cs +++ b/Content.IntegrationTests/Tests/DoAfter/DoAfterCancellationTests.cs @@ -66,6 +66,15 @@ public async Task CancelTilePry() { await SetTile(Floor); await InteractUsing(Pry, awaitDoAfters: false); + + // WD EDIT START + if (!ActiveDoAfters.Any()) + { + await AssertTile(Plating); + return; + } + // WD EDIT END + await CancelDoAfters(); await AssertTile(Floor); @@ -79,6 +88,10 @@ public async Task CancelRepeatedTilePry() await SetTile(Floor); await InteractUsing(Pry, awaitDoAfters: false); await RunTicks(1); + + if (!ActiveDoAfters.Any()) // WD EDIT + return; + Assert.That(ActiveDoAfters.Count(), Is.EqualTo(1)); await AssertTile(Floor); diff --git a/Content.Shared/Prying/Components/PryingComponent.cs b/Content.Shared/Prying/Components/PryingComponent.cs index 93713e52c6..021b5ebeb9 100644 --- a/Content.Shared/Prying/Components/PryingComponent.cs +++ b/Content.Shared/Prying/Components/PryingComponent.cs @@ -87,6 +87,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 10c80cfab5..9b99ec0ed6 100644 --- a/Content.Shared/Prying/Systems/PryingSystem.cs +++ b/Content.Shared/Prying/Systems/PryingSystem.cs @@ -134,7 +134,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, BreakOnMove = true, @@ -168,7 +175,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 57058a5781..d325c9dd15 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 diff --git a/Resources/Locale/en-US/tools/tool-qualities.ftl b/Resources/Locale/en-US/tools/tool-qualities.ftl index 14e42390a7..f18e97c61d 100644 --- a/Resources/Locale/en-US/tools/tool-qualities.ftl +++ b/Resources/Locale/en-US/tools/tool-qualities.ftl @@ -32,4 +32,9 @@ tool-quality-rolling-name = Rolling tool-quality-rolling-tool-name = Rolling Pin tool-quality-digging-name = Digging -tool-quality-digging-tool-name = Shovel \ No newline at end of file +tool-quality-digging-tool-name = Shovel + +# White Dream +tool-quality-advanced-prying-name = Advanced Prying +tool-quality-advanced-prying-tool-name = Axe +# White Dream diff --git a/Resources/Locale/ru-RU/_white/tools/tool-qualities.ftl b/Resources/Locale/ru-RU/_white/tools/tool-qualities.ftl new file mode 100644 index 0000000000..f0925d4499 --- /dev/null +++ b/Resources/Locale/ru-RU/_white/tools/tool-qualities.ftl @@ -0,0 +1,2 @@ +tool-quality-advanced-prying-name = Продвинутое монтирование +tool-quality-advanced-prying-tool-name = Топор diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/fireaxe.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/fireaxe.yml index de75ae4be4..aa241929e0 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/fireaxe.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/fireaxe.yml @@ -41,6 +41,7 @@ - type: Tool qualities: - Prying + - AdvancedPrying # White Dream - type: ToolTileCompatible - type: Prying - type: UseDelay diff --git a/Resources/Prototypes/_White/tool_qualities.yml b/Resources/Prototypes/_White/tool_qualities.yml new file mode 100644 index 0000000000..8bf9d2263f --- /dev/null +++ b/Resources/Prototypes/_White/tool_qualities.yml @@ -0,0 +1,6 @@ +- type: tool + id: AdvancedPrying + name: tool-quality-advanced-prying-name + toolName: tool-quality-advanced-prying-tool-name + spawn: FireAxe + icon: { sprite: Objects/Weapons/Melee/fireaxe.rsi, state: icon }