mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
@@ -21,5 +21,11 @@ public sealed partial class BypassLockComponent : Component
|
||||
/// 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;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using Content.Shared.Lock.BypassLock.Components;
|
||||
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;
|
||||
|
||||
@@ -16,6 +17,7 @@ public sealed partial class BypassLockSystem : EntitySystem
|
||||
[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()
|
||||
{
|
||||
@@ -32,7 +34,7 @@ public sealed partial class BypassLockSystem : EntitySystem
|
||||
{
|
||||
if (target.Owner == args.User)
|
||||
return;
|
||||
|
||||
|
||||
if (!_tool.HasQuality(args.Used, target.Comp.BypassingTool)
|
||||
|| !_lock.IsLocked(target.Owner))
|
||||
return;
|
||||
@@ -70,6 +72,11 @@ public sealed partial class BypassLockSystem : EntitySystem
|
||||
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)
|
||||
|
||||
@@ -247,6 +247,7 @@
|
||||
flatReductions:
|
||||
Heat: 10 # capable of touching light bulbs and stoves without feeling pain!
|
||||
- type: BypassLock
|
||||
openWiresPanel: true
|
||||
- type: BypassLockRequiresMobState
|
||||
requiredMobState:
|
||||
- Critical
|
||||
|
||||
Reference in New Issue
Block a user