Add Galoshes slowdown over slippery surfaces (#30967)
* first draft * Fixed it all, just need to rename stuff * Rename and add comments * Clean-up * Access added
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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 MaxSprintSlowdown = 0f;
|
||||
|
||||
public float MaxWalkSlowdown = 0f;
|
||||
|
||||
public void SetIfMax(float valueSprint, float valueWalk)
|
||||
{
|
||||
MaxSprintSlowdown = MathF.Max(MaxSprintSlowdown, valueSprint);
|
||||
MaxWalkSlowdown = MathF.Max(MaxWalkSlowdown, valueWalk);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user