SolarFlareRuleComponent.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using Content.Server.StationEvents.Events;
  2. using Content.Shared.Radio;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
  5. namespace Content.Server.StationEvents.Components;
  6. /// <summary>
  7. /// Solar Flare event specific configuration
  8. /// </summary>
  9. [RegisterComponent, Access(typeof(SolarFlareRule))]
  10. public sealed partial class SolarFlareRuleComponent : Component
  11. {
  12. /// <summary>
  13. /// If true, only headsets affected, but e.g. handheld radio will still work
  14. /// </summary>
  15. [DataField("onlyJamHeadsets")]
  16. public bool OnlyJamHeadsets;
  17. /// <summary>
  18. /// Channels that will be disabled for a duration of event
  19. /// </summary>
  20. [DataField("affectedChannels", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<RadioChannelPrototype>))]
  21. public HashSet<string> AffectedChannels = new();
  22. /// <summary>
  23. /// List of extra channels that can be random disabled on top of the starting channels.
  24. /// </summary>
  25. /// <remarks>
  26. /// Channels are not removed from this, so its possible to roll the same channel multiple times.
  27. /// </remarks>
  28. [DataField("extraChannels", customTypeSerializer: typeof(PrototypeIdListSerializer<RadioChannelPrototype>))]
  29. public List<String> ExtraChannels = new();
  30. /// <summary>
  31. /// Number of times to roll a channel from ExtraChannels.
  32. /// </summary>
  33. /// <remarks>
  34. /// Channels are not removed from it, so its possible to roll the same channel multiple times.
  35. /// </remarks>
  36. [DataField("extraCount")]
  37. public uint ExtraCount;
  38. /// <summary>
  39. /// Chance light bulb breaks per second during event
  40. /// </summary>
  41. [DataField("lightBreakChancePerSecond")]
  42. public float LightBreakChancePerSecond;
  43. /// <summary>
  44. /// Chance door toggles per second during event
  45. /// </summary>
  46. [DataField("doorToggleChancePerSecond")]
  47. public float DoorToggleChancePerSecond;
  48. }