better solar flare (#19189)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -20,7 +20,18 @@ public sealed class SolarFlareRule : StationEventSystem<SolarFlareRuleComponent>
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<RadioReceiveAttemptEvent>(OnRadioSendAttempt);
|
||||
SubscribeLocalEvent<RadioReceiveAttemptEvent>(OnRadioReceiveAttempt);
|
||||
}
|
||||
|
||||
protected override void Started(EntityUid uid, SolarFlareRuleComponent comp, GameRuleComponent gameRule, GameRuleStartedEvent args)
|
||||
{
|
||||
base.Started(uid, comp, gameRule, args);
|
||||
|
||||
for (var i = 0; i < comp.ExtraCount; i++)
|
||||
{
|
||||
var channel = RobustRandom.Pick(comp.ExtraChannels);
|
||||
comp.AffectedChannels.Add(channel);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ActiveTick(EntityUid uid, SolarFlareRuleComponent component, GameRuleComponent gameRule, float frameTime)
|
||||
@@ -46,7 +57,7 @@ public sealed class SolarFlareRule : StationEventSystem<SolarFlareRuleComponent>
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRadioSendAttempt(ref RadioReceiveAttemptEvent args)
|
||||
private void OnRadioReceiveAttempt(ref RadioReceiveAttemptEvent args)
|
||||
{
|
||||
var query = EntityQueryEnumerator<SolarFlareRuleComponent, GameRuleComponent>();
|
||||
while (query.MoveNext(out var uid, out var flare, out var gameRule))
|
||||
|
||||
Reference in New Issue
Block a user