using Content.Server.StationEvents.Components; using Content.Shared.AlertLevel; using Content.Shared.GameTicking.Components; namespace Content.Server.StationEvents.Events; public sealed partial class AlertLevelInterceptionRule : StationEventSystem { [Dependency] private AlertLevelSystem _alertLevel = default!; protected override void Started(EntityUid uid, AlertLevelInterceptionRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args) { base.Started(uid, component, gameRule, args); if (!Station.TryGetRandomStation(out var chosenStation)) return; if (!_alertLevel.TryGetLevel(chosenStation.Value.Owner, out var level) || !_alertLevel.TryGetDefaultLevel(chosenStation.Value.Owner, out var defaultLevel) || level != defaultLevel) return; _alertLevel.SetLevel(chosenStation.Value.Owner, component.AlertLevel, force: true); } }