Sleeper agents event no longer occurs when evacuation is called (#30646)

no more evac sleeper agents
This commit is contained in:
Killerqu00
2024-08-05 05:17:53 +02:00
committed by GitHub
parent c5b887fb4e
commit 6503cb7833
3 changed files with 14 additions and 0 deletions

View File

@@ -81,4 +81,10 @@ public sealed partial class StationEventComponent : Component
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField] [AutoPausedField]
public TimeSpan? EndTime; public TimeSpan? EndTime;
/// <summary>
/// If false, the event won't trigger during ongoing evacuation.
/// </summary>
[DataField]
public bool OccursDuringRoundEnd = true;
} }

View File

@@ -1,6 +1,7 @@
using System.Linq; using System.Linq;
using Content.Server.Chat.Managers; using Content.Server.Chat.Managers;
using Content.Server.GameTicking; using Content.Server.GameTicking;
using Content.Server.RoundEnd;
using Content.Server.StationEvents.Components; using Content.Server.StationEvents.Components;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Robust.Server.Player; using Robust.Server.Player;
@@ -18,6 +19,7 @@ public sealed class EventManagerSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IChatManager _chat = default!; [Dependency] private readonly IChatManager _chat = default!;
[Dependency] public readonly GameTicker GameTicker = default!; [Dependency] public readonly GameTicker GameTicker = default!;
[Dependency] private readonly RoundEndSystem _roundEnd = default!;
public bool EventsEnabled { get; private set; } public bool EventsEnabled { get; private set; }
private void SetEnabled(bool value) => EventsEnabled = value; private void SetEnabled(bool value) => EventsEnabled = value;
@@ -191,6 +193,11 @@ public sealed class EventManagerSystem : EntitySystem
return false; return false;
} }
if (_roundEnd.IsRoundEndRequested() && !stationEvent.OccursDuringRoundEnd)
{
return false;
}
return true; return true;
} }
} }

View File

@@ -496,6 +496,7 @@
startAudio: startAudio:
path: /Audio/Announcements/intercept.ogg path: /Audio/Announcements/intercept.ogg
duration: null # the rule has to last the whole round not 1 second duration: null # the rule has to last the whole round not 1 second
occursDuringRoundEnd: false
- type: AlertLevelInterceptionRule - type: AlertLevelInterceptionRule
- type: AntagSelection - type: AntagSelection
definitions: definitions: