This commit is contained in:
Rane
2022-02-17 21:43:24 -05:00
committed by GitHub
parent 94c56980cb
commit 8049a709e6
29 changed files with 323 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ using Content.Server.Atmos.Monitor.Components;
using Content.Server.Power.Components;
using Content.Shared.Atmos.Monitor;
using Content.Shared.Interaction;
using Content.Shared.Emag.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -16,6 +17,7 @@ namespace Content.Server.Atmos.Monitor.Systems
public override void Initialize()
{
SubscribeLocalEvent<FireAlarmComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<FireAlarmComponent, GotEmaggedEvent>(OnEmagged);
}
private void OnInteractHand(EntityUid uid, FireAlarmComponent component, InteractHandEvent args)
@@ -38,5 +40,18 @@ namespace Content.Server.Atmos.Monitor.Systems
}
}
}
private void OnEmagged(EntityUid uid, FireAlarmComponent component, GotEmaggedEvent args)
{
if (TryComp<AtmosMonitorComponent>(uid, out var atmosMonitor))
{
if (atmosMonitor?.MonitorFire == true)
{
atmosMonitor.MonitorFire = false;
_monitorSystem.Alert(uid, AtmosMonitorAlarmType.Emagged);
args.Handled = true;
}
}
}
}
}