RadioJammerComponent.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using Robust.Shared.Serialization;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Radio.Components;
  4. /// <summary>
  5. /// When activated (<see cref="ActiveRadioJammerComponent"/>) prevents from sending messages in range
  6. /// Suit sensors will also stop working.
  7. /// </summary>
  8. [NetworkedComponent, RegisterComponent]
  9. [AutoGenerateComponentState]
  10. public sealed partial class RadioJammerComponent : Component
  11. {
  12. [DataDefinition]
  13. public partial struct RadioJamSetting
  14. {
  15. /// <summary>
  16. /// Power usage per second when enabled.
  17. /// </summary>
  18. [DataField(required: true)]
  19. public float Wattage;
  20. /// <summary>
  21. /// Range of the jammer.
  22. /// </summary>
  23. [DataField(required: true)]
  24. public float Range;
  25. /// <summary>
  26. /// The message that is displayed when switched.
  27. /// to this setting.
  28. /// </summary>
  29. [DataField(required: true)]
  30. public LocId Message = string.Empty;
  31. /// <summary>
  32. /// Name of the setting.
  33. /// </summary>
  34. [DataField(required: true)]
  35. public LocId Name = string.Empty;
  36. }
  37. /// <summary>
  38. /// List of all the settings for the radio jammer.
  39. /// </summary>
  40. [DataField(required: true), ViewVariables(VVAccess.ReadOnly)]
  41. public RadioJamSetting[] Settings;
  42. /// <summary>
  43. /// Index of the currently selected setting.
  44. /// </summary>
  45. [DataField]
  46. [AutoNetworkedField]
  47. public int SelectedPowerLevel = 1;
  48. }
  49. [Serializable, NetSerializable]
  50. public enum RadioJammerChargeLevel : byte
  51. {
  52. Low,
  53. Medium,
  54. High
  55. }
  56. [Serializable, NetSerializable]
  57. public enum RadioJammerLayers : byte
  58. {
  59. LED
  60. }
  61. [Serializable, NetSerializable]
  62. public enum RadioJammerVisuals : byte
  63. {
  64. ChargeLevel,
  65. LEDOn
  66. }