PullableComponent.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using Content.Shared.Alert;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Shared.Movement.Pulling.Components;
  5. /// <summary>
  6. /// Specifies an entity as being pullable by an entity with <see cref="PullerComponent"/>
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  9. [Access(typeof(Systems.PullingSystem))]
  10. public sealed partial class PullableComponent : Component
  11. {
  12. /// <summary>
  13. /// The current entity pulling this component.
  14. /// </summary>
  15. [AutoNetworkedField, DataField]
  16. public EntityUid? Puller;
  17. /// <summary>
  18. /// The pull joint.
  19. /// </summary>
  20. [AutoNetworkedField, DataField]
  21. public string? PullJointId;
  22. public bool BeingPulled => Puller != null;
  23. /// <summary>
  24. /// If the physics component has FixedRotation should we keep it upon being pulled
  25. /// </summary>
  26. [Access(typeof(Systems.PullingSystem), Other = AccessPermissions.ReadExecute)]
  27. [ViewVariables(VVAccess.ReadWrite), DataField("fixedRotation")]
  28. public bool FixedRotationOnPull;
  29. /// <summary>
  30. /// What the pullable's fixedrotation was set to before being pulled.
  31. /// </summary>
  32. [Access(typeof(Systems.PullingSystem), Other = AccessPermissions.ReadExecute)]
  33. [AutoNetworkedField, DataField]
  34. public bool PrevFixedRotation;
  35. [DataField]
  36. public ProtoId<AlertPrototype> PulledAlert = "Pulled";
  37. }
  38. public sealed partial class StopBeingPulledAlertEvent : BaseAlertEvent;