BorgTransponderComponent.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  2. using Robust.Shared.Utility;
  3. namespace Content.Shared.Silicons.Borgs.Components;
  4. /// <summary>
  5. /// Periodically broadcasts borg data to robotics consoles.
  6. /// When not emagged, handles disabling and destroying commands as expected.
  7. /// </summary>
  8. [RegisterComponent, Access(typeof(SharedBorgSystem))]
  9. public sealed partial class BorgTransponderComponent : Component
  10. {
  11. /// <summary>
  12. /// Sprite of the chassis to send.
  13. /// </summary>
  14. [DataField(required: true)]
  15. public SpriteSpecifier? Sprite;
  16. /// <summary>
  17. /// Name of the chassis to send.
  18. /// </summary>
  19. [DataField(required: true)]
  20. public string Name = string.Empty;
  21. /// <summary>
  22. /// Popup shown to everyone after a borg is disabled.
  23. /// Gets passed a string "name".
  24. /// </summary>
  25. [DataField]
  26. public LocId DisabledPopup = "borg-transponder-disabled-popup";
  27. /// <summary>
  28. /// Popup shown to the borg when it is being disabled.
  29. /// </summary>
  30. [DataField]
  31. public LocId DisablingPopup = "borg-transponder-disabling-popup";
  32. /// <summary>
  33. /// Popup shown to everyone when a borg is being destroyed.
  34. /// Gets passed a string "name".
  35. /// </summary>
  36. [DataField]
  37. public LocId DestroyingPopup = "borg-transponder-destroying-popup";
  38. /// <summary>
  39. /// How long to wait between each broadcast.
  40. /// </summary>
  41. [DataField]
  42. public TimeSpan BroadcastDelay = TimeSpan.FromSeconds(5);
  43. /// <summary>
  44. /// When to next broadcast data.
  45. /// </summary>
  46. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  47. public TimeSpan NextBroadcast = TimeSpan.Zero;
  48. /// <summary>
  49. /// When to next disable the borg.
  50. /// </summary>
  51. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  52. public TimeSpan? NextDisable;
  53. /// <summary>
  54. /// How long to wait to disable the borg after RD has ordered it.
  55. /// </summary>
  56. [DataField]
  57. public TimeSpan DisableDelay = TimeSpan.FromSeconds(5);
  58. /// <summary>
  59. /// Pretend that the borg cannot be disabled due to being on delay.
  60. /// </summary>
  61. [DataField]
  62. public bool FakeDisabling;
  63. /// <summary>
  64. /// Pretend that the borg has no brain inserted.
  65. /// </summary>
  66. [DataField]
  67. public bool FakeDisabled;
  68. }