ClimbingComponent.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Numerics;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  4. namespace Content.Shared.Climbing.Components;
  5. /// <summary>
  6. /// Indicates that this entity is able to be placed on top of surfaces like tables.
  7. /// Does not by itself allow the entity to carry out the action of climbing, unless
  8. /// <see cref="CanClimb"/> is true. Use <see cref="CanForceClimb"/> to control whether
  9. /// the entity can force other entities onto surfaces.
  10. /// </summary>
  11. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
  12. public sealed partial class ClimbingComponent : Component
  13. {
  14. /// <summary>
  15. /// Whether the owner is able to climb onto things by their own action.
  16. /// </summary>
  17. [DataField, AutoNetworkedField]
  18. public bool CanClimb = true;
  19. /// <summary>
  20. /// Whether the owner is climbing on a climbable entity.
  21. /// </summary>
  22. [AutoNetworkedField, DataField]
  23. public bool IsClimbing;
  24. /// <summary>
  25. /// Whether the owner is being moved onto the climbed entity.
  26. /// </summary>
  27. [AutoNetworkedField, DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  28. [AutoPausedField]
  29. public TimeSpan? NextTransition;
  30. /// <summary>
  31. /// Direction to move when transition.
  32. /// </summary>
  33. [AutoNetworkedField, DataField]
  34. public Vector2 Direction;
  35. /// <summary>
  36. /// How fast the entity is moved when climbing.
  37. /// </summary>
  38. [DataField]
  39. public float TransitionRate = 5f;
  40. [AutoNetworkedField, DataField]
  41. public Dictionary<string, int> DisabledFixtureMasks = new();
  42. }