mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
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:
parent
fbb6f17add
commit
94c8018ff3
6 changed files with 46 additions and 8 deletions
|
|
@ -0,0 +1,15 @@
|
|||
using Content.Shared.DeviceLinking;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Server.Explosion.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends a trigger when signal is received.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed partial class TimerStartOnSignalComponent : Component
|
||||
{
|
||||
[DataField("port", customTypeSerializer: typeof(PrototypeIdSerializer<SinkPortPrototype>))]
|
||||
public string Port = "Timer";
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ signal-port-description-doorbolt = Bolts door when HIGH.
|
|||
signal-port-name-trigger = Trigger
|
||||
signal-port-description-trigger = Triggers some mechanism on the device.
|
||||
|
||||
signal-port-name-timer = Timer
|
||||
signal-port-description-timer = Starts the timer countdown of the device.
|
||||
|
||||
signal-port-name-order-sender = Order sender
|
||||
signal-port-description-order-sender = Cargo console order sender
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,11 @@
|
|||
name: signal-port-name-trigger
|
||||
description: signal-port-description-trigger
|
||||
|
||||
- type: sinkPort
|
||||
id: Timer
|
||||
name: signal-port-name-timer
|
||||
description: signal-port-description-timer
|
||||
|
||||
- type: sinkPort
|
||||
id: OrderReceiver
|
||||
name: signal-port-name-order-receiver
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
id: Pressed
|
||||
name: signal-port-name-pressed
|
||||
description: signal-port-description-pressed
|
||||
defaultLinks: [ Toggle, Trigger ]
|
||||
defaultLinks: [ Toggle, Trigger, Timer ]
|
||||
|
||||
- type: sourcePort
|
||||
id: On
|
||||
name: signal-port-name-on-transmitter
|
||||
description: signal-port-description-on-transmitter
|
||||
defaultLinks: [ On, Open, Forward, Trigger ]
|
||||
defaultLinks: [ On, Open, Forward, Trigger, Timer ]
|
||||
|
||||
- type: sourcePort
|
||||
id: Off
|
||||
|
|
@ -25,13 +25,13 @@
|
|||
id: Left
|
||||
name: signal-port-name-left
|
||||
description: signal-port-description-left
|
||||
defaultLinks: [ On, Open, Forward, Trigger ]
|
||||
defaultLinks: [ On, Open, Forward, Trigger, Timer ]
|
||||
|
||||
- type: sourcePort
|
||||
id: Right
|
||||
name: signal-port-name-right
|
||||
description: signal-port-description-right
|
||||
defaultLinks: [ On, Open, Reverse, Trigger ]
|
||||
defaultLinks: [ On, Open, Reverse, Trigger, Timer ]
|
||||
|
||||
- type: sourcePort
|
||||
id: Middle
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
id: Timer
|
||||
name: signal-port-name-timer-trigger
|
||||
description: signal-port-description-timer-trigger
|
||||
defaultLinks: [ AutoClose, On, Open, Forward, Trigger ]
|
||||
defaultLinks: [ AutoClose, On, Open, Forward, Trigger, Timer ]
|
||||
|
||||
- type: sourcePort
|
||||
id: Start
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
id: OutputHigh
|
||||
name: signal-port-name-logic-output-high
|
||||
description: signal-port-description-logic-output-high
|
||||
defaultLinks: [ On, Open, Forward, Trigger ]
|
||||
defaultLinks: [ On, Open, Forward, Trigger, Timer ]
|
||||
|
||||
- type: sourcePort
|
||||
id: OutputLow
|
||||
|
|
|
|||
|
|
@ -54,10 +54,10 @@
|
|||
beepSound: /Audio/Machines/Nuke/general_beep.ogg
|
||||
startOnStick: true
|
||||
canToggleStartOnStick: true
|
||||
- type: TriggerOnSignal
|
||||
- type: TimerStartOnSignal
|
||||
- type: DeviceLinkSink
|
||||
ports:
|
||||
- Trigger
|
||||
- Timer
|
||||
- type: Explosive # Powerful explosion in a very small radius. Doesn't break underplating.
|
||||
explosionType: DemolitionCharge
|
||||
totalIntensity: 60
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue