* Add back pull moving * Make pull moving event-based, use map coordinates, slow down moving when getting closer and stop moving when very close, add max range and add compensation for overshooting * Remove compensation * Prevent pull move from pulling you * acruid did this * Add unsubscriptions to shutdown Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
31 lines
986 B
C#
31 lines
986 B
C#
using Content.Client.GameObjects.Components.Pulling;
|
|
using Content.Shared.GameObjects.EntitySystemMessages.Pulling;
|
|
using Content.Shared.GameObjects.EntitySystems;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.Physics;
|
|
|
|
namespace Content.Client.GameObjects.EntitySystems
|
|
{
|
|
[UsedImplicitly]
|
|
public class PullingSystem : SharedPullingSystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
UpdatesAfter.Add(typeof(PhysicsSystem));
|
|
|
|
SubscribeLocalEvent<PullableComponent, PullableMoveMessage>(OnPullableMove);
|
|
SubscribeLocalEvent<PullableComponent, PullableStopMovingMessage>(OnPullableStopMove);
|
|
}
|
|
|
|
public override void Shutdown()
|
|
{
|
|
base.Shutdown();
|
|
|
|
UnsubscribeLocalEvent<PullableComponent, PullableMoveMessage>(OnPullableMove);
|
|
UnsubscribeLocalEvent<PullableComponent, PullableStopMovingMessage>(OnPullableStopMove);
|
|
}
|
|
}
|
|
}
|