Change the syndicate charge to start a timer on signal (#32423)

* Change the syndicate charge to start a timer on signal

* Actually add the component in question

* Add default link for TimerStart signal
This commit is contained in:
Saphire Lattice
2024-10-04 15:34:48 +06:00
committed by GitHub
parent fbb6f17add
commit 94c8018ff3
6 changed files with 46 additions and 8 deletions

View File

@@ -11,6 +11,9 @@ namespace Content.Server.Explosion.EntitySystems
{
SubscribeLocalEvent<TriggerOnSignalComponent,SignalReceivedEvent>(OnSignalReceived);
SubscribeLocalEvent<TriggerOnSignalComponent,ComponentInit>(OnInit);
SubscribeLocalEvent<TimerStartOnSignalComponent,SignalReceivedEvent>(OnTimerSignalReceived);
SubscribeLocalEvent<TimerStartOnSignalComponent,ComponentInit>(OnTimerSignalInit);
}
private void OnSignalReceived(EntityUid uid, TriggerOnSignalComponent component, ref SignalReceivedEvent args)
@@ -24,5 +27,17 @@ namespace Content.Server.Explosion.EntitySystems
{
_signalSystem.EnsureSinkPorts(uid, component.Port);
}
private void OnTimerSignalReceived(EntityUid uid, TimerStartOnSignalComponent component, ref SignalReceivedEvent args)
{
if (args.Port != component.Port)
return;
StartTimer(uid, args.Trigger);
}
private void OnTimerSignalInit(EntityUid uid, TimerStartOnSignalComponent component, ComponentInit args)
{
_signalSystem.EnsureSinkPorts(uid, component.Port);
}
}
}