Files
tbd-station-14/Content.Shared/Item/HeldSpeedModifierComponent.cs
Nemanja fb10dff335 Mirror speed penalty for worn duffels and hardsuits when in-hand (#22168)
* Add speed penalty for holding hardsuits and duffels

* just inherit from ClothingSpeedModifier

* comment godo
2023-12-06 20:41:29 -07:00

35 lines
1.2 KiB
C#

using Content.Shared.Clothing;
using Robust.Shared.GameStates;
namespace Content.Shared.Item;
/// <summary>
/// This is used for items that change your speed when they are held.
/// </summary>
/// <remarks>
/// This is separate from <see cref="ClothingSpeedModifierComponent"/> because things like boots increase/decrease speed when worn, but
/// shouldn't do that when just held in hand.
/// </remarks>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(HeldSpeedModifierSystem))]
public sealed partial class HeldSpeedModifierComponent : Component
{
/// <summary>
/// A multiplier applied to the walk speed.
/// </summary>
[DataField] [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public float WalkModifier = 1.0f;
/// <summary>
/// A multiplier applied to the sprint speed.
/// </summary>
[DataField] [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public float SprintModifier = 1.0f;
/// <summary>
/// If true, values from <see cref="ClothingSpeedModifierComponent"/> will attempted to be used before the ones in this component.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public bool MirrorClothingModifier = true;
}