mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
* first draft * Fixed it all, just need to rename stuff * Rename and add comments * Clean-up * Access added
29 lines
877 B
C#
29 lines
877 B
C#
using Content.Shared.Inventory;
|
|
|
|
namespace Content.Shared.Movement.Events;
|
|
|
|
/// <summary>
|
|
/// Raised on an entity to check if it has a max contact slowdown.
|
|
/// </summary>
|
|
[ByRefEvent]
|
|
public record struct GetSpeedModifierContactCapEvent() : IInventoryRelayEvent
|
|
{
|
|
SlotFlags IInventoryRelayEvent.TargetSlots => ~SlotFlags.POCKET;
|
|
|
|
public float WalkSpeedModifier;
|
|
|
|
public float SprintSpeedModifier;
|
|
|
|
public void SetIfMax(float walkSpeedModifier, float sprintSpeedModifier)
|
|
{
|
|
WalkSpeedModifier = MathF.Max(WalkSpeedModifier, walkSpeedModifier);
|
|
SprintSpeedModifier = MathF.Max(SprintSpeedModifier, sprintSpeedModifier);
|
|
}
|
|
|
|
public GetSpeedModifierContactCapEvent(float walkSpeedModifier, float sprintSpeedModifier) : this()
|
|
{
|
|
WalkSpeedModifier = walkSpeedModifier;
|
|
SprintSpeedModifier = sprintSpeedModifier;
|
|
}
|
|
}
|