Pulling rework v2 (#24936)
* 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 * Fix hotkey * Fix container changes * oop * Fix multi-pulling * Move alerts cleanup. * pulling fixes
This commit is contained in:
13
Content.Shared/Movement/Pulling/Events/AttemptPullEvent.cs
Normal file
13
Content.Shared/Movement/Pulling/Events/AttemptPullEvent.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Robust.Shared.Physics.Components;
|
||||
|
||||
namespace Content.Shared.Movement.Pulling.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised directed on puller and pullable to determine if it can be pulled.
|
||||
/// </summary>
|
||||
public sealed class PullAttemptEvent : PullMessage
|
||||
{
|
||||
public PullAttemptEvent(EntityUid pullerUid, EntityUid pullableUid) : base(pullerUid, pullableUid) { }
|
||||
|
||||
public bool Cancelled { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Content.Shared.Pulling.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised when a request is made to stop pulling an entity.
|
||||
/// </summary>
|
||||
public record struct AttemptStopPullingEvent(EntityUid? User = null)
|
||||
{
|
||||
public readonly EntityUid? User = User;
|
||||
public bool Cancelled;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Content.Shared.Pulling.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Directed event raised on the pulled to see if it can be pulled.
|
||||
/// </summary>
|
||||
public sealed class BeingPulledAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public BeingPulledAttemptEvent(EntityUid puller, EntityUid pulled)
|
||||
{
|
||||
Puller = puller;
|
||||
Pulled = pulled;
|
||||
}
|
||||
|
||||
public EntityUid Puller { get; }
|
||||
public EntityUid Pulled { get; }
|
||||
}
|
||||
}
|
||||
13
Content.Shared/Movement/Pulling/Events/PullMessage.cs
Normal file
13
Content.Shared/Movement/Pulling/Events/PullMessage.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace Content.Shared.Movement.Pulling.Events;
|
||||
|
||||
public abstract class PullMessage : EntityEventArgs
|
||||
{
|
||||
public readonly EntityUid PullerUid;
|
||||
public readonly EntityUid PulledUid;
|
||||
|
||||
protected PullMessage(EntityUid pullerUid, EntityUid pulledUid)
|
||||
{
|
||||
PullerUid = pullerUid;
|
||||
PulledUid = pulledUid;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Content.Shared.Movement.Pulling.Events;
|
||||
|
||||
public sealed class PullStartedMessage : PullMessage
|
||||
{
|
||||
public PullStartedMessage(EntityUid pullerUid, EntityUid pullableUid) :
|
||||
base(pullerUid, pullableUid)
|
||||
{
|
||||
}
|
||||
}
|
||||
13
Content.Shared/Movement/Pulling/Events/PullStoppedMessage.cs
Normal file
13
Content.Shared/Movement/Pulling/Events/PullStoppedMessage.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Robust.Shared.Physics.Components;
|
||||
|
||||
namespace Content.Shared.Movement.Pulling.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Raised directed on both puller and pullable.
|
||||
/// </summary>
|
||||
public sealed class PullStoppedMessage : PullMessage
|
||||
{
|
||||
public PullStoppedMessage(EntityUid pullerUid, EntityUid pulledUid) : base(pullerUid, pulledUid)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace Content.Shared.Pulling.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Directed event raised on the puller to see if it can start pulling something.
|
||||
/// </summary>
|
||||
public sealed class StartPullAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public StartPullAttemptEvent(EntityUid puller, EntityUid pulled)
|
||||
{
|
||||
Puller = puller;
|
||||
Pulled = pulled;
|
||||
}
|
||||
|
||||
public EntityUid Puller { get; }
|
||||
public EntityUid Pulled { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user