Makes it so that all wires (except the bolt wire) have to be cut on airlocks/windoors (#11056)
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
using Content.Server.Wires;
|
using System.Linq;
|
||||||
|
using Content.Server.Wires;
|
||||||
using Content.Shared.Construction;
|
using Content.Shared.Construction;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
|
using Robust.Shared.Reflection;
|
||||||
|
|
||||||
namespace Content.Server.Construction.Conditions
|
namespace Content.Server.Construction.Conditions
|
||||||
{
|
{
|
||||||
@@ -15,13 +17,22 @@ namespace Content.Server.Construction.Conditions
|
|||||||
{
|
{
|
||||||
[DataField("value")] public bool Value { get; private set; } = true;
|
[DataField("value")] public bool Value { get; private set; } = true;
|
||||||
|
|
||||||
|
[DataField("ignoreTypes")] public HashSet<IWireAction> IgnoreTypes { get; } = new();
|
||||||
|
|
||||||
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
public bool Condition(EntityUid uid, IEntityManager entityManager)
|
||||||
{
|
{
|
||||||
if (!entityManager.TryGetComponent(uid, out WiresComponent? wires))
|
if (!entityManager.TryGetComponent(uid, out WiresComponent? wires))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
var ignoreTypes = IgnoreTypes.Select(t => t.GetType()).ToHashSet();
|
||||||
|
|
||||||
foreach (var wire in wires.WiresList)
|
foreach (var wire in wires.WiresList)
|
||||||
{
|
{
|
||||||
|
if (ignoreTypes.Contains(wire.Action.GetType()))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
switch (Value)
|
switch (Value)
|
||||||
{
|
{
|
||||||
case true when !wire.IsCut:
|
case true when !wire.IsCut:
|
||||||
|
|||||||
@@ -90,6 +90,9 @@
|
|||||||
- !type:AirlockBolted
|
- !type:AirlockBolted
|
||||||
value: false
|
value: false
|
||||||
- !type:WirePanel {}
|
- !type:WirePanel {}
|
||||||
|
- !type:AllWiresCut
|
||||||
|
ignoreTypes:
|
||||||
|
- !type:DoorBoltWireAction
|
||||||
completed:
|
completed:
|
||||||
- !type:EmptyAllContainers {}
|
- !type:EmptyAllContainers {}
|
||||||
steps:
|
steps:
|
||||||
@@ -127,6 +130,9 @@
|
|||||||
- !type:AirlockBolted
|
- !type:AirlockBolted
|
||||||
value: false
|
value: false
|
||||||
- !type:WirePanel {}
|
- !type:WirePanel {}
|
||||||
|
- !type:AllWiresCut
|
||||||
|
ignoreTypes:
|
||||||
|
- !type:DoorBoltWireAction
|
||||||
completed:
|
completed:
|
||||||
- !type:SpawnPrototype
|
- !type:SpawnPrototype
|
||||||
prototype: SheetRGlass1
|
prototype: SheetRGlass1
|
||||||
|
|||||||
@@ -112,6 +112,9 @@
|
|||||||
- !type:AirlockBolted
|
- !type:AirlockBolted
|
||||||
value: false
|
value: false
|
||||||
- !type:WirePanel {}
|
- !type:WirePanel {}
|
||||||
|
- !type:AllWiresCut
|
||||||
|
ignoreTypes:
|
||||||
|
- !type:DoorBoltWireAction
|
||||||
completed:
|
completed:
|
||||||
- !type:EmptyAllContainers {}
|
- !type:EmptyAllContainers {}
|
||||||
steps:
|
steps:
|
||||||
@@ -212,6 +215,9 @@
|
|||||||
- !type:WirePanel {}
|
- !type:WirePanel {}
|
||||||
- !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated
|
- !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated
|
||||||
container: board
|
container: board
|
||||||
|
- !type:AllWiresCut
|
||||||
|
ignoreTypes:
|
||||||
|
- !type:DoorBoltWireAction
|
||||||
completed:
|
completed:
|
||||||
- !type:EmptyAllContainers {}
|
- !type:EmptyAllContainers {}
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
Reference in New Issue
Block a user