Skip to content

Commit

Permalink
+ Cloning Pod, Fire Alarm
Browse files Browse the repository at this point in the history
  • Loading branch information
ScarKy0 committed Jan 27, 2025
1 parent 20a0e83 commit 9d28644
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
26 changes: 10 additions & 16 deletions Content.Server/Atmos/Monitor/Systems/FireAlarmSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public override void Initialize()
{
SubscribeLocalEvent<FireAlarmComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<FireAlarmComponent, DeviceListUpdateEvent>(OnDeviceListSync);
SubscribeLocalEvent<FireAlarmComponent, OnAttemptEmagEvent>(OnAttemptEmag);
SubscribeLocalEvent<FireAlarmComponent, GotEmaggedEvent>(OnEmagged);
}

Expand Down Expand Up @@ -77,25 +76,20 @@ private void OnInteractHand(EntityUid uid, FireAlarmComponent component, Interac
}
}

private void OnAttemptEmag(EntityUid uid, FireAlarmComponent component, ref OnAttemptEmagEvent args)
private void OnEmagged(EntityUid uid, FireAlarmComponent component, ref GotEmaggedEvent args)
{
if (args.Type != EmagType.Interaction)
{
args.Handled = true;
if (!_emag.CompareFlag(args.Type, EmagType.Interaction))
return;
}

if (_emag.CheckFlag(uid, EmagType.Interaction))
args.Handled = true;
}
return;

private void OnEmagged(EntityUid uid, FireAlarmComponent component, ref GotEmaggedEvent args)
{
if (TryComp<AtmosAlarmableComponent>(uid, out var alarmable))
{
// Remove the atmos alarmable component permanently from this device.
_atmosAlarmable.ForceAlert(uid, AtmosAlarmType.Emagged, alarmable);
RemCompDeferred<AtmosAlarmableComponent>(uid);
}
if (!TryComp<AtmosAlarmableComponent>(uid, out var alarmable))
return;

// Remove the atmos alarmable component permanently from this device.
_atmosAlarmable.ForceAlert(uid, AtmosAlarmType.Emagged, alarmable);
RemCompDeferred<AtmosAlarmableComponent>(uid);
args.Handled = true;
}
}
7 changes: 6 additions & 1 deletion Content.Server/Cloning/CloningSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ public override void Initialize()
SubscribeLocalEvent<CloningPodComponent, PortDisconnectedEvent>(OnPortDisconnected);
SubscribeLocalEvent<CloningPodComponent, AnchorStateChangedEvent>(OnAnchor);
SubscribeLocalEvent<CloningPodComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<CloningPodComponent, OnAttemptEmagEvent>(OnAttemptEmag);
SubscribeLocalEvent<CloningPodComponent, GotEmaggedEvent>(OnEmagged);
}

Expand Down Expand Up @@ -290,6 +289,12 @@ private void OnAttemptEmag(EntityUid uid, CloningPodComponent clonePod, ref OnAt
/// </summary>
private void OnEmagged(EntityUid uid, CloningPodComponent clonePod, ref GotEmaggedEvent args)
{
if (!_emag.CompareFlag(args.Type, EmagType.Interaction))
return;

if (_emag.CheckFlag(uid, EmagType.Interaction))
return;

if (!this.IsPowered(uid, EntityManager))
return;

Expand Down

0 comments on commit 9d28644

Please sign in to comment.