using Content.Server.Silicons.Laws; using Content.Server.StationEvents.Components; using Content.Shared.GameTicking.Components; using Content.Shared.Silicons.Laws.Components; using Content.Shared.Station.Components; namespace Content.Server.StationEvents.Events; public sealed class IonStormRule : StationEventSystem { [Dependency] private readonly IonStormSystem _ionStorm = default!; protected override void Started(EntityUid uid, IonStormRuleComponent comp, GameRuleComponent gameRule, GameRuleStartedEvent args) { base.Started(uid, comp, gameRule, args); if (!TryGetRandomStation(out var chosenStation)) return; var query = EntityQueryEnumerator(); while (query.MoveNext(out var ent, out var lawBound, out var xform, out var target)) { // only affect law holders on the station if (CompOrNull(xform.GridUid)?.Station != chosenStation) continue; _ionStorm.IonStormTarget((ent, lawBound, target)); } } }