1
0

HeldSpeedModifierComponent.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Content.Shared.Clothing;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Item;
  4. /// <summary>
  5. /// This is used for items that change your speed when they are held.
  6. /// </summary>
  7. /// <remarks>
  8. /// This is separate from <see cref="ClothingSpeedModifierComponent"/> because things like boots increase/decrease speed when worn, but
  9. /// shouldn't do that when just held in hand.
  10. /// </remarks>
  11. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  12. [Access(typeof(HeldSpeedModifierSystem))]
  13. public sealed partial class HeldSpeedModifierComponent : Component
  14. {
  15. /// <summary>
  16. /// A multiplier applied to the walk speed.
  17. /// </summary>
  18. [DataField] [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  19. public float WalkModifier = 1.0f;
  20. /// <summary>
  21. /// A multiplier applied to the sprint speed.
  22. /// </summary>
  23. [DataField] [ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  24. public float SprintModifier = 1.0f;
  25. /// <summary>
  26. /// If true, values from <see cref="ClothingSpeedModifierComponent"/> will attempted to be used before the ones in this component.
  27. /// </summary>
  28. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  29. public bool MirrorClothingModifier = true;
  30. }