Add back pull moving (#3635)
* 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>
This commit is contained in:
30
Content.Client/GameObjects/EntitySystems/PullingSystem.cs
Normal file
30
Content.Client/GameObjects/EntitySystems/PullingSystem.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user