Pulling rework (#20906)

* Pulling rework

Fixing up the FOUR systems managing pulling, all the shitcode, and also making it nicer ingame.

* More pulling cleanup

* stats

* More cleanup

* First draft

* More pulling

* weh

* Fix puller

* Pulling working

* Fix merge

* Dunked

* Self-merge time
This commit is contained in:
metalgearsloth
2024-02-03 14:36:09 +11:00
committed by GitHub
parent 79e3a6630d
commit 0d8254b2a2
53 changed files with 764 additions and 1359 deletions

View File

@@ -1,9 +1,9 @@
using System.Linq;
using Content.Shared.Ghost;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Pulling.Systems;
using Content.Shared.Popups;
using Content.Shared.Projectiles;
using Content.Shared.Pulling;
using Content.Shared.Pulling.Components;
using Content.Shared.Teleportation.Components;
using Content.Shared.Verbs;
using Robust.Shared.Audio;
@@ -28,7 +28,7 @@ public abstract class SharedPortalSystem : EntitySystem
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedPullingSystem _pulling = default!;
[Dependency] private readonly PullingSystem _pulling = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
private const string PortalFixture = "portalFixture";
@@ -93,15 +93,15 @@ public abstract class SharedPortalSystem : EntitySystem
return;
// break pulls before portal enter so we dont break shit
if (TryComp<SharedPullableComponent>(subject, out var pullable) && pullable.BeingPulled)
if (TryComp<PullableComponent>(subject, out var pullable) && pullable.BeingPulled)
{
_pulling.TryStopPull(pullable);
_pulling.TryStopPull(subject, pullable);
}
if (TryComp<SharedPullerComponent>(subject, out var pulling)
&& pulling.Pulling != null && TryComp<SharedPullableComponent>(pulling.Pulling.Value, out var subjectPulling))
if (TryComp<PullerComponent>(subject, out var pullerComp)
&& TryComp<PullableComponent>(pullerComp.Pulling, out var subjectPulling))
{
_pulling.TryStopPull(subjectPulling);
_pulling.TryStopPull(subject, subjectPulling);
}
// if they came from another portal, just return and wait for them to exit the portal