NukeopsRuleComponent.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. using Content.Server.RoundEnd;
  2. using Content.Shared.Dataset;
  3. using Content.Shared.NPC.Prototypes;
  4. using Content.Shared.Roles;
  5. using Robust.Shared.Audio;
  6. using Robust.Shared.Prototypes;
  7. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  8. namespace Content.Server.GameTicking.Rules.Components;
  9. [RegisterComponent, Access(typeof(NukeopsRuleSystem))]
  10. public sealed partial class NukeopsRuleComponent : Component
  11. {
  12. /// <summary>
  13. /// What will happen if all of the nuclear operatives will die. Used by LoneOpsSpawn event.
  14. /// </summary>
  15. [DataField]
  16. public RoundEndBehavior RoundEndBehavior = RoundEndBehavior.ShuttleCall;
  17. /// <summary>
  18. /// Text for shuttle call if RoundEndBehavior is ShuttleCall.
  19. /// </summary>
  20. [DataField]
  21. public string RoundEndTextSender = "comms-console-announcement-title-centcom";
  22. /// <summary>
  23. /// Text for shuttle call if RoundEndBehavior is ShuttleCall.
  24. /// </summary>
  25. [DataField]
  26. public string RoundEndTextShuttleCall = "nuke-ops-no-more-threat-announcement-shuttle-call";
  27. /// <summary>
  28. /// Text for announcement if RoundEndBehavior is ShuttleCall. Used if shuttle is already called
  29. /// </summary>
  30. [DataField]
  31. public string RoundEndTextAnnouncement = "nuke-ops-no-more-threat-announcement";
  32. /// <summary>
  33. /// Time to emergency shuttle to arrive if RoundEndBehavior is ShuttleCall.
  34. /// </summary>
  35. [DataField]
  36. public TimeSpan EvacShuttleTime = TimeSpan.FromMinutes(3);
  37. /// <summary>
  38. /// Whether or not nukie left their outpost
  39. /// </summary>
  40. [DataField]
  41. public bool LeftOutpost;
  42. /// <summary>
  43. /// Enables opportunity to get extra TC for war declaration
  44. /// </summary>
  45. [DataField]
  46. public bool CanEnableWarOps = true;
  47. /// <summary>
  48. /// Indicates time when war has been declared, null if not declared
  49. /// </summary>
  50. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  51. public TimeSpan? WarDeclaredTime;
  52. /// <summary>
  53. /// This amount of TC will be given to each nukie
  54. /// </summary>
  55. [DataField]
  56. public int WarTcAmountPerNukie = 40;
  57. /// <summary>
  58. /// Delay between war declaration and nuke ops arrival on station map. Gives crew time to prepare
  59. /// </summary>
  60. [DataField]
  61. public TimeSpan WarNukieArriveDelay = TimeSpan.FromMinutes(15);
  62. /// <summary>
  63. /// Time crew can't call emergency shuttle after war declaration.
  64. /// </summary>
  65. [DataField]
  66. public TimeSpan WarEvacShuttleDisabled = TimeSpan.FromMinutes(25);
  67. /// <summary>
  68. /// Minimal operatives count for war declaration
  69. /// </summary>
  70. [DataField]
  71. public int WarDeclarationMinOps = 4;
  72. [DataField]
  73. public WinType WinType = WinType.Neutral;
  74. [DataField]
  75. public List<WinCondition> WinConditions = new ();
  76. [DataField]
  77. public EntityUid? TargetStation;
  78. [DataField]
  79. public ProtoId<NpcFactionPrototype> Faction = "Syndicate";
  80. /// <summary>
  81. /// Path to antagonist alert sound.
  82. /// </summary>
  83. [DataField]
  84. public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/nukeops_start.ogg");
  85. }
  86. public enum WinType : byte
  87. {
  88. /// <summary>
  89. /// Operative major win. This means they nuked the station.
  90. /// </summary>
  91. OpsMajor,
  92. /// <summary>
  93. /// Minor win. All nukies were alive at the end of the round.
  94. /// Alternatively, some nukies were alive, but the disk was left behind.
  95. /// </summary>
  96. OpsMinor,
  97. /// <summary>
  98. /// Neutral win. The nuke exploded, but on the wrong station.
  99. /// </summary>
  100. Neutral,
  101. /// <summary>
  102. /// Crew minor win. The nuclear authentication disk escaped on the shuttle,
  103. /// but some nukies were alive.
  104. /// </summary>
  105. CrewMinor,
  106. /// <summary>
  107. /// Crew major win. This means they either killed all nukies,
  108. /// or the bomb exploded too far away from the station, or on the nukie moon.
  109. /// </summary>
  110. CrewMajor
  111. }
  112. public enum WinCondition : byte
  113. {
  114. NukeExplodedOnCorrectStation,
  115. NukeExplodedOnNukieOutpost,
  116. NukeExplodedOnIncorrectLocation,
  117. NukeActiveInStation,
  118. NukeActiveAtCentCom,
  119. NukeDiskOnCentCom,
  120. NukeDiskNotOnCentCom,
  121. NukiesAbandoned,
  122. AllNukiesDead,
  123. SomeNukiesAlive,
  124. AllNukiesAlive
  125. }