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:
@@ -1,28 +0,0 @@
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.Pulling.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
|
||||
namespace Content.Shared.Pulling.Systems
|
||||
{
|
||||
public sealed class SharedPullableSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||
[Dependency] private readonly SharedPullingSystem _pullSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<SharedPullableComponent, MoveInputEvent>(OnRelayMoveInput);
|
||||
}
|
||||
|
||||
private void OnRelayMoveInput(EntityUid uid, SharedPullableComponent component, ref MoveInputEvent args)
|
||||
{
|
||||
var entity = args.Entity;
|
||||
if (_mobState.IsIncapacitated(entity) || !_blocker.CanMove(entity)) return;
|
||||
|
||||
_pullSystem.TryStopPull(component);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user