Emags (#6738)
This commit is contained in:
@@ -5,11 +5,13 @@ using Content.Server.Construction;
|
||||
using Content.Server.Construction.Components;
|
||||
using Content.Server.Tools;
|
||||
using Content.Server.Tools.Components;
|
||||
using Content.Server.Doors.Components;
|
||||
using Content.Shared.Access.Components;
|
||||
using Content.Shared.Access.Systems;
|
||||
using Content.Shared.Doors;
|
||||
using Content.Shared.Doors.Components;
|
||||
using Content.Shared.Doors.Systems;
|
||||
using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.Audio;
|
||||
@@ -39,6 +41,7 @@ public sealed class DoorSystem : SharedDoorSystem
|
||||
SubscribeLocalEvent<DoorComponent, PryCancelledEvent>(OnPryCancelled);
|
||||
SubscribeLocalEvent<DoorComponent, WeldFinishedEvent>(OnWeldFinished);
|
||||
SubscribeLocalEvent<DoorComponent, WeldCancelledEvent>(OnWeldCancelled);
|
||||
SubscribeLocalEvent<DoorComponent, GotEmaggedEvent>(OnEmagged);
|
||||
}
|
||||
|
||||
protected override void OnInit(EntityUid uid, DoorComponent door, ComponentInit args)
|
||||
@@ -303,6 +306,18 @@ public sealed class DoorSystem : SharedDoorSystem
|
||||
if(!container.Insert(board))
|
||||
Logger.Warning($"Couldn't insert board {ToPrettyString(board)} into door {ToPrettyString(uid)}!");
|
||||
}
|
||||
private void OnEmagged(EntityUid uid, DoorComponent door, GotEmaggedEvent args)
|
||||
{
|
||||
if(TryComp<AirlockComponent>(uid, out var airlockComponent))
|
||||
{
|
||||
if (door.State == DoorState.Closed)
|
||||
{
|
||||
StartOpening(uid);
|
||||
airlockComponent?.SetBoltsWithAudio(!airlockComponent.IsBolted());
|
||||
args.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class PryFinishedEvent : EntityEventArgs { }
|
||||
|
||||
Reference in New Issue
Block a user