Generic clothing speed modifiers + hardsuit slowdown (#7094)

This commit is contained in:
mirrorcult
2022-03-13 23:03:49 -07:00
committed by GitHub
parent 1652498830
commit 8005cf31bb
8 changed files with 136 additions and 34 deletions

View File

@@ -18,22 +18,8 @@ namespace Content.Shared.Clothing
protected void OnChanged()
{
EntitySystem.Get<SharedActionsSystem>().SetToggled(ToggleAction, On);
// inventory system will automatically hook into the event raised by this and update accordingly
if (Owner.TryGetContainer(out var container))
{
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(container.Owner);
}
EntitySystem.Get<ClothingSpeedModifierSystem>().SetClothingSpeedModifierEnabled(Owner, On);
}
[DataField("walkMoveCoeffecient", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
public float WalkMoveCoeffecient = 0.85f;
[DataField("sprintMoveCoeffecient", required: true)]
[ViewVariables(VVAccess.ReadWrite)]
public float SprintMoveCoeffecient = 0.65f;
public float WalkSpeedModifier => On ? WalkMoveCoeffecient : 1;
public float SprintSpeedModifier => On ? SprintMoveCoeffecient : 1;
[Serializable, NetSerializable]
public sealed class MagbootsComponentState : ComponentState