Skip to content

Commit

Permalink
Sleeper agents event no longer occurs when evacuation is called (spac…
Browse files Browse the repository at this point in the history
…e-wizards#30646)

no more evac sleeper agents
  • Loading branch information
Killerqu00 authored and themias committed Aug 9, 2024
1 parent 48a26b1 commit 6013fb7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
7 changes: 7 additions & 0 deletions Content.Server/StationEvents/EventManagerSystem.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -191,6 +193,11 @@ private bool CanRun(EntityPrototype prototype, StationEventComponent stationEven
return false;
}

if (_roundEnd.IsRoundEndRequested() && !stationEvent.OccursDuringRoundEnd)
{
return false;
}

return true;
}
}
1 change: 1 addition & 0 deletions Resources/Prototypes/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@
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:
Expand Down

0 comments on commit 6013fb7

Please sign in to comment.