From 43ae68d795b9545914d1d217ebcef2bf2d5a87d0 Mon Sep 17 00:00:00 2001 From: Vigers Ray Date: Wed, 30 Oct 2024 18:09:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=AD=D0=BF=D1=81=D0=B8=D0=BB=D0=BE=D0=BD=20-?= =?UTF-8?q?=20=D0=BA=D0=BE=D0=BD=D0=B5=D1=87=D0=BD=D0=B0=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/AlertLevel/AlertLevelPrototype.cs | 4 ++++ Content.Server/AlertLevel/AlertLevelSystem.cs | 9 +++++++++ Resources/Prototypes/AlertLevels/alert_levels.yml | 1 + 3 files changed, 14 insertions(+) diff --git a/Content.Server/AlertLevel/AlertLevelPrototype.cs b/Content.Server/AlertLevel/AlertLevelPrototype.cs index c6740c16cc..91b3c5a346 100644 --- a/Content.Server/AlertLevel/AlertLevelPrototype.cs +++ b/Content.Server/AlertLevel/AlertLevelPrototype.cs @@ -71,5 +71,9 @@ public sealed partial class AlertLevelDetail /// How long it takes for the shuttle to arrive when called. /// [DataField("shuttleTime")] public TimeSpan ShuttleTime { get; private set; } = TimeSpan.FromMinutes(5); + + // Sunrise-Start + [DataField("forceEndRound")] public bool ForceEndRound { get; private set; } = false; + // Sunrise-End } diff --git a/Content.Server/AlertLevel/AlertLevelSystem.cs b/Content.Server/AlertLevel/AlertLevelSystem.cs index 613062fb10..da78ec9860 100644 --- a/Content.Server/AlertLevel/AlertLevelSystem.cs +++ b/Content.Server/AlertLevel/AlertLevelSystem.cs @@ -1,5 +1,6 @@ using System.Linq; using Content.Server.Chat.Systems; +using Content.Server.RoundEnd; using Content.Server.Station.Systems; using Content.Shared.CCVar; using Robust.Shared.Audio; @@ -16,6 +17,7 @@ public sealed class AlertLevelSystem : EntitySystem [Dependency] private readonly ChatSystem _chatSystem = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly StationSystem _stationSystem = default!; + [Dependency] private readonly RoundEndSystem _roundEnd = default!; // Until stations are a prototype, this is how it's going to have to be. public const string DefaultAlertLevelSet = "stationAlerts"; @@ -189,6 +191,13 @@ public sealed class AlertLevelSystem : EntitySystem sender: stationName); } + // Sunrise-Start + if (detail.ForceEndRound) + { + _roundEnd.EndRound(); + } + // Sunrise-End + RaiseLocalEvent(new AlertLevelChangedEvent(station, level)); } } diff --git a/Resources/Prototypes/AlertLevels/alert_levels.yml b/Resources/Prototypes/AlertLevels/alert_levels.yml index 15f73078b2..5542b14ac0 100644 --- a/Resources/Prototypes/AlertLevels/alert_levels.yml +++ b/Resources/Prototypes/AlertLevels/alert_levels.yml @@ -70,3 +70,4 @@ emergencyLightColor: DarkViolet forceEnableEmergencyLights: true shuttleTime: 1200 + forceEndRound: true # Sunrise_Edit