Files
tbd-station-14/Content.Shared/Movement/Events/GetSpeedModifierContactCapEvent.cs
SlamBamActionman 9ee43eed2c 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
2024-08-23 19:59:51 +10:00

23 lines
628 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 MaxSprintSlowdown = 0f;
public float MaxWalkSlowdown = 0f;
public void SetIfMax(float valueSprint, float valueWalk)
{
MaxSprintSlowdown = MathF.Max(MaxSprintSlowdown, valueSprint);
MaxWalkSlowdown = MathF.Max(MaxWalkSlowdown, valueWalk);
}
}