From 39228b67adbfe938b93e317bb1c058af15570a07 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Fri, 15 Sep 2023 23:38:26 -0500 Subject: [PATCH 1/8] Initial commit --- .../Completions/ChangeConstructionGraph.cs | 27 ++ .../Construction/Completions/ChangeEntity.cs | 23 + .../ChangeWiresPanelSecurityLevel.cs | 27 -- .../Completions/RemoveWiresPanelSecurity.cs | 25 ++ .../Completions/SetWiresPanelSecurity.cs | 29 ++ .../Construction/ConstructionSystem.Graph.cs | 2 +- Content.Server/Doors/Systems/AirlockSystem.cs | 5 +- .../Construction/ConstructionGraphEdge.cs | 2 +- Content.Shared/Wires/SharedWiresSystem.cs | 12 +- Content.Shared/Wires/WiresPanelComponent.cs | 8 - .../Wires/WiresPanelSecurityComponent.cs | 61 +++ .../Wires/WiresPanelSecurityLevelPrototype.cs | 31 -- .../Structures/Doors/wires_panel_security.yml | 45 -- .../Graphs/structures/airlock.yml | 392 ++---------------- .../Graphs/structures/airlock_security.yml | 166 ++++++++ .../Graphs/structures/highsec.yml | 16 +- 16 files changed, 388 insertions(+), 483 deletions(-) create mode 100644 Content.Server/Construction/Completions/ChangeConstructionGraph.cs create mode 100644 Content.Server/Construction/Completions/ChangeEntity.cs delete mode 100644 Content.Server/Construction/Completions/ChangeWiresPanelSecurityLevel.cs create mode 100644 Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs create mode 100644 Content.Server/Construction/Completions/SetWiresPanelSecurity.cs create mode 100644 Content.Shared/Wires/WiresPanelSecurityComponent.cs delete mode 100644 Content.Shared/Wires/WiresPanelSecurityLevelPrototype.cs delete mode 100644 Resources/Prototypes/Entities/Structures/Doors/wires_panel_security.yml create mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml diff --git a/Content.Server/Construction/Completions/ChangeConstructionGraph.cs b/Content.Server/Construction/Completions/ChangeConstructionGraph.cs new file mode 100644 index 000000000000..b5bf36617d08 --- /dev/null +++ b/Content.Server/Construction/Completions/ChangeConstructionGraph.cs @@ -0,0 +1,27 @@ +using Content.Server.Construction.Components; +using Content.Shared.Construction; +using JetBrains.Annotations; + +namespace Content.Server.Construction.Completions; + +[UsedImplicitly] +[DataDefinition] +public sealed partial class ChangeConstructionGraph : IGraphAction +{ + [DataField("graph", required: true)] + public string Graph = string.Empty; + + [DataField("node", required: true)] + public string Node = string.Empty; + + public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) + { + if (!entityManager.TryGetComponent(uid, out var construction)) + return; + + if (entityManager.TrySystem(out ConstructionSystem? constructionSystem)) + { + constructionSystem.ChangeGraph(uid, userUid, Graph, Node, true, construction); + } + } +} diff --git a/Content.Server/Construction/Completions/ChangeEntity.cs b/Content.Server/Construction/Completions/ChangeEntity.cs new file mode 100644 index 000000000000..eaa7a7d5c68d --- /dev/null +++ b/Content.Server/Construction/Completions/ChangeEntity.cs @@ -0,0 +1,23 @@ +using Content.Shared.Construction; +using JetBrains.Annotations; + +namespace Content.Server.Construction.Completions; + +[UsedImplicitly] +[DataDefinition] +public sealed partial class ChangeEntity : IGraphAction +{ + [DataField("prototype", required: true)] + public string Prototype = string.Empty; + + public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) + { + if (Prototype == null) + return; + + if (entityManager.TrySystem(out ConstructionSystem? constructionSystem)) + { + constructionSystem.ChangeEntity(uid, userUid, Prototype); + } + } +} diff --git a/Content.Server/Construction/Completions/ChangeWiresPanelSecurityLevel.cs b/Content.Server/Construction/Completions/ChangeWiresPanelSecurityLevel.cs deleted file mode 100644 index e4848492aef1..000000000000 --- a/Content.Server/Construction/Completions/ChangeWiresPanelSecurityLevel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Content.Server.Wires; -using Content.Shared.Construction; -using Content.Shared.Wires; -using JetBrains.Annotations; - -namespace Content.Server.Construction.Completions; - -[UsedImplicitly] -[DataDefinition] -public sealed partial class ChangeWiresPanelSecurityLevel : IGraphAction -{ - [DataField("level")] - [ValidatePrototypeId] - public string WiresPanelSecurityLevelID = "Level0"; - - public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) - { - if (WiresPanelSecurityLevelID == null) - return; - - if (entityManager.TryGetComponent(uid, out WiresPanelComponent? wiresPanel) - && entityManager.TrySystem(out WiresSystem? wiresSystem)) - { - wiresSystem.SetWiresPanelSecurityData(uid, wiresPanel, WiresPanelSecurityLevelID); - } - } -} diff --git a/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs b/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs new file mode 100644 index 000000000000..c9b664436001 --- /dev/null +++ b/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs @@ -0,0 +1,25 @@ +using Content.Server.Construction.Components; +using Content.Shared.Construction; +using Content.Shared.Wires; +using JetBrains.Annotations; + +namespace Content.Server.Construction.Completions; + +[UsedImplicitly] +[DataDefinition] +public sealed partial class RemoveWiresPanelSecurity : IGraphAction +{ + public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) + { + if (!entityManager.TryGetComponent(uid, out var wiresPanelSecurity)) + return; + + if (!entityManager.TryGetComponent(uid, out var construction)) + return; + + if (entityManager.TrySystem(out ConstructionSystem? constructionSystem)) + { + constructionSystem.ChangeGraph(uid, userUid, wiresPanelSecurity.StartGraph, wiresPanelSecurity.StartNode, true, construction); + } + } +} diff --git a/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs b/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs new file mode 100644 index 000000000000..c9afe5c59fa6 --- /dev/null +++ b/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs @@ -0,0 +1,29 @@ +using Content.Server.Wires; +using Content.Shared.Construction; +using Content.Shared.Wires; +using JetBrains.Annotations; + +namespace Content.Server.Construction.Completions; + +[UsedImplicitly] +[DataDefinition] +public sealed partial class SetWiresPanelSecurity : IGraphAction +{ + [DataField("examine")] + public string Examine = string.Empty; + + [DataField("wiresAccessible")] + public bool WiresAccessible = true; + + [DataField("weldingAllowed")] + public bool WeldingAllowed = true; + + public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) + { + if (entityManager.TryGetComponent(uid, out WiresPanelSecurityComponent? wiresPanelSecurity) + && entityManager.TrySystem(out WiresSystem? wiresSystem)) + { + //wiresSystem.SetWiresPanelSecurityData(uid, wiresPanel, WiresPanelSecurityLevelID); + } + } +} diff --git a/Content.Server/Construction/ConstructionSystem.Graph.cs b/Content.Server/Construction/ConstructionSystem.Graph.cs index 5d4bcde4cecb..59929971f325 100644 --- a/Content.Server/Construction/ConstructionSystem.Graph.cs +++ b/Content.Server/Construction/ConstructionSystem.Graph.cs @@ -285,7 +285,7 @@ public bool ChangeNode(EntityUid uid, EntityUid? userUid, string id, bool perfor /// The container manager component of the target entity. Will be resolved if null, /// but it is an optional component and not required for the method to work. /// The new entity, or null if the method did not succeed. - private EntityUid? ChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity, + public EntityUid? ChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity, ConstructionComponent? construction = null, MetaDataComponent? metaData = null, TransformComponent? transform = null, diff --git a/Content.Server/Doors/Systems/AirlockSystem.cs b/Content.Server/Doors/Systems/AirlockSystem.cs index bb75fc7d4764..1633787b55d0 100644 --- a/Content.Server/Doors/Systems/AirlockSystem.cs +++ b/Content.Server/Doors/Systems/AirlockSystem.cs @@ -18,7 +18,6 @@ public sealed class AirlockSystem : SharedAirlockSystem [Dependency] private readonly WiresSystem _wiresSystem = default!; [Dependency] private readonly PowerReceiverSystem _power = default!; [Dependency] private readonly DoorBoltSystem _bolts = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public override void Initialize() { @@ -153,8 +152,8 @@ private void OnActivate(EntityUid uid, AirlockComponent component, ActivateInWor { if (TryComp(uid, out var panel) && panel.Open && - _prototypeManager.TryIndex(panel.CurrentSecurityLevelID, out var securityLevelPrototype) && - securityLevelPrototype.WiresAccessible && + TryComp(uid, out var wiresPanelSecurity) && + wiresPanelSecurity.WiresAccessible && TryComp(args.User, out var actor)) { _wiresSystem.OpenUserInterface(uid, actor.PlayerSession); diff --git a/Content.Shared/Construction/ConstructionGraphEdge.cs b/Content.Shared/Construction/ConstructionGraphEdge.cs index 6ac757174301..5166da94207d 100644 --- a/Content.Shared/Construction/ConstructionGraphEdge.cs +++ b/Content.Shared/Construction/ConstructionGraphEdge.cs @@ -1,4 +1,4 @@ -using Content.Shared.Construction.Steps; +using Content.Shared.Construction.Steps; namespace Content.Shared.Construction { diff --git a/Content.Shared/Wires/SharedWiresSystem.cs b/Content.Shared/Wires/SharedWiresSystem.cs index 055827e8b1dd..f76dea80ea82 100644 --- a/Content.Shared/Wires/SharedWiresSystem.cs +++ b/Content.Shared/Wires/SharedWiresSystem.cs @@ -6,8 +6,6 @@ namespace Content.Shared.Wires; public abstract class SharedWiresSystem : EntitySystem { - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - public override void Initialize() { base.Initialize(); @@ -26,10 +24,10 @@ private void OnExamine(EntityUid uid, WiresPanelComponent component, ExaminedEve { args.PushMarkup(Loc.GetString("wires-panel-component-on-examine-open")); - if (_prototypeManager.TryIndex(component.CurrentSecurityLevelID, out var securityLevelPrototype) && - securityLevelPrototype.Examine != null) + if (TryComp(uid, out var wiresPanelSecurity) && + wiresPanelSecurity.Examine != null) { - args.PushMarkup(Loc.GetString(securityLevelPrototype.Examine)); + args.PushMarkup(Loc.GetString(wiresPanelSecurity.Examine)); } } } @@ -37,8 +35,8 @@ private void OnExamine(EntityUid uid, WiresPanelComponent component, ExaminedEve private void OnWeldableAttempt(EntityUid uid, WiresPanelComponent component, WeldableAttemptEvent args) { if (component.Open && - _prototypeManager.TryIndex(component.CurrentSecurityLevelID, out var securityLevelPrototype) && - !securityLevelPrototype.WeldingAllowed) + TryComp(uid, out var wiresPanelSecurity) && + !wiresPanelSecurity.WeldingAllowed) { args.Cancel(); } diff --git a/Content.Shared/Wires/WiresPanelComponent.cs b/Content.Shared/Wires/WiresPanelComponent.cs index adc9d9a5f097..1162d0503386 100644 --- a/Content.Shared/Wires/WiresPanelComponent.cs +++ b/Content.Shared/Wires/WiresPanelComponent.cs @@ -27,14 +27,6 @@ public sealed partial class WiresPanelComponent : Component [DataField("screwdriverCloseSound")] public SoundSpecifier ScrewdriverCloseSound = new SoundPathSpecifier("/Audio/Machines/screwdriverclose.ogg"); - - /// - /// This prototype describes the current security features of the wire panel - /// - [DataField("securityLevel")] - [ValidatePrototypeId] - [AutoNetworkedField] - public string CurrentSecurityLevelID = "Level0"; } /// diff --git a/Content.Shared/Wires/WiresPanelSecurityComponent.cs b/Content.Shared/Wires/WiresPanelSecurityComponent.cs new file mode 100644 index 000000000000..0cf2b52ee324 --- /dev/null +++ b/Content.Shared/Wires/WiresPanelSecurityComponent.cs @@ -0,0 +1,61 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Wires; + +[NetworkedComponent, RegisterComponent] +[Access(typeof(SharedWiresSystem))] +[AutoGenerateComponentState] +public sealed partial class WiresPanelSecurityComponent : Component +{ + /// + /// A verbal description of the wire panel's current security level + /// + [DataField("examine")] + [AutoNetworkedField] + public string? Examine = default!; + + /// + /// Determines whether the wiring is accessible to hackers or not + /// + [DataField("wiresAccessible")] + [AutoNetworkedField] + public bool WiresAccessible = true; + + /// + /// Determines whether the device can be welded shut or not + /// + /// + /// Should be set false when you need to weld/unweld something to/from the wire panel + /// + [DataField("weldingAllowed")] + [AutoNetworkedField] + public bool WeldingAllowed = true; + + /// + /// Name of the construction graph to which specifies all the security upgrades for the wires panel + /// + [DataField("startGraph", required: true)] + [AutoNetworkedField] + public string StartGraph = string.Empty; + + /// + /// Name of the node to use on the starting construction graph + /// + [DataField("startNode", required: true)] + [AutoNetworkedField] + public string StartNode = string.Empty; + + /// + /// Name of the construction graph to use to when all security features are removed from the wires panel + /// + [DataField("baseGraph", required: true)] + [AutoNetworkedField] + public string BaseGraph = string.Empty; + + /// + /// Name of the node to use on the base construction graph + /// + [DataField("baseNode", required: true)] + [AutoNetworkedField] + public string BaseNode = string.Empty; +} diff --git a/Content.Shared/Wires/WiresPanelSecurityLevelPrototype.cs b/Content.Shared/Wires/WiresPanelSecurityLevelPrototype.cs deleted file mode 100644 index 8ddc8eeab819..000000000000 --- a/Content.Shared/Wires/WiresPanelSecurityLevelPrototype.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Robust.Shared.Prototypes; - -namespace Content.Shared.Wires; - -[Prototype("WiresPanelSecurityLevel")] -public sealed class WiresPanelSecurityLevelPrototype : IPrototype -{ - [IdDataField] - public string ID { get; private set; } = default!; - - /// - /// A verbal description of the wire panel's current security level - /// - [DataField("examine")] - public string? Examine = default!; - - /// - /// Determines whether the wiring is accessible to hackers or not - /// - [DataField("wiresAccessible")] - public bool WiresAccessible = true; - - /// - /// Determines whether the device can be welded shut or not - /// - /// - /// Should be set false when you need to weld/unweld something to/from the wire panel - /// - [DataField("weldingAllowed")] - public bool WeldingAllowed = true; -} diff --git a/Resources/Prototypes/Entities/Structures/Doors/wires_panel_security.yml b/Resources/Prototypes/Entities/Structures/Doors/wires_panel_security.yml deleted file mode 100644 index 4a42ed36ad8f..000000000000 --- a/Resources/Prototypes/Entities/Structures/Doors/wires_panel_security.yml +++ /dev/null @@ -1,45 +0,0 @@ -- type: WiresPanelSecurityLevel - id: Level0 - wiresAccessible: true - -- type: WiresPanelSecurityLevel - id: Level1 - examine: wires-panel-component-on-examine-security-level1 - wiresAccessible: false - weldingAllowed: false - -- type: WiresPanelSecurityLevel - id: Level2 - examine: wires-panel-component-on-examine-security-level2 - wiresAccessible: false - weldingAllowed: false - -- type: WiresPanelSecurityLevel - id: Level3 - examine: wires-panel-component-on-examine-security-level3 - wiresAccessible: false - weldingAllowed: false - -- type: WiresPanelSecurityLevel - id: Level4 - examine: wires-panel-component-on-examine-security-level4 - wiresAccessible: false - weldingAllowed: false - -- type: WiresPanelSecurityLevel - id: Level5 - examine: wires-panel-component-on-examine-security-level5 - wiresAccessible: false - -- type: WiresPanelSecurityLevel - id: Level6 - examine: wires-panel-component-on-examine-security-level6 - wiresAccessible: false - weldingAllowed: false - -- type: WiresPanelSecurityLevel - id: Level7 - examine: wires-panel-component-on-examine-security-level7 - wiresAccessible: false - weldingAllowed: false - \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml index 3d7e45873185..7ceb6c93392f 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml @@ -67,6 +67,9 @@ - to: airlock conditions: - !type:EntityAnchored {} + completed: + - !type:ChangeEntity + prototype: Airlock steps: - tool: Screwing doAfter: 2.5 @@ -92,6 +95,9 @@ - to: glassAirlock conditions: - !type:EntityAnchored {} + completed: + - !type:ChangeEntity + prototype: AirlockGlass steps: - material: ReinforcedGlass amount: 1 @@ -110,11 +116,12 @@ - tool: Prying doAfter: 5 +## Glass airlock - node: glassAirlock - entity: AirlockGlass actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level0 + - !type:SetWiresPanelSecurity + wiresAccessible: true + weldingAllowed: true edges: - to: glassElectronics conditions: @@ -132,7 +139,7 @@ - tool: Prying doAfter: 2 - - to: glassAirlockMedSecurityBreached + - to: medSecurityUnfinished conditions: - !type:WirePanel {} steps: @@ -140,201 +147,22 @@ amount: 2 doAfter: 2 - - to: glassAirlockHighSecurityBreached + - to: highSecurityUnfinished conditions: - !type:WirePanel {} steps: - material: Plasteel amount: 2 doAfter: 2 - -## Return node so that removing all internal plating doesn't reset the door - - node: glassAirlockUnsecured - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level0 - edges: - - to: glassElectronics - conditions: - - !type:EntityAnchored {} - - !type:DoorWelded {} - - !type:DoorBolted - value: false - - !type:WirePanel {} - - !type:AllWiresCut - completed: - - !type:SpawnPrototype - prototype: SheetRGlass1 - amount: 1 - steps: - - tool: Prying - doAfter: 2 - - - to: glassAirlockMedSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - material: Steel - amount: 2 - doAfter: 2 - - to: glassAirlockHighSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - material: Plasteel - amount: 2 - doAfter: 2 - -## Medium security level airlock: a layer of steel plating protects the internal wiring - - node: glassAirlockMedSecurityBreached - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level1 - edges: - - to: glassAirlockUnsecured - completed: - - !type:GivePrototype - prototype: SheetSteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: glassAirlockMedSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 3 - - - node: glassAirlockMedSecurity - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level2 - edges: - - to: glassAirlockMedSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 10 - -## High security level airlock: a layer of plasteel plating protects the internal wiring - - node: glassAirlockHighSecurityBreached - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level3 - edges: - - to: glassAirlockUnsecured - completed: - - !type:GivePrototype - prototype: SheetPlasteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: glassAirlockHighSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 5 - - - node: glassAirlockHighSecurity - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level4 - edges: - - to: glassAirlockHighSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 15 - - - to: glassAirlockMaxSecurity - conditions: - - !type:WirePanel {} - steps: - - material: MetalRod - amount: 2 - doAfter: 1 - -## Max security level airlock: an electric grill is added - - node: glassAirlockMaxSecurity - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level5 - edges: - - to: glassAirlockHighSecurity - completed: - - !type:AttemptElectrocute - - !type:GivePrototype - prototype: PartRodMetal1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Cutting - doAfter: 0.5 - - - to: glassAirlockSuperMaxSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - material: Plasteel - amount: 2 - doAfter: 2 - -## Super max security level airlock: an additional layer of plasteel is added - - node: glassAirlockSuperMaxSecurityBreached - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level6 - edges: - - to: glassAirlockMaxSecurity - completed: - - !type:GivePrototype - prototype: SheetPlasteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: glassAirlockSuperMaxSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 5 - - - node: glassAirlockSuperMaxSecurity - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level7 - edges: - - to: glassAirlockSuperMaxSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 15 - +## Standard airlock - node: airlock - entity: Airlock actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level0 + - !type:SetWiresPanelSecurity + wiresAccessible: true + weldingAllowed: true edges: - - to: wired #TODO DOOR ELECTRONICS. If door electronics ever govern access permissions, this step should probably be further down? It makes it too easy to swap permissions around. See also windoor. + - to: wired conditions: - !type:EntityAnchored {} - !type:DoorWelded {} @@ -348,7 +176,7 @@ - tool: Prying doAfter: 5 - - to: airlockMedSecurityBreached + - to: medSecurityUnfinished conditions: - !type:WirePanel {} steps: @@ -356,7 +184,7 @@ amount: 2 doAfter: 2 - - to: airlockHighSecurityBreached + - to: highSecurityUnfinished conditions: - !type:WirePanel {} steps: @@ -364,180 +192,40 @@ amount: 2 doAfter: 2 -## Return node so that removing all internal plating doesn't reset the door - - node: airlockUnsecured +## High security door + - node: highSecDoor actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level0 - edges: - - to: wired - conditions: - - !type:EntityAnchored {} - - !type:DoorWelded {} - - !type:DoorBolted - value: false - - !type:WirePanel {} - - !type:AllWiresCut - completed: - - !type:EmptyAllContainers {} - steps: - - tool: Prying - doAfter: 5 - - - to: airlockMedSecurityBreached + - !type:SetWiresPanelSecurity + wiresAccessible: true + weldingAllowed: true + edges: + - to: medSecurityUnfinished conditions: - !type:WirePanel {} steps: - material: Steel amount: 2 doAfter: 2 - - - to: airlockHighSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - material: Plasteel - amount: 2 - doAfter: 2 - -## Medium security level airlock: a layer of steel plating protects the internal wiring - - node: airlockMedSecurityBreached - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level1 - edges: - - to: airlockUnsecured - completed: - - !type:GivePrototype - prototype: SheetSteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: airlockMedSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 3 - - - node: airlockMedSecurity - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level2 - edges: - - to: airlockMedSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 10 - -## High security level airlock: a layer of plasteel plating protects the internal wiring - - node: airlockHighSecurityBreached - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level3 - edges: - - to: airlockUnsecured - completed: - - !type:GivePrototype - prototype: SheetPlasteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: airlockHighSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 5 - - - node: airlockHighSecurity - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level4 - edges: - - to: airlockHighSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 15 - - to: airlockMaxSecurity + - to: highSecurityUnfinished conditions: - !type:WirePanel {} - steps: - - material: MetalRod - amount: 2 - doAfter: 1 - -## Max security level airlock: an electric grill is added - - node: airlockMaxSecurity - actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level5 - edges: - - to: airlockHighSecurity - completed: - - !type:AttemptElectrocute - - !type:GivePrototype - prototype: PartRodMetal1 - amount: 2 - conditions: - - !type:WirePanel {} steps: - - tool: Cutting - doAfter: 0.5 - - - to: airlockSuperMaxSecurityBreached - conditions: - - !type:WirePanel {} - steps: - material: Plasteel amount: 2 doAfter: 2 - -## Super max security level airlock: an additional layer of plasteel is added - - node: airlockSuperMaxSecurityBreached + +## Change construction graph to make a medium security airlock + - node: medSecurityUnfinished actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level6 - edges: - - to: airlockMaxSecurity - completed: - - !type:GivePrototype - prototype: SheetPlasteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: airlockSuperMaxSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 5 - - - node: airlockSuperMaxSecurity + - !type:ChangeConstructionGraph + graph: AirlockSecurity + node: medSecurityUnfinished + +## Change construction graph to make a high security airlock + - node: highSecurityUnfinished actions: - - !type:ChangeWiresPanelSecurityLevel - level: Level7 - edges: - - to: airlockSuperMaxSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 15 + - !type:ChangeConstructionGraph + level: AirlockSecurity + node: medSecurityUnfinished + diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml new file mode 100644 index 000000000000..c7c035af32bc --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml @@ -0,0 +1,166 @@ +- type: constructionGraph + id: AirlockSecurity + start: start + graph: + - node: unsecuredAirlock + actions: + - !type:SetWiresPanelSecurity + wiresAccessible: true + weldingAllowed: true + - !type:RemoveWiresPanelSecurity + +## Medium security level door: a layer of steel plating protects the internal wiring + - node: medSecurityUnfinished + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level1 + wiresAccessible: false + weldingAllowed: false + edges: + - to: unsecuredAirlock + completed: + - !type:GivePrototype + prototype: SheetSteel1 + amount: 2 + conditions: + - !type:WirePanel {} + steps: + - tool: Prying + doAfter: 4 + + - to: medSecurity + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 3 + + - node: medSecurity + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level2 + wiresAccessible: false + weldingAllowed: false + edges: + - to: medSecurityUnfinished + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 10 + +## High security level door: a layer of plasteel plating protects the internal wiring + - node: highSecurityUnfinished + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level3 + wiresAccessible: false + weldingAllowed: false + edges: + - to: unsecuredAirlock + completed: + - !type:GivePrototype + prototype: SheetPlasteel1 + amount: 2 + conditions: + - !type:WirePanel {} + steps: + - tool: Prying + doAfter: 4 + + - to: highSecurity + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 5 + + - node: highSecurity + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level4 + wiresAccessible: false + weldingAllowed: false + edges: + - to: highSecurityUnfinished + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 15 + + - to: maxSecurity + conditions: + - !type:WirePanel {} + steps: + - material: MetalRod + amount: 2 + doAfter: 1 + +## Max security level door: an electric grill is added + - node: maxSecurity + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level5 + wiresAccessible: false + weldingAllowed: true + edges: + - to: highSecurity + completed: + - !type:AttemptElectrocute + - !type:GivePrototype + prototype: PartRodMetal1 + amount: 2 + conditions: + - !type:WirePanel {} + steps: + - tool: Cutting + doAfter: 0.5 + + - to: superMaxSecurityUnfinished + conditions: + - !type:WirePanel {} + steps: + - material: Plasteel + amount: 2 + doAfter: 2 + +## Super max security level door: an additional layer of plasteel is added + - node: superMaxSecurityUnfinished + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level6 + wiresAccessible: false + weldingAllowed: false + edges: + - to: maxSecurity + completed: + - !type:GivePrototype + prototype: SheetPlasteel1 + amount: 2 + conditions: + - !type:WirePanel {} + steps: + - tool: Prying + doAfter: 4 + + - to: superMaxSecurity + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 5 + + - node: superMaxSecurity + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level7 + wiresAccessible: false + weldingAllowed: false + edges: + - to: superMaxSecurityUnfinished + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 15 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/highsec.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/highsec.yml index bf210ad463cb..49da4d46ec6f 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/highsec.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/highsec.yml @@ -4,7 +4,7 @@ graph: - node: start actions: - - !type:ChangeWiresPanelSecurityLevel + - !type:SetWiresPanelSecurity level: Level0 edges: - to: medSecurityBreached @@ -26,7 +26,7 @@ ## Medium security level door: a layer of steel plating protects the internal wiring - node: medSecurityBreached actions: - - !type:ChangeWiresPanelSecurityLevel + - !type:SetWiresPanelSecurity level: Level1 edges: - to: start @@ -49,7 +49,7 @@ - node: medSecurity actions: - - !type:ChangeWiresPanelSecurityLevel + - !type:SetWiresPanelSecurity level: Level2 edges: - to: medSecurityBreached @@ -62,7 +62,7 @@ ## High security level door: a layer of plasteel plating protects the internal wiring - node: highSecurityBreached actions: - - !type:ChangeWiresPanelSecurityLevel + - !type:SetWiresPanelSecurity level: Level3 edges: - to: start @@ -85,7 +85,7 @@ - node: highSecurity actions: - - !type:ChangeWiresPanelSecurityLevel + - !type:SetWiresPanelSecurity level: Level4 edges: - to: highSecurityBreached @@ -106,7 +106,7 @@ ## Max security level door: an electric grill is added - node: maxSecurity actions: - - !type:ChangeWiresPanelSecurityLevel + - !type:SetWiresPanelSecurity level: Level5 edges: - to: highSecurity @@ -132,7 +132,7 @@ ## Super max security level door: an additional layer of plasteel is added - node: superMaxSecurityBreached actions: - - !type:ChangeWiresPanelSecurityLevel + - !type:SetWiresPanelSecurity level: Level6 edges: - to: maxSecurity @@ -155,7 +155,7 @@ - node: superMaxSecurity actions: - - !type:ChangeWiresPanelSecurityLevel + - !type:SetWiresPanelSecurity level: Level7 edges: - to: superMaxSecurityBreached From 9362628d54bb84a8c8fba6db832c378cd13b8f1f Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 16 Sep 2023 01:36:16 -0500 Subject: [PATCH 2/8] Initial commit --- .../Completions/RemoveWiresPanelSecurity.cs | 2 +- .../Completions/SetWiresPanelSecurity.cs | 7 ++-- Content.Server/Wires/WiresSystem.cs | 36 +++++++++++++++--- .../Wires/WiresPanelSecurityComponent.cs | 37 ++++++++++++++----- .../Structures/Doors/Airlocks/airlocks.yml | 14 +++---- .../Doors/Airlocks/base_structureairlocks.yml | 5 +++ .../Structures/Doors/Airlocks/highsec.yml | 8 ++-- .../Graphs/structures/airlock.yml | 4 +- .../Graphs/structures/airlock_security.yml | 2 +- 9 files changed, 80 insertions(+), 35 deletions(-) diff --git a/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs b/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs index c9b664436001..f7bb9423b802 100644 --- a/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs +++ b/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs @@ -19,7 +19,7 @@ public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager enti if (entityManager.TrySystem(out ConstructionSystem? constructionSystem)) { - constructionSystem.ChangeGraph(uid, userUid, wiresPanelSecurity.StartGraph, wiresPanelSecurity.StartNode, true, construction); + constructionSystem.ChangeGraph(uid, userUid, wiresPanelSecurity.BaseGraph, wiresPanelSecurity.BaseNode, true, construction); } } } diff --git a/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs b/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs index c9afe5c59fa6..9e5e6d461d81 100644 --- a/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs +++ b/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs @@ -1,4 +1,3 @@ -using Content.Server.Wires; using Content.Shared.Construction; using Content.Shared.Wires; using JetBrains.Annotations; @@ -20,10 +19,10 @@ public sealed partial class SetWiresPanelSecurity : IGraphAction public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) { - if (entityManager.TryGetComponent(uid, out WiresPanelSecurityComponent? wiresPanelSecurity) - && entityManager.TrySystem(out WiresSystem? wiresSystem)) + if (entityManager.TryGetComponent(uid, out WiresPanelSecurityComponent? _)) { - //wiresSystem.SetWiresPanelSecurityData(uid, wiresPanel, WiresPanelSecurityLevelID); + var ev = new WiresPanelSecurityEvent(Examine, WiresAccessible, WeldingAllowed); + entityManager.EventBus.RaiseLocalEvent(uid, ev); } } } diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index e9522485ca1b..5779db73e95a 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -2,6 +2,8 @@ using System.Linq; using System.Threading; using Content.Server.Administration.Logs; +using Content.Server.Construction; +using Content.Server.Construction.Components; using Content.Server.Power.Components; using Content.Server.UserInterface; using Content.Shared.Database; @@ -33,6 +35,7 @@ public sealed class WiresSystem : SharedWiresSystem [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly ConstructionSystem _constructionSystem = default!; // This is where all the wire layouts are stored. [ViewVariables] private readonly Dictionary _layouts = new(); @@ -58,6 +61,7 @@ public override void Initialize() SubscribeLocalEvent(OnDoAfter); SubscribeLocalEvent(OnAttemptOpenActivatableUI); SubscribeLocalEvent(OnActivatableUIPanelChanged); + SubscribeLocalEvent(SetWiresPanelSecurity); } private void SetOrCreateWireLayout(EntityUid uid, WiresComponent? wires = null) { @@ -459,8 +463,8 @@ private void OnInteractUsing(EntityUid uid, WiresComponent component, InteractUs return; if (panel.Open && - _protoMan.TryIndex(panel.CurrentSecurityLevelID, out var securityLevelPrototype) && - securityLevelPrototype.WiresAccessible && + TryComp(uid, out var wiresPanelSecurity) && + wiresPanelSecurity.WiresAccessible && (_toolSystem.HasQuality(args.Used, "Cutting", tool) || _toolSystem.HasQuality(args.Used, "Pulsing", tool))) { @@ -526,6 +530,24 @@ private void OnMapInit(EntityUid uid, WiresComponent component, MapInitEvent arg if (component.WireSeed == 0) component.WireSeed = _random.Next(1, int.MaxValue); + if (TryComp(uid, out var wiresPanelSecurity) && + TryComp(uid, out var construction)) + { + if (string.IsNullOrEmpty(wiresPanelSecurity.BaseGraph)) + wiresPanelSecurity.BaseGraph = construction.Graph; + + if (string.IsNullOrEmpty(wiresPanelSecurity.BaseGraph)) + wiresPanelSecurity.BaseNode = construction.Node; + + if (string.IsNullOrEmpty(wiresPanelSecurity.BaseGraph)) + wiresPanelSecurity.SecurityGraph = construction.Graph; + + if (string.IsNullOrEmpty(wiresPanelSecurity.BaseGraph)) + wiresPanelSecurity.SecurityNode = construction.Node; + + _constructionSystem.ChangeGraph(uid, null, wiresPanelSecurity.SecurityGraph, wiresPanelSecurity.SecurityNode, true, construction); + } + UpdateUserInterface(uid); } #endregion @@ -656,13 +678,15 @@ public void TogglePanel(EntityUid uid, WiresPanelComponent component, bool open) RaiseLocalEvent(uid, ref ev); } - public void SetWiresPanelSecurityData(EntityUid uid, WiresPanelComponent component, string wiresPanelSecurityLevelID) + public void SetWiresPanelSecurity(EntityUid uid, WiresPanelSecurityComponent component, WiresPanelSecurityEvent args) { - component.CurrentSecurityLevelID = wiresPanelSecurityLevelID; + component.Examine = args.Examine; + component.WiresAccessible = args.WiresAccessible; + component.WeldingAllowed = args.WeldingAllowed; + Dirty(uid, component); - if (_protoMan.TryIndex(component.CurrentSecurityLevelID, out var securityLevelPrototype) && - securityLevelPrototype.WiresAccessible) + if (!args.WiresAccessible) { _uiSystem.TryCloseAll(uid, WiresUiKey.Key); } diff --git a/Content.Shared/Wires/WiresPanelSecurityComponent.cs b/Content.Shared/Wires/WiresPanelSecurityComponent.cs index 0cf2b52ee324..05aac1f2377a 100644 --- a/Content.Shared/Wires/WiresPanelSecurityComponent.cs +++ b/Content.Shared/Wires/WiresPanelSecurityComponent.cs @@ -32,30 +32,47 @@ public sealed partial class WiresPanelSecurityComponent : Component public bool WeldingAllowed = true; /// - /// Name of the construction graph to which specifies all the security upgrades for the wires panel + /// Name of the construction graph which contains the entities' security upgrades /// - [DataField("startGraph", required: true)] + [DataField("graph")] [AutoNetworkedField] - public string StartGraph = string.Empty; + public string SecurityGraph = string.Empty; /// - /// Name of the node to use on the starting construction graph + /// Name of the node that the entity will start on /// - [DataField("startNode", required: true)] + [DataField("node")] [AutoNetworkedField] - public string StartNode = string.Empty; + public string SecurityNode = string.Empty; /// - /// Name of the construction graph to use to when all security features are removed from the wires panel + /// Name of the base construction graph /// - [DataField("baseGraph", required: true)] + [DataField("baseGraph")] [AutoNetworkedField] public string BaseGraph = string.Empty; /// - /// Name of the node to use on the base construction graph + /// Name of the base node for the base construction graph /// - [DataField("baseNode", required: true)] + [DataField("baseNode")] [AutoNetworkedField] public string BaseNode = string.Empty; } + +/// +/// This event gets raised when security settings on a wires panel change +/// +public sealed class WiresPanelSecurityEvent : EntityEventArgs +{ + public readonly string? Examine; + public readonly bool WiresAccessible; + public readonly bool WeldingAllowed; + + public WiresPanelSecurityEvent(string? examine, bool wiresAccessible, bool weldingAllowed) + { + Examine = examine; + WiresAccessible = wiresAccessible; + WeldingAllowed = weldingAllowed; + } +} diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml index f445163257d4..cd8c285e90e9 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml @@ -69,10 +69,9 @@ components: - type: Sprite sprite: Structures/Doors/Airlocks/Standard/command.rsi - - type: WiresPanel - securityLevel: Level2 - - type: Construction - node: airlockMedSecurity + - type: WiresPanelSecurity + graph: AirlockSecurity + node: medSecurity - type: entity parent: Airlock @@ -218,10 +217,9 @@ sprite: Structures/Doors/Airlocks/Glass/command.rsi - type: PaintableAirlock group: Glass - - type: WiresPanel - securityLevel: Level2 - - type: Construction - node: glassAirlockMedSecurity + - type: WiresPanelSecurity + graph: AirlockSecurity + node: medSecurity - type: entity parent: AirlockGlass diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml index f40ef4ea8474..aa5f10b8ffa8 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml @@ -74,6 +74,11 @@ enabled: false usesApcPower: true - type: WiresPanel + - type: WiresPanelSecurity + graph: Airlock + node: airlock + baseGraph: Airlock + baseNode: airlock - type: Wires BoardName: wires-board-name-airlock LayoutId: Airlock diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml index 80194a48cdfc..9e0b8260ec2c 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml @@ -67,7 +67,9 @@ enabled: false usesApcPower: true - type: WiresPanel - securityLevel: Level5 + - type: WiresPanelSecurity + graph: AirlockSecurity + node: maxSecurity - type: Wires BoardName: wires-board-name-highsec LayoutId: HighSec @@ -94,5 +96,5 @@ key: walls mode: NoSprite - type: Construction - graph: HighSecDoor - node: maxSecurity + graph: Airlock + node: highSecDoor diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml index 7ceb6c93392f..4430998a2466 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml @@ -220,12 +220,12 @@ actions: - !type:ChangeConstructionGraph graph: AirlockSecurity - node: medSecurityUnfinished + node: medSecurityUnfinished ## Change construction graph to make a high security airlock - node: highSecurityUnfinished actions: - !type:ChangeConstructionGraph level: AirlockSecurity - node: medSecurityUnfinished + node: highSecurityUnfinished diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml index c7c035af32bc..d6b9e30682db 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml @@ -1,6 +1,6 @@ - type: constructionGraph id: AirlockSecurity - start: start + start: unsecuredAirlock graph: - node: unsecuredAirlock actions: From b672cb0d7a58c7baedac96979b47e61feb64b725 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 16 Sep 2023 12:23:54 -0500 Subject: [PATCH 3/8] Further revisions --- .../Completions/ChangeConstructionGraph.cs | 27 --- .../Completions/RemoveWiresPanelSecurity.cs | 25 -- .../Construction/Conditions/HasTag.cs | 39 +++ Content.Server/Wires/WiresSystem.cs | 17 +- .../Wires/WiresPanelSecurityComponent.cs | 32 +-- .../Structures/Doors/Airlocks/airlocks.yml | 11 +- .../Doors/Airlocks/base_structureairlocks.yml | 8 +- .../Structures/Doors/Airlocks/highsec.yml | 6 +- .../Graphs/structures/airlock.yml | 222 +++++++++++++++++- .../Graphs/structures/airlock_security.yml | 166 ------------- Resources/Prototypes/tags.yml | 10 +- 11 files changed, 282 insertions(+), 281 deletions(-) delete mode 100644 Content.Server/Construction/Completions/ChangeConstructionGraph.cs delete mode 100644 Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs create mode 100644 Content.Server/Construction/Conditions/HasTag.cs delete mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml diff --git a/Content.Server/Construction/Completions/ChangeConstructionGraph.cs b/Content.Server/Construction/Completions/ChangeConstructionGraph.cs deleted file mode 100644 index b5bf36617d08..000000000000 --- a/Content.Server/Construction/Completions/ChangeConstructionGraph.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Content.Server.Construction.Components; -using Content.Shared.Construction; -using JetBrains.Annotations; - -namespace Content.Server.Construction.Completions; - -[UsedImplicitly] -[DataDefinition] -public sealed partial class ChangeConstructionGraph : IGraphAction -{ - [DataField("graph", required: true)] - public string Graph = string.Empty; - - [DataField("node", required: true)] - public string Node = string.Empty; - - public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) - { - if (!entityManager.TryGetComponent(uid, out var construction)) - return; - - if (entityManager.TrySystem(out ConstructionSystem? constructionSystem)) - { - constructionSystem.ChangeGraph(uid, userUid, Graph, Node, true, construction); - } - } -} diff --git a/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs b/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs deleted file mode 100644 index f7bb9423b802..000000000000 --- a/Content.Server/Construction/Completions/RemoveWiresPanelSecurity.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Content.Server.Construction.Components; -using Content.Shared.Construction; -using Content.Shared.Wires; -using JetBrains.Annotations; - -namespace Content.Server.Construction.Completions; - -[UsedImplicitly] -[DataDefinition] -public sealed partial class RemoveWiresPanelSecurity : IGraphAction -{ - public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) - { - if (!entityManager.TryGetComponent(uid, out var wiresPanelSecurity)) - return; - - if (!entityManager.TryGetComponent(uid, out var construction)) - return; - - if (entityManager.TrySystem(out ConstructionSystem? constructionSystem)) - { - constructionSystem.ChangeGraph(uid, userUid, wiresPanelSecurity.BaseGraph, wiresPanelSecurity.BaseNode, true, construction); - } - } -} diff --git a/Content.Server/Construction/Conditions/HasTag.cs b/Content.Server/Construction/Conditions/HasTag.cs new file mode 100644 index 000000000000..1c4863606ea1 --- /dev/null +++ b/Content.Server/Construction/Conditions/HasTag.cs @@ -0,0 +1,39 @@ +using Content.Shared.Construction; +using JetBrains.Annotations; +using Content.Shared.Doors.Components; +using Content.Shared.Examine; +using YamlDotNet.Core.Tokens; +using Content.Shared.Tag; + +namespace Content.Server.Construction.Conditions +{ + [UsedImplicitly] + [DataDefinition] + public sealed partial class HasTag : IGraphCondition + { + [DataField("tag")] + public string Tag { get; private set; } + + public bool Condition(EntityUid uid, IEntityManager entityManager) + { + if (!entityManager.TrySystem(out var tagSystem)) + return false; + Logger.Debug("Tag: " + Tag); + Logger.Debug("Test: " + tagSystem.HasTag(uid, Tag)); + + return tagSystem.HasTag(uid, Tag); + } + + public bool DoExamine(ExaminedEvent args) + { + return false; + } + + public IEnumerable GenerateGuideEntry() + { + yield return new ConstructionGuideEntry() + { + }; + } + } +} diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index 5779db73e95a..574525f1c418 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -531,22 +531,9 @@ private void OnMapInit(EntityUid uid, WiresComponent component, MapInitEvent arg component.WireSeed = _random.Next(1, int.MaxValue); if (TryComp(uid, out var wiresPanelSecurity) && + !string.IsNullOrEmpty(wiresPanelSecurity.SecurityLevel) && TryComp(uid, out var construction)) - { - if (string.IsNullOrEmpty(wiresPanelSecurity.BaseGraph)) - wiresPanelSecurity.BaseGraph = construction.Graph; - - if (string.IsNullOrEmpty(wiresPanelSecurity.BaseGraph)) - wiresPanelSecurity.BaseNode = construction.Node; - - if (string.IsNullOrEmpty(wiresPanelSecurity.BaseGraph)) - wiresPanelSecurity.SecurityGraph = construction.Graph; - - if (string.IsNullOrEmpty(wiresPanelSecurity.BaseGraph)) - wiresPanelSecurity.SecurityNode = construction.Node; - - _constructionSystem.ChangeGraph(uid, null, wiresPanelSecurity.SecurityGraph, wiresPanelSecurity.SecurityNode, true, construction); - } + _constructionSystem.ChangeNode(uid, null, wiresPanelSecurity.SecurityLevel, true, construction); UpdateUserInterface(uid); } diff --git a/Content.Shared/Wires/WiresPanelSecurityComponent.cs b/Content.Shared/Wires/WiresPanelSecurityComponent.cs index 05aac1f2377a..d2804fa84ec3 100644 --- a/Content.Shared/Wires/WiresPanelSecurityComponent.cs +++ b/Content.Shared/Wires/WiresPanelSecurityComponent.cs @@ -2,6 +2,11 @@ namespace Content.Shared.Wires; +/// +/// Allows hacking protections to a be added to an entity. +/// These safeguards are determined via a construction graph, +/// so the entity requires for this to function +/// [NetworkedComponent, RegisterComponent] [Access(typeof(SharedWiresSystem))] [AutoGenerateComponentState] @@ -32,32 +37,11 @@ public sealed partial class WiresPanelSecurityComponent : Component public bool WeldingAllowed = true; /// - /// Name of the construction graph which contains the entities' security upgrades - /// - [DataField("graph")] - [AutoNetworkedField] - public string SecurityGraph = string.Empty; - - /// - /// Name of the node that the entity will start on - /// - [DataField("node")] - [AutoNetworkedField] - public string SecurityNode = string.Empty; - - /// - /// Name of the base construction graph - /// - [DataField("baseGraph")] - [AutoNetworkedField] - public string BaseGraph = string.Empty; - - /// - /// Name of the base node for the base construction graph + /// Name of the construction graph node that the entity will start on /// - [DataField("baseNode")] + [DataField("securityLevel")] [AutoNetworkedField] - public string BaseNode = string.Empty; + public string SecurityLevel = string.Empty; } /// diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml index cd8c285e90e9..419a4dc7f6f4 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml @@ -70,8 +70,7 @@ - type: Sprite sprite: Structures/Doors/Airlocks/Standard/command.rsi - type: WiresPanelSecurity - graph: AirlockSecurity - node: medSecurity + securityLevel: medSecurity - type: entity parent: Airlock @@ -137,7 +136,10 @@ group: Glass - type: RadiationBlocker resistance: 2 - + - type: Tag + tags: + - GlassAirlock + - type: entity parent: AirlockGlass id: AirlockEngineeringGlass @@ -218,8 +220,7 @@ - type: PaintableAirlock group: Glass - type: WiresPanelSecurity - graph: AirlockSecurity - node: medSecurity + securityLevel: medSecurity - type: entity parent: AirlockGlass diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml index aa5f10b8ffa8..1b8e0c2ecd23 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml @@ -75,10 +75,6 @@ usesApcPower: true - type: WiresPanel - type: WiresPanelSecurity - graph: Airlock - node: airlock - baseGraph: Airlock - baseNode: airlock - type: Wires BoardName: wires-board-name-airlock LayoutId: Airlock @@ -136,5 +132,9 @@ - type: AccessReader - type: StaticPrice price: 150 + - type: Tag + tags: + - Airlock placement: mode: SnapgridCenter + diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml index 9e0b8260ec2c..fac04c2b1725 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml @@ -68,8 +68,7 @@ usesApcPower: true - type: WiresPanel - type: WiresPanelSecurity - graph: AirlockSecurity - node: maxSecurity + securityLevel: maxSecurity - type: Wires BoardName: wires-board-name-highsec LayoutId: HighSec @@ -98,3 +97,6 @@ - type: Construction graph: Airlock node: highSecDoor + - type: Tag + tags: + - HighSecDoor \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml index 4430998a2466..5a76175b77ef 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml @@ -120,7 +120,7 @@ - node: glassAirlock actions: - !type:SetWiresPanelSecurity - wiresAccessible: true + wiresAccessible: true weldingAllowed: true edges: - to: glassElectronics @@ -159,7 +159,7 @@ - node: airlock actions: - !type:SetWiresPanelSecurity - wiresAccessible: true + wiresAccessible: true weldingAllowed: true edges: - to: wired @@ -196,7 +196,7 @@ - node: highSecDoor actions: - !type:SetWiresPanelSecurity - wiresAccessible: true + wiresAccessible: true weldingAllowed: true edges: - to: medSecurityUnfinished @@ -214,18 +214,216 @@ - material: Plasteel amount: 2 doAfter: 2 - -## Change construction graph to make a medium security airlock + +## Medium security level door: a layer of steel plating protects the internal wiring - node: medSecurityUnfinished actions: - - !type:ChangeConstructionGraph - graph: AirlockSecurity - node: medSecurityUnfinished + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level1 + wiresAccessible: false + weldingAllowed: false + edges: + - to: glassAirlock + completed: + - !type:GivePrototype + prototype: SheetSteel1 + amount: 2 + conditions: + - !type:WirePanel {} + - !type:HasTag + tag: GlassAirlock + steps: + - tool: Prying + doAfter: 4 + + - to: airlock + completed: + - !type:GivePrototype + prototype: SheetSteel1 + amount: 2 + conditions: + - !type:WirePanel {} + - !type:HasTag + tag: Airlock + steps: + - tool: Prying + doAfter: 4 + + - to: highSecDoor + completed: + - !type:GivePrototype + prototype: SheetSteel1 + amount: 2 + conditions: + - !type:WirePanel {} + - !type:HasTag + tag: HighSecDoor + steps: + - tool: Prying + doAfter: 4 + + - to: medSecurity + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 3 + + - node: medSecurity + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level2 + wiresAccessible: false + weldingAllowed: false + edges: + - to: medSecurityUnfinished + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 10 -## Change construction graph to make a high security airlock +## High security level door: a layer of plasteel plating protects the internal wiring - node: highSecurityUnfinished actions: - - !type:ChangeConstructionGraph - level: AirlockSecurity - node: highSecurityUnfinished + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level3 + wiresAccessible: false + weldingAllowed: false + edges: + - to: glassAirlock + completed: + - !type:GivePrototype + prototype: SheetPlasteel1 + amount: 2 + conditions: + - !type:WirePanel {} + - !type:HasTag + tag: GlassAirlock + steps: + - tool: Prying + doAfter: 4 + + - to: airlock + completed: + - !type:GivePrototype + prototype: SheetPlasteel1 + amount: 2 + conditions: + - !type:WirePanel {} + - !type:HasTag + tag: Airlock + steps: + - tool: Prying + doAfter: 4 + + - to: highSecDoor + completed: + - !type:GivePrototype + prototype: SheetPlasteel1 + amount: 2 + conditions: + - !type:WirePanel {} + - !type:HasTag + tag: HighSecDoor + steps: + - tool: Prying + doAfter: 4 + + - to: highSecurity + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 5 + + - node: highSecurity + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level4 + wiresAccessible: false + weldingAllowed: false + edges: + - to: highSecurityUnfinished + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 15 + + - to: maxSecurity + conditions: + - !type:WirePanel {} + steps: + - material: MetalRod + amount: 2 + doAfter: 1 + +## Max security level door: an electric grill is added + - node: maxSecurity + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level5 + wiresAccessible: false + weldingAllowed: true + edges: + - to: highSecurity + completed: + - !type:AttemptElectrocute + - !type:GivePrototype + prototype: PartRodMetal1 + amount: 2 + conditions: + - !type:WirePanel {} + steps: + - tool: Cutting + doAfter: 0.5 + + - to: superMaxSecurityUnfinished + conditions: + - !type:WirePanel {} + steps: + - material: Plasteel + amount: 2 + doAfter: 2 + +## Super max security level door: an additional layer of plasteel is added + - node: superMaxSecurityUnfinished + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level6 + wiresAccessible: false + weldingAllowed: false + edges: + - to: maxSecurity + completed: + - !type:GivePrototype + prototype: SheetPlasteel1 + amount: 2 + conditions: + - !type:WirePanel {} + steps: + - tool: Prying + doAfter: 4 + + - to: superMaxSecurity + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 5 + + - node: superMaxSecurity + actions: + - !type:SetWiresPanelSecurity + examine: wires-panel-component-on-examine-security-level7 + wiresAccessible: false + weldingAllowed: false + edges: + - to: superMaxSecurityUnfinished + conditions: + - !type:WirePanel {} + steps: + - tool: Welding + doAfter: 15 diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml deleted file mode 100644 index d6b9e30682db..000000000000 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock_security.yml +++ /dev/null @@ -1,166 +0,0 @@ -- type: constructionGraph - id: AirlockSecurity - start: unsecuredAirlock - graph: - - node: unsecuredAirlock - actions: - - !type:SetWiresPanelSecurity - wiresAccessible: true - weldingAllowed: true - - !type:RemoveWiresPanelSecurity - -## Medium security level door: a layer of steel plating protects the internal wiring - - node: medSecurityUnfinished - actions: - - !type:SetWiresPanelSecurity - examine: wires-panel-component-on-examine-security-level1 - wiresAccessible: false - weldingAllowed: false - edges: - - to: unsecuredAirlock - completed: - - !type:GivePrototype - prototype: SheetSteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: medSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 3 - - - node: medSecurity - actions: - - !type:SetWiresPanelSecurity - examine: wires-panel-component-on-examine-security-level2 - wiresAccessible: false - weldingAllowed: false - edges: - - to: medSecurityUnfinished - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 10 - -## High security level door: a layer of plasteel plating protects the internal wiring - - node: highSecurityUnfinished - actions: - - !type:SetWiresPanelSecurity - examine: wires-panel-component-on-examine-security-level3 - wiresAccessible: false - weldingAllowed: false - edges: - - to: unsecuredAirlock - completed: - - !type:GivePrototype - prototype: SheetPlasteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: highSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 5 - - - node: highSecurity - actions: - - !type:SetWiresPanelSecurity - examine: wires-panel-component-on-examine-security-level4 - wiresAccessible: false - weldingAllowed: false - edges: - - to: highSecurityUnfinished - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 15 - - - to: maxSecurity - conditions: - - !type:WirePanel {} - steps: - - material: MetalRod - amount: 2 - doAfter: 1 - -## Max security level door: an electric grill is added - - node: maxSecurity - actions: - - !type:SetWiresPanelSecurity - examine: wires-panel-component-on-examine-security-level5 - wiresAccessible: false - weldingAllowed: true - edges: - - to: highSecurity - completed: - - !type:AttemptElectrocute - - !type:GivePrototype - prototype: PartRodMetal1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Cutting - doAfter: 0.5 - - - to: superMaxSecurityUnfinished - conditions: - - !type:WirePanel {} - steps: - - material: Plasteel - amount: 2 - doAfter: 2 - -## Super max security level door: an additional layer of plasteel is added - - node: superMaxSecurityUnfinished - actions: - - !type:SetWiresPanelSecurity - examine: wires-panel-component-on-examine-security-level6 - wiresAccessible: false - weldingAllowed: false - edges: - - to: maxSecurity - completed: - - !type:GivePrototype - prototype: SheetPlasteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: superMaxSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 5 - - - node: superMaxSecurity - actions: - - !type:SetWiresPanelSecurity - examine: wires-panel-component-on-examine-security-level7 - wiresAccessible: false - weldingAllowed: false - edges: - - to: superMaxSecurityUnfinished - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 15 diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index d4fb34b54798..7545eb202be3 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -3,6 +3,9 @@ - type: Tag id: AirAlarmElectronics + +- type: Tag + id: Airlock - type: Tag id: AirSensor @@ -484,6 +487,9 @@ - type: Tag id: GeigerCounter + +- type: Tag + id: GlassAirlock - type: Tag id: GlassBeaker @@ -500,7 +506,6 @@ - type: Tag id: GuideEmbeded - - type: Tag id: Hamster @@ -551,6 +556,9 @@ - type: Tag id: HighRiskItem + +- type: Tag + id: HighSecDoor - type: Tag id: Hoe From c8bb8b3866cc7898354f67190904fc043014168d Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 16 Sep 2023 13:23:52 -0500 Subject: [PATCH 4/8] Removed unnecessary file and debugging messages --- .../Construction/Conditions/HasTag.cs | 2 - .../Graphs/structures/highsec.yml | 166 ------------------ 2 files changed, 168 deletions(-) delete mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/structures/highsec.yml diff --git a/Content.Server/Construction/Conditions/HasTag.cs b/Content.Server/Construction/Conditions/HasTag.cs index 1c4863606ea1..318485b52600 100644 --- a/Content.Server/Construction/Conditions/HasTag.cs +++ b/Content.Server/Construction/Conditions/HasTag.cs @@ -18,8 +18,6 @@ public bool Condition(EntityUid uid, IEntityManager entityManager) { if (!entityManager.TrySystem(out var tagSystem)) return false; - Logger.Debug("Tag: " + Tag); - Logger.Debug("Test: " + tagSystem.HasTag(uid, Tag)); return tagSystem.HasTag(uid, Tag); } diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/highsec.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/highsec.yml deleted file mode 100644 index 49da4d46ec6f..000000000000 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/highsec.yml +++ /dev/null @@ -1,166 +0,0 @@ -- type: constructionGraph - id: HighSecDoor - start: start - graph: - - node: start - actions: - - !type:SetWiresPanelSecurity - level: Level0 - edges: - - to: medSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - material: Steel - amount: 2 - doAfter: 2 - - - to: highSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - material: Plasteel - amount: 2 - doAfter: 2 - -## Medium security level door: a layer of steel plating protects the internal wiring - - node: medSecurityBreached - actions: - - !type:SetWiresPanelSecurity - level: Level1 - edges: - - to: start - completed: - - !type:GivePrototype - prototype: SheetSteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: medSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 3 - - - node: medSecurity - actions: - - !type:SetWiresPanelSecurity - level: Level2 - edges: - - to: medSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 10 - -## High security level door: a layer of plasteel plating protects the internal wiring - - node: highSecurityBreached - actions: - - !type:SetWiresPanelSecurity - level: Level3 - edges: - - to: start - completed: - - !type:GivePrototype - prototype: SheetPlasteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: highSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 5 - - - node: highSecurity - actions: - - !type:SetWiresPanelSecurity - level: Level4 - edges: - - to: highSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 15 - - - to: maxSecurity - conditions: - - !type:WirePanel {} - steps: - - material: MetalRod - amount: 2 - doAfter: 1 - -## Max security level door: an electric grill is added - - node: maxSecurity - actions: - - !type:SetWiresPanelSecurity - level: Level5 - edges: - - to: highSecurity - completed: - - !type:AttemptElectrocute - - !type:GivePrototype - prototype: PartRodMetal1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Cutting - doAfter: 0.5 - - - to: superMaxSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - material: Plasteel - amount: 2 - doAfter: 2 - -## Super max security level door: an additional layer of plasteel is added - - node: superMaxSecurityBreached - actions: - - !type:SetWiresPanelSecurity - level: Level6 - edges: - - to: maxSecurity - completed: - - !type:GivePrototype - prototype: SheetPlasteel1 - amount: 2 - conditions: - - !type:WirePanel {} - steps: - - tool: Prying - doAfter: 4 - - - to: superMaxSecurity - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 5 - - - node: superMaxSecurity - actions: - - !type:SetWiresPanelSecurity - level: Level7 - edges: - - to: superMaxSecurityBreached - conditions: - - !type:WirePanel {} - steps: - - tool: Welding - doAfter: 15 From 94b91bde9c9e80626bbdbaf28d99ad6d7da6e2bd Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 16 Sep 2023 13:31:01 -0500 Subject: [PATCH 5/8] Better method for changing entities --- .../Construction/Completions/ChangeEntity.cs | 2 +- .../Construction/ConstructionSystem.Graph.cs | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Content.Server/Construction/Completions/ChangeEntity.cs b/Content.Server/Construction/Completions/ChangeEntity.cs index eaa7a7d5c68d..4642b0f1d2ee 100644 --- a/Content.Server/Construction/Completions/ChangeEntity.cs +++ b/Content.Server/Construction/Completions/ChangeEntity.cs @@ -17,7 +17,7 @@ public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager enti if (entityManager.TrySystem(out ConstructionSystem? constructionSystem)) { - constructionSystem.ChangeEntity(uid, userUid, Prototype); + constructionSystem.TryChangeEntity(uid, userUid, Prototype, out var _); } } } diff --git a/Content.Server/Construction/ConstructionSystem.Graph.cs b/Content.Server/Construction/ConstructionSystem.Graph.cs index 59929971f325..a736f565c515 100644 --- a/Content.Server/Construction/ConstructionSystem.Graph.cs +++ b/Content.Server/Construction/ConstructionSystem.Graph.cs @@ -271,6 +271,19 @@ public bool ChangeNode(EntityUid uid, EntityUid? userUid, string id, bool perfor return true; } + /// + /// Attempts to change an entity prototype change on a construction entity. + /// + public bool TryChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity, out EntityUid? newUid, + ConstructionComponent? construction = null, + MetaDataComponent? metaData = null, + TransformComponent? transform = null, + ContainerManagerComponent? containerManager = null) + { + newUid = ChangeEntity(uid, userUid, newEntity, construction, metaData, transform, containerManager); + return newUid != null; + } + /// /// Performs an entity prototype change on a construction entity. /// The old entity will be removed, and a new one will be spawned in its place. Some values will be kept, @@ -285,7 +298,7 @@ public bool ChangeNode(EntityUid uid, EntityUid? userUid, string id, bool perfor /// The container manager component of the target entity. Will be resolved if null, /// but it is an optional component and not required for the method to work. /// The new entity, or null if the method did not succeed. - public EntityUid? ChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity, + private EntityUid? ChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity, ConstructionComponent? construction = null, MetaDataComponent? metaData = null, TransformComponent? transform = null, From 098e51bf2d1cb5de3a1c16d73763f89cd7f49d22 Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sat, 16 Sep 2023 15:42:34 -0500 Subject: [PATCH 6/8] Revised how entities be can changed between nodes --- .../Construction/Completions/ChangeEntity.cs | 23 ----------------- .../Construction/ConstructionSystem.Graph.cs | 25 +++++++++---------- .../Construction/ConstructionGraphNode.cs | 5 +++- .../Graphs/structures/airlock.yml | 10 +++----- 4 files changed, 20 insertions(+), 43 deletions(-) delete mode 100644 Content.Server/Construction/Completions/ChangeEntity.cs diff --git a/Content.Server/Construction/Completions/ChangeEntity.cs b/Content.Server/Construction/Completions/ChangeEntity.cs deleted file mode 100644 index 4642b0f1d2ee..000000000000 --- a/Content.Server/Construction/Completions/ChangeEntity.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Content.Shared.Construction; -using JetBrains.Annotations; - -namespace Content.Server.Construction.Completions; - -[UsedImplicitly] -[DataDefinition] -public sealed partial class ChangeEntity : IGraphAction -{ - [DataField("prototype", required: true)] - public string Prototype = string.Empty; - - public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) - { - if (Prototype == null) - return; - - if (entityManager.TrySystem(out ConstructionSystem? constructionSystem)) - { - constructionSystem.TryChangeEntity(uid, userUid, Prototype, out var _); - } - } -} diff --git a/Content.Server/Construction/ConstructionSystem.Graph.cs b/Content.Server/Construction/ConstructionSystem.Graph.cs index a736f565c515..6e6565434c06 100644 --- a/Content.Server/Construction/ConstructionSystem.Graph.cs +++ b/Content.Server/Construction/ConstructionSystem.Graph.cs @@ -8,6 +8,7 @@ using Robust.Server.Containers; using Robust.Shared.Containers; using Robust.Shared.Prototypes; +using System.Linq; namespace Content.Server.Construction { @@ -271,19 +272,6 @@ public bool ChangeNode(EntityUid uid, EntityUid? userUid, string id, bool perfor return true; } - /// - /// Attempts to change an entity prototype change on a construction entity. - /// - public bool TryChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity, out EntityUid? newUid, - ConstructionComponent? construction = null, - MetaDataComponent? metaData = null, - TransformComponent? transform = null, - ContainerManagerComponent? containerManager = null) - { - newUid = ChangeEntity(uid, userUid, newEntity, construction, metaData, transform, containerManager); - return newUid != null; - } - /// /// Performs an entity prototype change on a construction entity. /// The old entity will be removed, and a new one will be spawned in its place. Some values will be kept, @@ -311,9 +299,20 @@ public bool TryChangeEntity(EntityUid uid, EntityUid? userUid, string newEntity, throw new Exception("Missing construction components"); } + // Skip if the new entity's prototype is the same as the original, or the prototype is invalid if (newEntity == metaData.EntityPrototype?.ID || !_prototypeManager.HasIndex(newEntity)) return null; + // Optional skip if the new entity's prototype is a parent of the original + if (GetCurrentNode(uid, construction)?.ChildrenIgnoreEntity == true && + metaData.EntityPrototype?.ID != null) + { + var parents = _prototypeManager.EnumerateParents(metaData.EntityPrototype.ID)?.ToList(); + + if (parents != null && parents.Any(x => x.ID == newEntity)) + return null; + } + // Optional resolves. Resolve(uid, ref containerManager, false); diff --git a/Content.Shared/Construction/ConstructionGraphNode.cs b/Content.Shared/Construction/ConstructionGraphNode.cs index 265463c2431e..abd96ba404f5 100644 --- a/Content.Shared/Construction/ConstructionGraphNode.cs +++ b/Content.Shared/Construction/ConstructionGraphNode.cs @@ -1,4 +1,4 @@ -using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.CodeAnalysis; using Content.Shared.Construction.NodeEntities; using Content.Shared.Construction.Serialization; using Robust.Shared.Prototypes; @@ -31,6 +31,9 @@ public sealed partial class ConstructionGraphNode [DataField("entity", customTypeSerializer: typeof(GraphNodeEntitySerializer), serverOnly:true)] public IGraphNodeEntity Entity { get; private set; } = new NullNodeEntity(); + [DataField("childrenIgnoreEntity")] + public bool ChildrenIgnoreEntity = false; + public ConstructionGraphEdge? GetEdge(string target) { foreach (var edge in _edges) diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml index 5a76175b77ef..d884c9752243 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml @@ -67,9 +67,6 @@ - to: airlock conditions: - !type:EntityAnchored {} - completed: - - !type:ChangeEntity - prototype: Airlock steps: - tool: Screwing doAfter: 2.5 @@ -95,9 +92,6 @@ - to: glassAirlock conditions: - !type:EntityAnchored {} - completed: - - !type:ChangeEntity - prototype: AirlockGlass steps: - material: ReinforcedGlass amount: 1 @@ -118,6 +112,8 @@ ## Glass airlock - node: glassAirlock + entity: AirlockGlass + childrenIgnoreEntity: true actions: - !type:SetWiresPanelSecurity wiresAccessible: true @@ -157,6 +153,8 @@ ## Standard airlock - node: airlock + entity: Airlock + childrenIgnoreEntity: true actions: - !type:SetWiresPanelSecurity wiresAccessible: true From e404286c32f5ed2ab63ee608354f9a24afaa7ece Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Tue, 19 Sep 2023 13:38:05 -0500 Subject: [PATCH 7/8] Made requested changes --- .../Completions/SetWiresPanelSecurity.cs | 13 +++++++++++++ Content.Server/Construction/Conditions/HasTag.cs | 6 ++++++ .../Construction/ConstructionSystem.Graph.cs | 2 +- Content.Server/Wires/WiresSystem.cs | 4 ++-- .../Construction/ConstructionGraphNode.cs | 12 ++++++++++-- .../Construction/Graphs/structures/airlock.yml | 4 ++-- 6 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs b/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs index 9e5e6d461d81..842e08bd7e42 100644 --- a/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs +++ b/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs @@ -4,16 +4,29 @@ namespace Content.Server.Construction.Completions; +/// +/// This graph action is used to set values on entities with the +/// + [UsedImplicitly] [DataDefinition] public sealed partial class SetWiresPanelSecurity : IGraphAction { + /// + /// Sets the Examine field on the entity's + /// [DataField("examine")] public string Examine = string.Empty; + /// + /// Sets the WiresAccessible field on the entity's + /// [DataField("wiresAccessible")] public bool WiresAccessible = true; + /// + /// Sets the WeldingAllowed field on the entity's + /// [DataField("weldingAllowed")] public bool WeldingAllowed = true; diff --git a/Content.Server/Construction/Conditions/HasTag.cs b/Content.Server/Construction/Conditions/HasTag.cs index 318485b52600..b89dbbfd4905 100644 --- a/Content.Server/Construction/Conditions/HasTag.cs +++ b/Content.Server/Construction/Conditions/HasTag.cs @@ -7,10 +7,16 @@ namespace Content.Server.Construction.Conditions { + /// + /// This condition checks whether if an entity with the possesses a specific tag + /// [UsedImplicitly] [DataDefinition] public sealed partial class HasTag : IGraphCondition { + /// + /// The tag the entity is being checked for + /// [DataField("tag")] public string Tag { get; private set; } diff --git a/Content.Server/Construction/ConstructionSystem.Graph.cs b/Content.Server/Construction/ConstructionSystem.Graph.cs index 6e6565434c06..b10205338c3a 100644 --- a/Content.Server/Construction/ConstructionSystem.Graph.cs +++ b/Content.Server/Construction/ConstructionSystem.Graph.cs @@ -304,7 +304,7 @@ public bool ChangeNode(EntityUid uid, EntityUid? userUid, string id, bool perfor return null; // Optional skip if the new entity's prototype is a parent of the original - if (GetCurrentNode(uid, construction)?.ChildrenIgnoreEntity == true && + if (GetCurrentNode(uid, construction)?.DoNotReplaceInheritingEntities == true && metaData.EntityPrototype?.ID != null) { var parents = _prototypeManager.EnumerateParents(metaData.EntityPrototype.ID)?.ToList(); diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index 574525f1c418..b780a2ab2e9e 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -35,7 +35,7 @@ public sealed class WiresSystem : SharedWiresSystem [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly ConstructionSystem _constructionSystem = default!; + [Dependency] private readonly ConstructionSystem _construction = default!; // This is where all the wire layouts are stored. [ViewVariables] private readonly Dictionary _layouts = new(); @@ -533,7 +533,7 @@ private void OnMapInit(EntityUid uid, WiresComponent component, MapInitEvent arg if (TryComp(uid, out var wiresPanelSecurity) && !string.IsNullOrEmpty(wiresPanelSecurity.SecurityLevel) && TryComp(uid, out var construction)) - _constructionSystem.ChangeNode(uid, null, wiresPanelSecurity.SecurityLevel, true, construction); + _construction.ChangeNode(uid, null, wiresPanelSecurity.SecurityLevel, true, construction); UpdateUserInterface(uid); } diff --git a/Content.Shared/Construction/ConstructionGraphNode.cs b/Content.Shared/Construction/ConstructionGraphNode.cs index abd96ba404f5..39680ad109cd 100644 --- a/Content.Shared/Construction/ConstructionGraphNode.cs +++ b/Content.Shared/Construction/ConstructionGraphNode.cs @@ -31,8 +31,16 @@ public sealed partial class ConstructionGraphNode [DataField("entity", customTypeSerializer: typeof(GraphNodeEntitySerializer), serverOnly:true)] public IGraphNodeEntity Entity { get; private set; } = new NullNodeEntity(); - [DataField("childrenIgnoreEntity")] - public bool ChildrenIgnoreEntity = false; + /// + /// Ignore requests to change the entity if the entity's current prototype inherits from specified replacement + /// + /// + /// When this bool is true and a construction node specifies that the current entity should be replaced with a new entity, + /// if the current entity has an entity prototype which inherits from the replacement entity prototype, + /// entity replacement will not occur + /// + [DataField("doNotReplaceInheritingEntities")] + public bool DoNotReplaceInheritingEntities = false; public ConstructionGraphEdge? GetEdge(string target) { diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml index d884c9752243..4ddeb3851960 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/airlock.yml @@ -113,7 +113,7 @@ ## Glass airlock - node: glassAirlock entity: AirlockGlass - childrenIgnoreEntity: true + doNotReplaceInheritingEntities: true actions: - !type:SetWiresPanelSecurity wiresAccessible: true @@ -154,7 +154,7 @@ ## Standard airlock - node: airlock entity: Airlock - childrenIgnoreEntity: true + doNotReplaceInheritingEntities: true actions: - !type:SetWiresPanelSecurity wiresAccessible: true From 12dad2110c2ea9a9568d1ee6835672811dfd17da Mon Sep 17 00:00:00 2001 From: chromiumboy Date: Sun, 1 Oct 2023 21:36:12 -0500 Subject: [PATCH 8/8] Made requested changes, also cleaned up how door welding with hacking protections handled --- .../Completions/SetWiresPanelSecurity.cs | 8 +------- .../Construction/ConstructionSystem.Graph.cs | 7 +++++-- .../ConstructionSystem.Interactions.cs | 3 ++- Content.Server/Wires/WiresSystem.cs | 4 +++- .../Construction/ConstructionGraphNode.cs | 9 ++++++--- Content.Shared/Wires/SharedWiresSystem.cs | 11 ----------- .../Wires/WiresPanelSecurityComponent.cs | 14 +------------- .../Structures/Doors/Airlocks/airlocks.yml | 2 +- .../Doors/Airlocks/base_structureairlocks.yml | 3 ++- .../Entities/Structures/Doors/Airlocks/highsec.yml | 3 ++- 10 files changed, 23 insertions(+), 41 deletions(-) diff --git a/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs b/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs index 842e08bd7e42..fc718249c26b 100644 --- a/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs +++ b/Content.Server/Construction/Completions/SetWiresPanelSecurity.cs @@ -24,17 +24,11 @@ public sealed partial class SetWiresPanelSecurity : IGraphAction [DataField("wiresAccessible")] public bool WiresAccessible = true; - /// - /// Sets the WeldingAllowed field on the entity's - /// - [DataField("weldingAllowed")] - public bool WeldingAllowed = true; - public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) { if (entityManager.TryGetComponent(uid, out WiresPanelSecurityComponent? _)) { - var ev = new WiresPanelSecurityEvent(Examine, WiresAccessible, WeldingAllowed); + var ev = new WiresPanelSecurityEvent(Examine, WiresAccessible); entityManager.EventBus.RaiseLocalEvent(uid, ev); } } diff --git a/Content.Server/Construction/ConstructionSystem.Graph.cs b/Content.Server/Construction/ConstructionSystem.Graph.cs index b10205338c3a..be8b0e688dd5 100644 --- a/Content.Server/Construction/ConstructionSystem.Graph.cs +++ b/Content.Server/Construction/ConstructionSystem.Graph.cs @@ -299,11 +299,14 @@ public bool ChangeNode(EntityUid uid, EntityUid? userUid, string id, bool perfor throw new Exception("Missing construction components"); } - // Skip if the new entity's prototype is the same as the original, or the prototype is invalid + // Exit if the new entity's prototype is the same as the original, or the prototype is invalid if (newEntity == metaData.EntityPrototype?.ID || !_prototypeManager.HasIndex(newEntity)) return null; - // Optional skip if the new entity's prototype is a parent of the original + // [Optional] Exit if the new entity's prototype is a parent of the original + // E.g., if an entity with the 'AirlockCommand' prototype was to be replaced with a new entity that + // had the 'Airlock' prototype, and DoNotReplaceInheritingEntities was true, the code block would + // exit here because 'AirlockCommand' is derived from 'Airlock' if (GetCurrentNode(uid, construction)?.DoNotReplaceInheritingEntities == true && metaData.EntityPrototype?.ID != null) { diff --git a/Content.Server/Construction/ConstructionSystem.Interactions.cs b/Content.Server/Construction/ConstructionSystem.Interactions.cs index e2e99ad74eaa..21daabdb5da6 100644 --- a/Content.Server/Construction/ConstructionSystem.Interactions.cs +++ b/Content.Server/Construction/ConstructionSystem.Interactions.cs @@ -12,6 +12,7 @@ using Content.Shared.Prying.Systems; using Content.Shared.Radio.EntitySystems; using Content.Shared.Tools.Components; +using Content.Shared.Tools.Systems; using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Utility; @@ -38,7 +39,7 @@ private void InitializeInteractions() // Event handling. Add your subscriptions here! Just make sure they're all handled by EnqueueEvent. SubscribeLocalEvent(EnqueueEvent, - new []{typeof(AnchorableSystem), typeof(PryingSystem) }, + new []{typeof(AnchorableSystem), typeof(PryingSystem), typeof(WeldableSystem)}, new []{typeof(EncryptionKeySystem)}); SubscribeLocalEvent(EnqueueEvent); SubscribeLocalEvent(EnqueueEvent); diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index b780a2ab2e9e..37b6282bb646 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -530,10 +530,13 @@ private void OnMapInit(EntityUid uid, WiresComponent component, MapInitEvent arg if (component.WireSeed == 0) component.WireSeed = _random.Next(1, int.MaxValue); + // Update the construction graph to make sure that it starts on the node specified by WiresPanelSecurityComponent if (TryComp(uid, out var wiresPanelSecurity) && !string.IsNullOrEmpty(wiresPanelSecurity.SecurityLevel) && TryComp(uid, out var construction)) + { _construction.ChangeNode(uid, null, wiresPanelSecurity.SecurityLevel, true, construction); + } UpdateUserInterface(uid); } @@ -669,7 +672,6 @@ public void SetWiresPanelSecurity(EntityUid uid, WiresPanelSecurityComponent com { component.Examine = args.Examine; component.WiresAccessible = args.WiresAccessible; - component.WeldingAllowed = args.WeldingAllowed; Dirty(uid, component); diff --git a/Content.Shared/Construction/ConstructionGraphNode.cs b/Content.Shared/Construction/ConstructionGraphNode.cs index 39680ad109cd..fd70569e9daa 100644 --- a/Content.Shared/Construction/ConstructionGraphNode.cs +++ b/Content.Shared/Construction/ConstructionGraphNode.cs @@ -35,9 +35,12 @@ public sealed partial class ConstructionGraphNode /// Ignore requests to change the entity if the entity's current prototype inherits from specified replacement /// /// - /// When this bool is true and a construction node specifies that the current entity should be replaced with a new entity, - /// if the current entity has an entity prototype which inherits from the replacement entity prototype, - /// entity replacement will not occur + /// When this bool is true and a construction node specifies that the current entity should be replaced with a new entity, if the + /// current entity has an entity prototype which inherits from the replacement entity prototype, entity replacement will not occur. + /// E.g., if an entity with the 'AirlockCommand' prototype was to be replaced with a new entity that had the 'Airlock' prototype, + /// and 'DoNotReplaceInheritingEntities' was true, the entity would not be replaced because 'AirlockCommand' is derived from 'Airlock' + /// This will largely be used for construction graphs which have removeable upgrades, such as hacking protections for airlocks, + /// so that the upgrades can be removed and you can return to the last primary construction step without replacing the entity /// [DataField("doNotReplaceInheritingEntities")] public bool DoNotReplaceInheritingEntities = false; diff --git a/Content.Shared/Wires/SharedWiresSystem.cs b/Content.Shared/Wires/SharedWiresSystem.cs index f76dea80ea82..50465537e8cc 100644 --- a/Content.Shared/Wires/SharedWiresSystem.cs +++ b/Content.Shared/Wires/SharedWiresSystem.cs @@ -11,7 +11,6 @@ public override void Initialize() base.Initialize(); SubscribeLocalEvent(OnExamine); - SubscribeLocalEvent(OnWeldableAttempt); } private void OnExamine(EntityUid uid, WiresPanelComponent component, ExaminedEvent args) @@ -31,14 +30,4 @@ private void OnExamine(EntityUid uid, WiresPanelComponent component, ExaminedEve } } } - - private void OnWeldableAttempt(EntityUid uid, WiresPanelComponent component, WeldableAttemptEvent args) - { - if (component.Open && - TryComp(uid, out var wiresPanelSecurity) && - !wiresPanelSecurity.WeldingAllowed) - { - args.Cancel(); - } - } } diff --git a/Content.Shared/Wires/WiresPanelSecurityComponent.cs b/Content.Shared/Wires/WiresPanelSecurityComponent.cs index d2804fa84ec3..e894f1f0c9e5 100644 --- a/Content.Shared/Wires/WiresPanelSecurityComponent.cs +++ b/Content.Shared/Wires/WiresPanelSecurityComponent.cs @@ -26,16 +26,6 @@ public sealed partial class WiresPanelSecurityComponent : Component [AutoNetworkedField] public bool WiresAccessible = true; - /// - /// Determines whether the device can be welded shut or not - /// - /// - /// Should be set false when you need to weld/unweld something to/from the wire panel - /// - [DataField("weldingAllowed")] - [AutoNetworkedField] - public bool WeldingAllowed = true; - /// /// Name of the construction graph node that the entity will start on /// @@ -51,12 +41,10 @@ public sealed class WiresPanelSecurityEvent : EntityEventArgs { public readonly string? Examine; public readonly bool WiresAccessible; - public readonly bool WeldingAllowed; - public WiresPanelSecurityEvent(string? examine, bool wiresAccessible, bool weldingAllowed) + public WiresPanelSecurityEvent(string? examine, bool wiresAccessible) { Examine = examine; WiresAccessible = wiresAccessible; - WeldingAllowed = weldingAllowed; } } diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml index 419a4dc7f6f4..940e2e8b36cb 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml @@ -139,7 +139,7 @@ - type: Tag tags: - GlassAirlock - + # This tag is used to nagivate the Airlock construction graph. It's needed because the construction graph is shared between Airlock, AirlockGlass, and HighSecDoor - type: entity parent: AirlockGlass id: AirlockEngineeringGlass diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml index 1b8e0c2ecd23..51d3cfdda098 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml @@ -134,7 +134,8 @@ price: 150 - type: Tag tags: - - Airlock + - Airlock + # This tag is used to nagivate the Airlock construction graph. It's needed because the construction graph is shared between Airlock, AirlockGlass, and HighSecDoor placement: mode: SnapgridCenter diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml index fac04c2b1725..c653d2d0100f 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml @@ -99,4 +99,5 @@ node: highSecDoor - type: Tag tags: - - HighSecDoor \ No newline at end of file + - HighSecDoor + # This tag is used to nagivate the Airlock construction graph. It's needed because this construction graph is shared between Airlock, AirlockGlass, and HighSecDoor \ No newline at end of file