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

@@ -6,16 +6,15 @@ using Content.Shared.Coordinates.Helpers;
using Content.Shared.Database;
using Content.Shared.DoAfter;
using Content.Shared.Interaction;
using Content.Shared.Movement.Pulling.Components;
using Content.Shared.Movement.Pulling.Systems;
using Content.Shared.Popups;
using Content.Shared.Pulling;
using Content.Shared.Pulling.Components;
using Content.Shared.Tools;
using Content.Shared.Tools.Components;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
using Content.Shared.Tag;
using Robust.Shared.Player;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
@@ -27,7 +26,7 @@ public sealed partial class AnchorableSystem : EntitySystem
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedPullingSystem _pulling = default!;
[Dependency] private readonly PullingSystem _pulling = default!;
[Dependency] private readonly SharedToolSystem _tool = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
@@ -129,9 +128,9 @@ public sealed partial class AnchorableSystem : EntitySystem
var rot = xform.LocalRotation;
xform.LocalRotation = Math.Round(rot / (Math.PI / 2)) * (Math.PI / 2);
if (TryComp<SharedPullableComponent>(uid, out var pullable) && pullable.Puller != null)
if (TryComp<PullableComponent>(uid, out var pullable) && pullable.Puller != null)
{
_pulling.TryStopPull(pullable);
_pulling.TryStopPull(uid, pullable);
}
// TODO: Anchoring snaps rn anyway!
@@ -172,7 +171,7 @@ public sealed partial class AnchorableSystem : EntitySystem
public void TryToggleAnchor(EntityUid uid, EntityUid userUid, EntityUid usingUid,
AnchorableComponent? anchorable = null,
TransformComponent? transform = null,
SharedPullableComponent? pullable = null,
PullableComponent? pullable = null,
ToolComponent? usingTool = null)
{
if (!Resolve(uid, ref transform))
@@ -201,7 +200,7 @@ public sealed partial class AnchorableSystem : EntitySystem
private void TryAnchor(EntityUid uid, EntityUid userUid, EntityUid usingUid,
AnchorableComponent? anchorable = null,
TransformComponent? transform = null,
SharedPullableComponent? pullable = null,
PullableComponent? pullable = null,
ToolComponent? usingTool = null)
{
if (!Resolve(uid, ref anchorable, ref transform))