From 9044f00057c43f9193cfed8d9182506650468269 Mon Sep 17 00:00:00 2001 From: Remuchi Date: Wed, 6 Nov 2024 14:51:16 +0700 Subject: [PATCH] fix: fixed runed door repulsing Signed-off-by: Remuchi --- Content.Shared/Repulsor/RepulseComponent.cs | 3 +-- Content.Shared/Repulsor/RepulseSystem.cs | 6 ++++-- .../BloodCult/RunedDoor/RunedDoorSystem.cs | 14 +++++++++----- .../WhiteDream/BloodCult/actions.rsi/meta.json | 3 +++ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Content.Shared/Repulsor/RepulseComponent.cs b/Content.Shared/Repulsor/RepulseComponent.cs index ca96174d5f9..cef64458e27 100644 --- a/Content.Shared/Repulsor/RepulseComponent.cs +++ b/Content.Shared/Repulsor/RepulseComponent.cs @@ -13,8 +13,7 @@ public sealed partial class RepulseComponent : Component public TimeSpan StunDuration = TimeSpan.FromSeconds(3); } -public sealed class BeforeRepulseEvent(EntityUid origin, EntityUid target) : CancellableEntityEventArgs +public sealed class BeforeRepulseEvent(EntityUid target) : CancellableEntityEventArgs { - public EntityUid Origin = origin; public EntityUid Target = target; } diff --git a/Content.Shared/Repulsor/RepulseSystem.cs b/Content.Shared/Repulsor/RepulseSystem.cs index 7631290cc66..70e39bad5ba 100644 --- a/Content.Shared/Repulsor/RepulseSystem.cs +++ b/Content.Shared/Repulsor/RepulseSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Interaction; +using Content.Shared.Standing; using Content.Shared.Stunnable; using Robust.Shared.Physics.Events; using Robust.Shared.Physics.Systems; @@ -34,7 +35,8 @@ private void OnHandInteract(Entity repulsor, ref InteractHandE public void Repulse(Entity repulsor, EntityUid user) { - var ev = new BeforeRepulseEvent(repulsor, user); + var ev = new BeforeRepulseEvent(user); + RaiseLocalEvent(repulsor, ev); if (ev.Cancelled) return; @@ -43,6 +45,6 @@ public void Repulse(Entity repulsor, EntityUid user) _physics.ApplyLinearImpulse(user, impulse); _stunSystem.TryStun(user, repulsor.Comp.StunDuration, true); - _stunSystem.TryKnockdown(user, repulsor.Comp.KnockdownDuration, true); + _stunSystem.TryKnockdown(user, repulsor.Comp.KnockdownDuration, true, DropHeldItemsBehavior.DropIfStanding); } } diff --git a/Content.Shared/WhiteDream/BloodCult/RunedDoor/RunedDoorSystem.cs b/Content.Shared/WhiteDream/BloodCult/RunedDoor/RunedDoorSystem.cs index 4d4ecdd39a2..7d9dc2281cc 100644 --- a/Content.Shared/WhiteDream/BloodCult/RunedDoor/RunedDoorSystem.cs +++ b/Content.Shared/WhiteDream/BloodCult/RunedDoor/RunedDoorSystem.cs @@ -1,5 +1,6 @@ using Content.Shared.Doors; using Content.Shared.Prying.Components; +using Content.Shared.Repulsor; using Content.Shared.WhiteDream.BloodCult.BloodCultist; using Content.Shared.WhiteDream.BloodCult.Constructs; @@ -14,6 +15,7 @@ public override void Initialize() SubscribeLocalEvent(OnBeforeDoorOpened); SubscribeLocalEvent(OnBeforeDoorClosed); SubscribeLocalEvent(OnBeforePry); + SubscribeLocalEvent(BefoRepulse); } private void OnBeforeDoorOpened(Entity door, ref BeforeDoorOpenedEvent args) @@ -22,9 +24,7 @@ private void OnBeforeDoorOpened(Entity door, ref BeforeDoorO return; if (!CanInteract(user)) - { args.Cancel(); - } } private void OnBeforeDoorClosed(Entity door, ref BeforeDoorClosedEvent args) @@ -33,16 +33,20 @@ private void OnBeforeDoorClosed(Entity door, ref BeforeDoorC return; if (!CanInteract(user)) - { args.Cancel(); - } } - private void OnBeforePry(Entity ent, ref BeforePryEvent args) + private void OnBeforePry(Entity door, ref BeforePryEvent args) { args.Cancelled = true; } + private void BefoRepulse(Entity door, ref BeforeRepulseEvent args) + { + if (HasComp(args.Target) || HasComp(args.Target)) + args.Cancel(); + } + private bool CanInteract(EntityUid user) { return HasComp(user) || HasComp(user); diff --git a/Resources/Textures/WhiteDream/BloodCult/actions.rsi/meta.json b/Resources/Textures/WhiteDream/BloodCult/actions.rsi/meta.json index dfafb993bdf..57c5432a245 100644 --- a/Resources/Textures/WhiteDream/BloodCult/actions.rsi/meta.json +++ b/Resources/Textures/WhiteDream/BloodCult/actions.rsi/meta.json @@ -40,6 +40,9 @@ { "name": "final_reckoning" }, + { + "name": "gone" + }, { "name": "lesser_construct" },