From 90a5c6ea54cab69bea3abd7242f9dc1a277c1999 Mon Sep 17 00:00:00 2001 From: Jack Fox <35575261+DubiousDoggo@users.noreply.github.com> Date: Sat, 22 Jan 2022 06:54:26 -0600 Subject: [PATCH] Disposal Pipe Crafting (#6188) --- .../Visualizers/DisposalVisualizer.cs | 4 - .../Tube/Components/DisposalTubeComponent.cs | 18 +-- .../Components/SharedDisposalTubeComponent.cs | 1 - .../Structures/Piping/Disposal/pipes.yml | 57 +++++-- .../Graphs/utilities/disposal_pipes.yml | 144 ++++++++++++++++++ .../Recipes/Construction/utilities.yml | 100 +++++++++++- 6 files changed, 291 insertions(+), 33 deletions(-) create mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/utilities/disposal_pipes.yml diff --git a/Content.Client/Disposal/Visualizers/DisposalVisualizer.cs b/Content.Client/Disposal/Visualizers/DisposalVisualizer.cs index 98b9a33eea..dffaf8b7e2 100644 --- a/Content.Client/Disposal/Visualizers/DisposalVisualizer.cs +++ b/Content.Client/Disposal/Visualizers/DisposalVisualizer.cs @@ -18,9 +18,6 @@ namespace Content.Client.Disposal.Visualizers [DataField("state_anchored")] private string? _stateAnchored; - [DataField("state_broken")] - private string? _stateBroken; - private void ChangeState(AppearanceComponent appearance) { var entities = IoCManager.Resolve(); @@ -38,7 +35,6 @@ namespace Content.Client.Disposal.Visualizers { DisposalTubeVisualState.Free => _stateFree, DisposalTubeVisualState.Anchored => _stateAnchored, - DisposalTubeVisualState.Broken => _stateBroken, _ => throw new ArgumentOutOfRangeException() }; diff --git a/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs b/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs index c815119c90..1358db6931 100644 --- a/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs +++ b/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs @@ -26,7 +26,6 @@ namespace Content.Server.Disposal.Tube.Components public TimeSpan LastClang; private bool _connected; - private bool _broken; [DataField("clangSound")] public SoundSpecifier ClangSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg"); /// @@ -51,7 +50,7 @@ namespace Content.Server.Disposal.Tube.Components // TODO: Make disposal pipes extend the grid private void Connect() { - if (_connected || _broken) + if (_connected) { return; } @@ -66,11 +65,6 @@ namespace Content.Server.Disposal.Tube.Components return false; } - if (_broken) - { - return false; - } - if (!ConnectableDirections().Contains(direction)) { return false; @@ -113,11 +107,9 @@ namespace Content.Server.Disposal.Tube.Components return; } - var state = _broken - ? DisposalTubeVisualState.Broken - : Anchored - ? DisposalTubeVisualState.Anchored - : DisposalTubeVisualState.Free; + var state = Anchored + ? DisposalTubeVisualState.Anchored + : DisposalTubeVisualState.Free; appearance.SetData(DisposalTubeVisuals.VisualState, state); } @@ -182,9 +174,7 @@ namespace Content.Server.Disposal.Tube.Components void IBreakAct.OnBreak(BreakageEventArgs eventArgs) { - _broken = true; // TODO: Repair Disconnect(); - UpdateVisualState(); } } } diff --git a/Content.Shared/Disposal/Components/SharedDisposalTubeComponent.cs b/Content.Shared/Disposal/Components/SharedDisposalTubeComponent.cs index fc6bec2178..2ae8747baf 100644 --- a/Content.Shared/Disposal/Components/SharedDisposalTubeComponent.cs +++ b/Content.Shared/Disposal/Components/SharedDisposalTubeComponent.cs @@ -14,6 +14,5 @@ namespace Content.Shared.Disposal.Components { Free = 0, Anchored, - Broken, } } diff --git a/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml b/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml index 1f0a90ef86..780abda3fb 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml @@ -34,6 +34,8 @@ behaviors: - !type:DoActsBehavior acts: ["Breakage"] + - !type:ChangeConstructionNodeBehavior + node: broken - type: Rotatable - type: Pullable @@ -46,6 +48,31 @@ # Pipes +- type: entity + id: DisposalPipeBroken + parent: DisposalPipeBase + name: broken disposal pipe + description: A BBP (big broken pipe) + components: + - type: Sprite + drawdepth: ThickPipe + sprite: Structures/Piping/disposal.rsi + state: pipe-b + - type: Appearance + visuals: + - type: TrayScannerSubFloorVisualizer + - type: SubFloorShowLayerVisualizer + - type: Physics + - type: Fixtures + fixtures: + - shape: + !type:PhysShapeAabb + bounds: "-0.25,-0.5,0.25,0.5" + layer: [ Underplating ] + - type: Construction + graph: DisposalPipe + node: broken + - type: entity id: DisposalPipe parent: DisposalPipeBase @@ -64,7 +91,6 @@ - type: DisposalVisualizer state_free: conpipe-s state_anchored: pipe-s - state_broken: pipe-b - type: Physics - type: Fixtures fixtures: @@ -72,6 +98,9 @@ !type:PhysShapeAabb bounds: "-0.25,-0.5,0.25,0.5" layer: [ Underplating ] + - type: Construction + graph: DisposalPipe + node: pipe - type: entity id: DisposalTagger @@ -91,7 +120,6 @@ - type: DisposalVisualizer state_free: conpipe-tagger state_anchored: pipe-tagger - state_broken: pipe-b - type: UserInterface interfaces: - key: enum.DisposalTaggerUiKey.Key @@ -103,6 +131,9 @@ !type:PhysShapeAabb bounds: "-0.25,-0.5,0.25,0.5" layer: [ Underplating ] + - type: Construction + graph: DisposalPipe + node: tagger - type: entity id: DisposalTrunk @@ -122,7 +153,6 @@ - type: DisposalVisualizer state_free: conpipe-t state_anchored: pipe-t - state_broken: pipe-b - type: Physics - type: Fixtures fixtures: @@ -130,6 +160,9 @@ !type:PhysShapeAabb bounds: "-0.25,-0.5,0.25,0.4" layer: [ Underplating ] + - type: Construction + graph: DisposalPipe + node: trunk - type: entity id: DisposalRouter @@ -153,7 +186,6 @@ - type: DisposalVisualizer state_free: conpipe-j1s state_anchored: pipe-j1s - state_broken: pipe-b - type: Flippable mirrorEntity: DisposalRouterFlipped - type: UserInterface @@ -167,6 +199,9 @@ !type:PhysShapeAabb bounds: "-0.5,-0.5,0.25,0.5" layer: [ Underplating ] + - type: Construction + graph: DisposalPipe + node: router - type: entity id: DisposalRouterFlipped @@ -189,7 +224,6 @@ - type: DisposalVisualizer state_free: conpipe-j2s state_anchored: pipe-j2s - state_broken: pipe-b - type: Flippable mirrorEntity: DisposalRouter - type: Physics @@ -222,7 +256,6 @@ - type: DisposalVisualizer state_free: conpipe-j1 state_anchored: pipe-j1 - state_broken: pipe-b - type: Flippable mirrorEntity: DisposalJunctionFlipped - type: Physics @@ -232,6 +265,9 @@ !type:PhysShapeAabb bounds: "-0.5,-0.5,0.25,0.5" layer: [ Underplating ] + - type: Construction + graph: DisposalPipe + node: junction - type: entity id: DisposalJunctionFlipped @@ -254,7 +290,6 @@ - type: DisposalVisualizer state_free: conpipe-j2 state_anchored: pipe-j2 - state_broken: pipe-b - type: Flippable mirrorEntity: DisposalJunction - type: Physics @@ -287,7 +322,6 @@ - type: DisposalVisualizer state_free: conpipe-y state_anchored: pipe-y - state_broken: pipe-b - type: Physics - type: Fixtures fixtures: @@ -295,6 +329,9 @@ !type:PhysShapeAabb bounds: "-0.5,-0.5,0.5,0.25" layer: [ Underplating ] + - type: Construction + graph: DisposalPipe + node: yJunction - type: entity id: DisposalBend @@ -314,7 +351,6 @@ - type: DisposalVisualizer state_free: conpipe-c state_anchored: pipe-c - state_broken: pipe-b - type: Physics - type: Fixtures fixtures: @@ -322,3 +358,6 @@ !type:PhysShapeAabb bounds: "-0.5,-0.5,0.25,0.25" layer: [ Underplating ] + - type: Construction + graph: DisposalPipe + node: bend diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/utilities/disposal_pipes.yml b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/disposal_pipes.yml new file mode 100644 index 0000000000..42ca4e597e --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/utilities/disposal_pipes.yml @@ -0,0 +1,144 @@ +- type: constructionGraph + id: DisposalPipe + start: start + graph: + - node: start + edges: + - to: pipe + steps: + - material: Steel + amount: 2 + doAfter: 1 + - to: tagger + steps: + - material: Steel + amount: 2 + doAfter: 1 + - to: trunk + steps: + - material: Steel + amount: 2 + doAfter: 1 + - to: router + steps: + - material: Steel + amount: 2 + doAfter: 1 + - to: junction + steps: + - material: Steel + amount: 2 + doAfter: 1 + - to: yJunction + steps: + - material: Steel + amount: 2 + doAfter: 1 + - to: bend + steps: + - material: Steel + amount: 2 + doAfter: 1 + - node: broken + entity: DisposalPipeBroken + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + - !type:DeleteEntity + steps: + - tool: Welding + doAfter: 1 + - node: pipe + entity: DisposalPipe + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity + steps: + - tool: Welding + doAfter: 1 + - node: tagger + entity: DisposalTagger + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity + steps: + - tool: Welding + doAfter: 1 + - node: trunk + entity: DisposalTrunk + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity + steps: + - tool: Welding + doAfter: 1 + - node: router + entity: DisposalRouter + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity + steps: + - tool: Welding + doAfter: 1 + - node: junction + entity: DisposalJunction + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity + steps: + - tool: Welding + doAfter: 1 + - to: yJunction + steps: + - tool: Screwing + doAfter: 1 + - node: yJunction + entity: DisposalYJunction + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity + steps: + - tool: Welding + doAfter: 1 + - to: junction + steps: + - tool: Screwing + doAfter: 1 + - node: bend + entity: DisposalBend + edges: + - to: start + completed: + - !type:SpawnPrototype + prototype: SheetSteel1 + amount: 2 + - !type:DeleteEntity + steps: + - tool: Welding + doAfter: 1 \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/utilities.yml b/Resources/Prototypes/Recipes/Construction/utilities.yml index 6b052a6023..75e1c79792 100644 --- a/Resources/Prototypes/Recipes/Construction/utilities.yml +++ b/Resources/Prototypes/Recipes/Construction/utilities.yml @@ -1,4 +1,4 @@ -#POWER +# POWER - type: construction name: APC id: apc @@ -15,7 +15,7 @@ canBuildInImpassable: true - type: construction - name: Solar Assembly + name: solar assembly id: SolarPanel graph: solarpanel startNode: start @@ -32,7 +32,7 @@ - !type:TileNotBlocked {} - type: construction - name: Cable Terminal + name: cable terminal id: cableTerminal graph: cable_terminal startNode: start @@ -47,7 +47,7 @@ canBuildInImpassable: false -#DISPOSALS +# DISPOSALS - type: construction name: disposal unit id: DisposalUnit @@ -61,5 +61,95 @@ sprite: Structures/Piping/disposal.rsi state: "disposal" +- type: construction + name: disposal pipe + id: DisposalPipe + graph: DisposalPipe + startNode: start + targetNode: pipe + category: Utilities + placementMode: SnapgridCenter + canBuildInImpassable: true + icon: + sprite: Structures/Piping/disposal.rsi + state: conpipe-s -#ATMOS +- type: construction + name: disposal tagger + id: DisposalTagger + graph: DisposalPipe + startNode: start + targetNode: tagger + category: Utilities + placementMode: SnapgridCenter + canBuildInImpassable: false + icon: + sprite: Structures/Piping/disposal.rsi + state: conpipe-tagger + +- type: construction + name: disposal trunk + id: DisposalTrunk + graph: DisposalPipe + startNode: start + targetNode: trunk + category: Utilities + placementMode: SnapgridCenter + canBuildInImpassable: false + icon: + sprite: Structures/Piping/disposal.rsi + state: conpipe-t + +- type: construction + name: disposal router + id: DisposalRouter + graph: DisposalPipe + startNode: start + targetNode: router + category: Utilities + placementMode: SnapgridCenter + canBuildInImpassable: false + icon: + sprite: Structures/Piping/disposal.rsi + state: conpipe-j1s + +- type: construction + name: disposal junction + id: DisposalJunction + graph: DisposalPipe + startNode: start + targetNode: junction + category: Utilities + placementMode: SnapgridCenter + canBuildInImpassable: false + icon: + sprite: Structures/Piping/disposal.rsi + state: conpipe-j1 + +- type: construction + name: disposal Y junction + id: DisposalYJunction + graph: DisposalPipe + startNode: start + targetNode: yJunction + category: Utilities + placementMode: SnapgridCenter + canBuildInImpassable: false + icon: + sprite: Structures/Piping/disposal.rsi + state: conpipe-y + +- type: construction + name: disposal bend + id: DisposalBend + graph: DisposalPipe + startNode: start + targetNode: bend + category: Utilities + placementMode: SnapgridCenter + canBuildInImpassable: false + icon: + sprite: Structures/Piping/disposal.rsi + state: conpipe-c + +# ATMOS