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

@@ -0,0 +1,36 @@
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Clothing;
[RegisterComponent, NetworkedComponent, Friend(typeof(ClothingSpeedModifierSystem))]
public sealed class ClothingSpeedModifierComponent : Component
{
[DataField("walkModifier", required: true)] [ViewVariables(VVAccess.ReadWrite)]
public float WalkModifier = 1.0f;
[DataField("sprintModifier", required: true)] [ViewVariables(VVAccess.ReadWrite)]
public float SprintModifier = 1.0f;
/// <summary>
/// Is this clothing item currently 'actively' slowing you down?
/// e.g. magboots can be turned on and off.
/// </summary>
[DataField("enabled")] public bool Enabled = true;
}
[Serializable, NetSerializable]
public sealed class ClothingSpeedModifierComponentState : ComponentState
{
public float WalkModifier;
public float SprintModifier;
public bool Enabled;
public ClothingSpeedModifierComponentState(float walkModifier, float sprintModifier, bool enabled)
{
WalkModifier = walkModifier;
SprintModifier = sprintModifier;
Enabled = enabled;
}
}