diff --git a/Content.Client/Doors/AirlockComponent.cs b/Content.Client/Doors/AirlockComponent.cs index f7cac33727..d22994ab6e 100644 --- a/Content.Client/Doors/AirlockComponent.cs +++ b/Content.Client/Doors/AirlockComponent.cs @@ -1,5 +1,4 @@ using Content.Shared.Doors.Components; -using Robust.Shared.GameObjects; namespace Content.Client.Doors; diff --git a/Content.Server/Construction/Conditions/AllWiresCut.cs b/Content.Server/Construction/Conditions/AllWiresCut.cs index 5310f2c8db..065edd8c85 100644 --- a/Content.Server/Construction/Conditions/AllWiresCut.cs +++ b/Content.Server/Construction/Conditions/AllWiresCut.cs @@ -1,9 +1,7 @@ -using System.Linq; -using Content.Server.Wires; +using Content.Server.Wires; using Content.Shared.Construction; using Content.Shared.Examine; using JetBrains.Annotations; -using Robust.Shared.Reflection; namespace Content.Server.Construction.Conditions { @@ -17,22 +15,13 @@ namespace Content.Server.Construction.Conditions { [DataField("value")] public bool Value { get; private set; } = true; - [DataField("ignoreTypes")] public HashSet 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: @@ -46,6 +35,9 @@ namespace Content.Server.Construction.Conditions public bool DoExamine(ExaminedEvent args) { + if (Condition(args.Examined, IoCManager.Resolve())) + return false; + args.PushMarkup(Loc.GetString(Value ? "construction-examine-condition-all-wires-cut" : "construction-examine-condition-all-wires-intact")); diff --git a/Content.Server/Doors/Components/AirlockComponent.cs b/Content.Server/Doors/Components/AirlockComponent.cs index 0a21d3cf44..d1cc54a33e 100644 --- a/Content.Server/Doors/Components/AirlockComponent.cs +++ b/Content.Server/Doors/Components/AirlockComponent.cs @@ -112,6 +112,12 @@ namespace Content.Server.Doors.Components } } + /// + /// True if the bolt wire is cut, which will force the airlock to always be bolted as long as it has power. + /// + [ViewVariables] + public bool BoltWireCut; + /// /// Whether the airlock should auto close. This value is reset every time the airlock closes. /// diff --git a/Content.Server/Doors/Systems/AirlockSystem.cs b/Content.Server/Doors/Systems/AirlockSystem.cs index 376c72549d..46c4c9dc04 100644 --- a/Content.Server/Doors/Systems/AirlockSystem.cs +++ b/Content.Server/Doors/Systems/AirlockSystem.cs @@ -48,6 +48,8 @@ namespace Content.Server.Doors.Systems } else { + if (component.BoltWireCut) + component.SetBoltsWithAudio(true); UpdateAutoClose(uid, door: door); } diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index 5beae0323c..1b5db3a39e 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -2,7 +2,6 @@ using Content.Server.Access; using Content.Server.Atmos.Components; using Content.Server.Atmos.EntitySystems; using Content.Server.Construction; -using Content.Server.Construction.Components; using Content.Server.Doors.Components; using Content.Server.Tools; using Content.Server.Tools.Systems; @@ -271,7 +270,6 @@ public sealed class DoorSystem : SharedDoorSystem if (Tags.HasTag(otherUid, "DoorBumpOpener")) TryOpen(uid, door, otherUid); } - private void OnEmagged(EntityUid uid, DoorComponent door, GotEmaggedEvent args) { if(TryComp(uid, out var airlockComponent)) diff --git a/Content.Server/Doors/WireActions/DoorBoltWireAction.cs b/Content.Server/Doors/WireActions/DoorBoltWireAction.cs index ed746875d6..4ac6753c37 100644 --- a/Content.Server/Doors/WireActions/DoorBoltWireAction.cs +++ b/Content.Server/Doors/WireActions/DoorBoltWireAction.cs @@ -38,18 +38,19 @@ public sealed class DoorBoltWireAction : BaseWireAction { if (EntityManager.TryGetComponent(wire.Owner, out var door)) { - if (!door.BoltsDown) - { + door.BoltWireCut = true; + if (!door.BoltsDown && IsPowered(wire.Owner)) door.SetBoltsWithAudio(true); - } } return true; } - // does nothing public override bool Mend(EntityUid user, Wire wire) { + if (EntityManager.TryGetComponent(wire.Owner, out var door)) + door.BoltWireCut = false; + return true; } diff --git a/Content.Server/Remotes/DoorRemoteSystem.cs b/Content.Server/Remotes/DoorRemoteSystem.cs index 61a775be97..fee13fbf85 100644 --- a/Content.Server/Remotes/DoorRemoteSystem.cs +++ b/Content.Server/Remotes/DoorRemoteSystem.cs @@ -84,8 +84,8 @@ namespace Content.Server.Remotes _doorSystem.TryToggleDoor(doorComp.Owner, doorComp, args.Used); break; case OperatingMode.ToggleBolts: - //TODO: What about cut wires...? - airlockComp.SetBoltsWithAudio(!airlockComp.IsBolted()); + if (!airlockComp.BoltWireCut) + airlockComp.SetBoltsWithAudio(!airlockComp.IsBolted()); break; case OperatingMode.ToggleEmergencyAccess: _sharedAirlockSystem.ToggleEmergencyAccess(airlockComp); diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml index 6b9337f5ef..949006ba63 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml @@ -91,8 +91,6 @@ value: false - !type:WirePanel {} - !type:AllWiresCut - ignoreTypes: - - !type:DoorBoltWireAction completed: - !type:EmptyAllContainers {} steps: @@ -131,8 +129,6 @@ value: false - !type:WirePanel {} - !type:AllWiresCut - ignoreTypes: - - !type:DoorBoltWireAction completed: - !type:SpawnPrototype prototype: SheetRGlass1 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml index da5dccfd26..434db80394 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/windoor.yml @@ -113,8 +113,6 @@ value: false - !type:WirePanel {} - !type:AllWiresCut - ignoreTypes: - - !type:DoorBoltWireAction completed: - !type:EmptyAllContainers {} steps: @@ -216,8 +214,6 @@ - !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated container: board - !type:AllWiresCut - ignoreTypes: - - !type:DoorBoltWireAction completed: - !type:EmptyAllContainers {} steps: