1
0

EnsnareableComponent.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using Content.Shared.Alert;
  2. using Robust.Shared.Containers;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Prototypes;
  5. namespace Content.Shared.Ensnaring.Components;
  6. /// <summary>
  7. /// Use this on an entity that you would like to be ensnared by anything that has the <see cref="EnsnaringComponent"/>
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
  10. public sealed partial class EnsnareableComponent : Component
  11. {
  12. /// <summary>
  13. /// How much should this slow down the entities walk?
  14. /// </summary>
  15. [DataField, AutoNetworkedField]
  16. public float WalkSpeed = 1.0f;
  17. /// <summary>
  18. /// How much should this slow down the entities sprint?
  19. /// </summary>
  20. [DataField, AutoNetworkedField]
  21. public float SprintSpeed = 1.0f;
  22. /// <summary>
  23. /// Is this entity currently ensnared?
  24. /// </summary>
  25. [DataField, AutoNetworkedField]
  26. public bool IsEnsnared;
  27. /// <summary>
  28. /// The container where the <see cref="EnsnaringComponent"/> entity will be stored
  29. /// </summary>
  30. public Container Container = default!;
  31. [DataField]
  32. public string? Sprite;
  33. [DataField]
  34. public string? State;
  35. [DataField]
  36. public ProtoId<AlertPrototype> EnsnaredAlert = "Ensnared";
  37. }
  38. public sealed partial class RemoveEnsnareAlertEvent : BaseAlertEvent;
  39. public sealed class EnsnaredChangedEvent : EntityEventArgs
  40. {
  41. public readonly bool IsEnsnared;
  42. public EnsnaredChangedEvent(bool isEnsnared)
  43. {
  44. IsEnsnared = isEnsnared;
  45. }
  46. }