RaiseLocalEvent(new AlertLevelPrototypeReloadedEvent());
}
+ public string GetLevel(EntityUid station, AlertLevelComponent? alert = null)
+ {
+ if (!Resolve(station, ref alert))
+ {
+ return string.Empty;
+ }
+
+ return alert.CurrentLevel;
+ }
+
public float GetAlertLevelDelay(EntityUid station, AlertLevelComponent? alert = null)
{
if (!Resolve(station, ref alert))
--- /dev/null
+using Content.Server.StationEvents.Events;
+using Content.Server.AlertLevel;
+using Robust.Shared.Prototypes;
+
+namespace Content.Server.StationEvents.Components;
+
+[RegisterComponent, Access(typeof(AlertLevelInterceptionRule))]
+public sealed partial class AlertLevelInterceptionRuleComponent : Component
+{
+ /// <summary>
+ /// Alert level to set the station to when the event starts.
+ /// </summary>
+ [DataField]
+ public string AlertLevel = "blue";
+}
--- /dev/null
+using Content.Server.GameTicking.Components;
+using Content.Server.StationEvents.Components;
+using Content.Server.AlertLevel;
+
+namespace Content.Server.StationEvents.Events;
+
+public sealed class AlertLevelInterceptionRule : StationEventSystem<AlertLevelInterceptionRuleComponent>
+{
+ [Dependency] private readonly AlertLevelSystem _alertLevelSystem = default!;
+
+ protected override void Started(EntityUid uid, AlertLevelInterceptionRuleComponent component, GameRuleComponent gameRule,
+ GameRuleStartedEvent args)
+ {
+ base.Started(uid, component, gameRule, args);
+
+ if (!TryGetRandomStation(out var chosenStation))
+ return;
+ if (_alertLevelSystem.GetLevel(chosenStation.Value) != "green")
+ return;
+
+ _alertLevelSystem.SetLevel(chosenStation.Value, component.AlertLevel, true, true, true);
+ }
+}
\ No newline at end of file
license: "CC-BY-SA-3.0"
copyright: "Paradise, volume and pitch changed, merged with redalert.ogg"
source: "https://github.com/ParadiseSS13/Paradise/blob/07b26ee6b4a11a0607986d322ee007020569feae/sound/effects/siren.ogg"
+
+- files: ["intercept.ogg"]
+ license: "CC-BY-SA-3.0"
+ copyright: "Taken from tgstation"
+ source: "https://github.com/tgstation/tgstation/blob/95731342b97167d7883ff091d389f79c36442ee6/sound/ai/default/intercept.ogg"
--- /dev/null
+station-event-communication-interception = Attention! Enemy communication intercepted. Security level elevated.
- type: NukeopsRole
prototype: Nukeops
+- type: entity
+ id: SleeperAgentsRule
+ parent: BaseGameRule
+ noSpawn: true
+ components:
+ - type: StationEvent
+ earliestStart: 25
+ weight: 15
+ minimumPlayers: 15
+ reoccurrenceDelay: 60
+ startAnnouncement: station-event-communication-interception
+ startAudio:
+ path: /Audio/Announcements/intercept.ogg
+ - type: AlertLevelInterceptionRule
+ - type: TraitorRule
+ - type: AntagSelection
+ definitions:
+ - prefRoles: [ Traitor ]
+ min: 1
+ max: 2
+ playerRatio: 10
+ mindComponents:
+ - type: TraitorRole
+ prototype: Traitor
+
- type: entity
id: MassHallucinations
parent: BaseGameRule