]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Sleeper agents event no longer occurs when evacuation is called (#30646)
authorKillerqu00 <47712032+Killerqu00@users.noreply.github.com>
Mon, 5 Aug 2024 03:17:53 +0000 (05:17 +0200)
committerGitHub <noreply@github.com>
Mon, 5 Aug 2024 03:17:53 +0000 (13:17 +1000)
no more evac sleeper agents

Content.Server/StationEvents/Components/StationEventComponent.cs
Content.Server/StationEvents/EventManagerSystem.cs
Resources/Prototypes/GameRules/events.yml

index fdd1d3962e74487c2ce7ebc8d064b40ca35125ab..a188d5c052c99472fbfdb56c0c013c2637188165 100644 (file)
@@ -81,4 +81,10 @@ public sealed partial class StationEventComponent : Component
     [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
     [AutoPausedField]
     public TimeSpan? EndTime;
+
+    /// <summary>
+    /// If false, the event won't trigger during ongoing evacuation.
+    /// </summary>
+    [DataField]
+    public bool OccursDuringRoundEnd = true;
 }
index f2fdb8ff5a7ac587e99199ad99660b510f73daba..2e44040fcc8bf7b7b447aad399e5afcdf72f9ea5 100644 (file)
@@ -1,6 +1,7 @@
 using System.Linq;
 using Content.Server.Chat.Managers;
 using Content.Server.GameTicking;
+using Content.Server.RoundEnd;
 using Content.Server.StationEvents.Components;
 using Content.Shared.CCVar;
 using Robust.Server.Player;
@@ -18,6 +19,7 @@ public sealed class EventManagerSystem : EntitySystem
     [Dependency] private readonly IPrototypeManager _prototype = default!;
     [Dependency] private readonly IChatManager _chat = default!;
     [Dependency] public readonly GameTicker GameTicker = default!;
+    [Dependency] private readonly RoundEndSystem _roundEnd = default!;
 
     public bool EventsEnabled { get; private set; }
     private void SetEnabled(bool value) => EventsEnabled = value;
@@ -191,6 +193,11 @@ public sealed class EventManagerSystem : EntitySystem
             return false;
         }
 
+        if (_roundEnd.IsRoundEndRequested() && !stationEvent.OccursDuringRoundEnd)
+        {
+            return false;
+        }
+
         return true;
     }
 }
index 73b2920ca7e80031a0ce77b4c7079da835af3525..01a9f0025728ccd81b7fb988b3d6ee6ea2b5dc19 100644 (file)
     startAudio:
       path: /Audio/Announcements/intercept.ogg
     duration: null # the rule has to last the whole round not 1 second
+    occursDuringRoundEnd: false
   - type: AlertLevelInterceptionRule
   - type: AntagSelection
     definitions: