Makes it so that all wires (except the bolt wire) have to be cut on airlocks/windoors (#11056)

This commit is contained in:
Flipp Syder
2022-09-05 18:41:39 -07:00
committed by GitHub
parent 77784882e0
commit 8e54ec27f2
3 changed files with 25 additions and 2 deletions

View File

@@ -1,7 +1,9 @@
using Content.Server.Wires;
using System.Linq;
using Content.Server.Wires;
using Content.Shared.Construction;
using Content.Shared.Examine;
using JetBrains.Annotations;
using Robust.Shared.Reflection;
namespace Content.Server.Construction.Conditions
{
@@ -15,13 +17,22 @@ namespace Content.Server.Construction.Conditions
{
[DataField("value")] public bool Value { get; private set; } = true;
[DataField("ignoreTypes")] public HashSet<IWireAction> IgnoreTypes { get; } = new();
public bool Condition(EntityUid uid, IEntityManager entityManager)
{
if (!entityManager.TryGetComponent(uid, out WiresComponent? wires))
return true;
var ignoreTypes = IgnoreTypes.Select(t => t.GetType()).ToHashSet();
foreach (var wire in wires.WiresList)
{
if (ignoreTypes.Contains(wire.Action.GetType()))
{
continue;
}
switch (Value)
{
case true when !wire.IsCut:

View File

@@ -90,12 +90,15 @@
- !type:AirlockBolted
value: false
- !type:WirePanel {}
- !type:AllWiresCut
ignoreTypes:
- !type:DoorBoltWireAction
completed:
- !type:EmptyAllContainers {}
steps:
- tool: Prying
doAfter: 5
- node: glassElectronics
entity: AirlockAssembly
edges:
@@ -127,6 +130,9 @@
- !type:AirlockBolted
value: false
- !type:WirePanel {}
- !type:AllWiresCut
ignoreTypes:
- !type:DoorBoltWireAction
completed:
- !type:SpawnPrototype
prototype: SheetRGlass1

View File

@@ -112,6 +112,9 @@
- !type:AirlockBolted
value: false
- !type:WirePanel {}
- !type:AllWiresCut
ignoreTypes:
- !type:DoorBoltWireAction
completed:
- !type:EmptyAllContainers {}
steps:
@@ -212,6 +215,9 @@
- !type:WirePanel {}
- !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated
container: board
- !type:AllWiresCut
ignoreTypes:
- !type:DoorBoltWireAction
completed:
- !type:EmptyAllContainers {}
steps: