/// Amount of time in seconds it takes to bypass
/// </summary>
[DataField]
- public TimeSpan BypassDelay = TimeSpan.FromSeconds(5f);
+ public TimeSpan BypassDelay = TimeSpan.FromSeconds(4f);
+
+ /// <summary>
+ /// Whether the wirepanel should be opened as well, if one exists.
+ /// </summary>
+ [DataField]
+ public bool OpenWiresPanel = false;
}
using Content.Shared.Tools;
using Content.Shared.Tools.Systems;
using Content.Shared.Verbs;
+using Content.Shared.Wires;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly LockSystem _lock = default!;
[Dependency] private readonly SharedToolSystem _tool = default!;
+ [Dependency] private readonly SharedWiresSystem _wires = default!;
public override void Initialize()
{
{
if (target.Owner == args.User)
return;
-
+
if (!_tool.HasQuality(args.Used, target.Comp.BypassingTool)
|| !_lock.IsLocked(target.Owner))
return;
return;
_lock.Unlock(target, args.User, target.Comp);
+
+ if (TryComp<WiresPanelComponent>(target, out var wiresPanel) &&
+ TryComp<BypassLockComponent>(target, out var bypassLock) && bypassLock.OpenWiresPanel)
+ _wires.TogglePanel(target, wiresPanel, true, args.User);
+
}
private void OnGetVerb(Entity<BypassLockComponent> target, ref GetVerbsEvent<InteractionVerb> args)