Files
tbd-station-14/Content.Shared/Clothing/EntitySystems/SpeedModifierContactCapClothingSystem.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

21 lines
717 B
C#

using Content.Shared.Clothing.Components;
using Content.Shared.Inventory;
using Content.Shared.Movement.Events;
namespace Content.Shared.Clothing.EntitySystems;
public sealed class SpeedModifierContactCapClothingSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SpeedModifierContactCapClothingComponent, InventoryRelayedEvent<GetSpeedModifierContactCapEvent>>(OnGetMaxSlow);
}
private void OnGetMaxSlow(Entity<SpeedModifierContactCapClothingComponent> ent, ref InventoryRelayedEvent<GetSpeedModifierContactCapEvent> args)
{
args.Args.SetIfMax(ent.Comp.MaxContactSprintSlowdown, ent.Comp.MaxContactWalkSlowdown);
}
}