39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Clothing;
|
|
|
|
/// <summary>
|
|
/// Modifies speed when worn and activated.
|
|
/// Supports <c>ItemToggleComponent</c>.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, Access(typeof(ClothingSpeedModifierSystem))]
|
|
public sealed partial class ClothingSpeedModifierComponent : Component
|
|
{
|
|
[DataField]
|
|
public float WalkModifier = 1.0f;
|
|
|
|
[DataField]
|
|
public float SprintModifier = 1.0f;
|
|
|
|
/// <summary>
|
|
/// An optional required standing state.
|
|
/// Set to true if you need to be standing, false if you need to not be standing, null if you don't care.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool? Standing;
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public sealed class ClothingSpeedModifierComponentState : ComponentState
|
|
{
|
|
public float WalkModifier;
|
|
public float SprintModifier;
|
|
|
|
public ClothingSpeedModifierComponentState(float walkModifier, float sprintModifier)
|
|
{
|
|
WalkModifier = walkModifier;
|
|
SprintModifier = sprintModifier;
|
|
}
|
|
}
|