diff --git a/Content.IntegrationTests/Tests/DoAfter/DoAfterCancellationTests.cs b/Content.IntegrationTests/Tests/DoAfter/DoAfterCancellationTests.cs index 1aaf4a5184c..a70a267b3a2 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); + + // CORVAX-NEXT START + if (!ActiveDoAfters.Any()) + { + await AssertTile(Plating); + return; + } + // CORVAX-NEXT 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()) // CORVAX-NEXT + 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 93713e52c67..9bb52b63e42 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; // CORVAX-NEXT public GetPryTimeModifierEvent(EntityUid user) { diff --git a/Content.Shared/Prying/Systems/PryingSystem.cs b/Content.Shared/Prying/Systems/PryingSystem.cs index 10c80cfab59..cd8fd551cf9 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) + + // CORVAX-NEXT 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) // CORVAX-NEXT 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) // CORVAX-NEXT-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 57058a5781a..8b308dab348 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); // CORVAX-NEXT-EDIT /// /// Whether or not the tile being modified must be unobstructed diff --git a/Resources/Locale/en-US/_corvaxnext/tools/tool-qualities.ftl b/Resources/Locale/en-US/_corvaxnext/tools/tool-qualities.ftl new file mode 100644 index 00000000000..3336a793bb6 --- /dev/null +++ b/Resources/Locale/en-US/_corvaxnext/tools/tool-qualities.ftl @@ -0,0 +1,2 @@ +tool-quality-advanced-prying-name = Advanced Prying +tool-quality-advanced-prying-tool-name = Axe diff --git a/Resources/Locale/en-US/tools/tool-qualities.ftl b/Resources/Locale/en-US/tools/tool-qualities.ftl index 14e42390a76..7b0e0102a74 100644 --- a/Resources/Locale/en-US/tools/tool-qualities.ftl +++ b/Resources/Locale/en-US/tools/tool-qualities.ftl @@ -32,4 +32,4 @@ 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 diff --git a/Resources/Locale/ru-RU/_corvaxnext/tools/tool-qualities.ftl b/Resources/Locale/ru-RU/_corvaxnext/tools/tool-qualities.ftl new file mode 100644 index 00000000000..f0925d44992 --- /dev/null +++ b/Resources/Locale/ru-RU/_corvaxnext/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 69407370ce1..60640d281ac 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 # Corvax-Next-AdvancedPrying - type: ToolTileCompatible - type: Prying - type: UseDelay diff --git a/Resources/Prototypes/Tiles/plating.yml b/Resources/Prototypes/Tiles/plating.yml index 7edb1ae784c..28dea56b704 100644 --- a/Resources/Prototypes/Tiles/plating.yml +++ b/Resources/Prototypes/Tiles/plating.yml @@ -4,6 +4,7 @@ sprite: /Textures/Tiles/plating.png baseTurf: Lattice isSubfloor: true + deconstructTools: [ AdvancedPrying ] # Corvax-Next-AdvancedPrying footstepSounds: collection: FootstepPlating friction: 0.3 @@ -20,6 +21,7 @@ - 1.0 baseTurf: Lattice isSubfloor: true + deconstructTools: [ AdvancedPrying ] # Corvax-Next-AdvancedPrying footstepSounds: collection: FootstepPlating friction: 0.3 @@ -31,6 +33,7 @@ sprite: /Textures/Tiles/plating_burnt.png baseTurf: Lattice isSubfloor: true + deconstructTools: [ AdvancedPrying ] # Corvax-Next-AdvancedPrying footstepSounds: collection: FootstepPlating friction: 0.3 diff --git a/Resources/Prototypes/_CorvaxNext/tool_qualities.yml b/Resources/Prototypes/_CorvaxNext/tool_qualities.yml new file mode 100644 index 00000000000..8bf9d2263f2 --- /dev/null +++ b/Resources/Prototypes/_CorvaxNext/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 }