Disposal Pipe Crafting (#6188)

This commit is contained in:
Jack Fox
2022-01-22 06:54:26 -06:00
committed by GitHub
parent 7eee6c6047
commit 90a5c6ea54
6 changed files with 291 additions and 33 deletions

View File

@@ -18,9 +18,6 @@ namespace Content.Client.Disposal.Visualizers
[DataField("state_anchored")] [DataField("state_anchored")]
private string? _stateAnchored; private string? _stateAnchored;
[DataField("state_broken")]
private string? _stateBroken;
private void ChangeState(AppearanceComponent appearance) private void ChangeState(AppearanceComponent appearance)
{ {
var entities = IoCManager.Resolve<IEntityManager>(); var entities = IoCManager.Resolve<IEntityManager>();
@@ -38,7 +35,6 @@ namespace Content.Client.Disposal.Visualizers
{ {
DisposalTubeVisualState.Free => _stateFree, DisposalTubeVisualState.Free => _stateFree,
DisposalTubeVisualState.Anchored => _stateAnchored, DisposalTubeVisualState.Anchored => _stateAnchored,
DisposalTubeVisualState.Broken => _stateBroken,
_ => throw new ArgumentOutOfRangeException() _ => throw new ArgumentOutOfRangeException()
}; };

View File

@@ -26,7 +26,6 @@ namespace Content.Server.Disposal.Tube.Components
public TimeSpan LastClang; public TimeSpan LastClang;
private bool _connected; private bool _connected;
private bool _broken;
[DataField("clangSound")] public SoundSpecifier ClangSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg"); [DataField("clangSound")] public SoundSpecifier ClangSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg");
/// <summary> /// <summary>
@@ -51,7 +50,7 @@ namespace Content.Server.Disposal.Tube.Components
// TODO: Make disposal pipes extend the grid // TODO: Make disposal pipes extend the grid
private void Connect() private void Connect()
{ {
if (_connected || _broken) if (_connected)
{ {
return; return;
} }
@@ -66,11 +65,6 @@ namespace Content.Server.Disposal.Tube.Components
return false; return false;
} }
if (_broken)
{
return false;
}
if (!ConnectableDirections().Contains(direction)) if (!ConnectableDirections().Contains(direction))
{ {
return false; return false;
@@ -113,11 +107,9 @@ namespace Content.Server.Disposal.Tube.Components
return; return;
} }
var state = _broken var state = Anchored
? DisposalTubeVisualState.Broken ? DisposalTubeVisualState.Anchored
: Anchored : DisposalTubeVisualState.Free;
? DisposalTubeVisualState.Anchored
: DisposalTubeVisualState.Free;
appearance.SetData(DisposalTubeVisuals.VisualState, state); appearance.SetData(DisposalTubeVisuals.VisualState, state);
} }
@@ -182,9 +174,7 @@ namespace Content.Server.Disposal.Tube.Components
void IBreakAct.OnBreak(BreakageEventArgs eventArgs) void IBreakAct.OnBreak(BreakageEventArgs eventArgs)
{ {
_broken = true; // TODO: Repair
Disconnect(); Disconnect();
UpdateVisualState();
} }
} }
} }

View File

@@ -14,6 +14,5 @@ namespace Content.Shared.Disposal.Components
{ {
Free = 0, Free = 0,
Anchored, Anchored,
Broken,
} }
} }

View File

@@ -34,6 +34,8 @@
behaviors: behaviors:
- !type:DoActsBehavior - !type:DoActsBehavior
acts: ["Breakage"] acts: ["Breakage"]
- !type:ChangeConstructionNodeBehavior
node: broken
- type: Rotatable - type: Rotatable
- type: Pullable - type: Pullable
@@ -46,6 +48,31 @@
# Pipes # 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 - type: entity
id: DisposalPipe id: DisposalPipe
parent: DisposalPipeBase parent: DisposalPipeBase
@@ -64,7 +91,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-s state_free: conpipe-s
state_anchored: pipe-s state_anchored: pipe-s
state_broken: pipe-b
- type: Physics - type: Physics
- type: Fixtures - type: Fixtures
fixtures: fixtures:
@@ -72,6 +98,9 @@
!type:PhysShapeAabb !type:PhysShapeAabb
bounds: "-0.25,-0.5,0.25,0.5" bounds: "-0.25,-0.5,0.25,0.5"
layer: [ Underplating ] layer: [ Underplating ]
- type: Construction
graph: DisposalPipe
node: pipe
- type: entity - type: entity
id: DisposalTagger id: DisposalTagger
@@ -91,7 +120,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-tagger state_free: conpipe-tagger
state_anchored: pipe-tagger state_anchored: pipe-tagger
state_broken: pipe-b
- type: UserInterface - type: UserInterface
interfaces: interfaces:
- key: enum.DisposalTaggerUiKey.Key - key: enum.DisposalTaggerUiKey.Key
@@ -103,6 +131,9 @@
!type:PhysShapeAabb !type:PhysShapeAabb
bounds: "-0.25,-0.5,0.25,0.5" bounds: "-0.25,-0.5,0.25,0.5"
layer: [ Underplating ] layer: [ Underplating ]
- type: Construction
graph: DisposalPipe
node: tagger
- type: entity - type: entity
id: DisposalTrunk id: DisposalTrunk
@@ -122,7 +153,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-t state_free: conpipe-t
state_anchored: pipe-t state_anchored: pipe-t
state_broken: pipe-b
- type: Physics - type: Physics
- type: Fixtures - type: Fixtures
fixtures: fixtures:
@@ -130,6 +160,9 @@
!type:PhysShapeAabb !type:PhysShapeAabb
bounds: "-0.25,-0.5,0.25,0.4" bounds: "-0.25,-0.5,0.25,0.4"
layer: [ Underplating ] layer: [ Underplating ]
- type: Construction
graph: DisposalPipe
node: trunk
- type: entity - type: entity
id: DisposalRouter id: DisposalRouter
@@ -153,7 +186,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-j1s state_free: conpipe-j1s
state_anchored: pipe-j1s state_anchored: pipe-j1s
state_broken: pipe-b
- type: Flippable - type: Flippable
mirrorEntity: DisposalRouterFlipped mirrorEntity: DisposalRouterFlipped
- type: UserInterface - type: UserInterface
@@ -167,6 +199,9 @@
!type:PhysShapeAabb !type:PhysShapeAabb
bounds: "-0.5,-0.5,0.25,0.5" bounds: "-0.5,-0.5,0.25,0.5"
layer: [ Underplating ] layer: [ Underplating ]
- type: Construction
graph: DisposalPipe
node: router
- type: entity - type: entity
id: DisposalRouterFlipped id: DisposalRouterFlipped
@@ -189,7 +224,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-j2s state_free: conpipe-j2s
state_anchored: pipe-j2s state_anchored: pipe-j2s
state_broken: pipe-b
- type: Flippable - type: Flippable
mirrorEntity: DisposalRouter mirrorEntity: DisposalRouter
- type: Physics - type: Physics
@@ -222,7 +256,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-j1 state_free: conpipe-j1
state_anchored: pipe-j1 state_anchored: pipe-j1
state_broken: pipe-b
- type: Flippable - type: Flippable
mirrorEntity: DisposalJunctionFlipped mirrorEntity: DisposalJunctionFlipped
- type: Physics - type: Physics
@@ -232,6 +265,9 @@
!type:PhysShapeAabb !type:PhysShapeAabb
bounds: "-0.5,-0.5,0.25,0.5" bounds: "-0.5,-0.5,0.25,0.5"
layer: [ Underplating ] layer: [ Underplating ]
- type: Construction
graph: DisposalPipe
node: junction
- type: entity - type: entity
id: DisposalJunctionFlipped id: DisposalJunctionFlipped
@@ -254,7 +290,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-j2 state_free: conpipe-j2
state_anchored: pipe-j2 state_anchored: pipe-j2
state_broken: pipe-b
- type: Flippable - type: Flippable
mirrorEntity: DisposalJunction mirrorEntity: DisposalJunction
- type: Physics - type: Physics
@@ -287,7 +322,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-y state_free: conpipe-y
state_anchored: pipe-y state_anchored: pipe-y
state_broken: pipe-b
- type: Physics - type: Physics
- type: Fixtures - type: Fixtures
fixtures: fixtures:
@@ -295,6 +329,9 @@
!type:PhysShapeAabb !type:PhysShapeAabb
bounds: "-0.5,-0.5,0.5,0.25" bounds: "-0.5,-0.5,0.5,0.25"
layer: [ Underplating ] layer: [ Underplating ]
- type: Construction
graph: DisposalPipe
node: yJunction
- type: entity - type: entity
id: DisposalBend id: DisposalBend
@@ -314,7 +351,6 @@
- type: DisposalVisualizer - type: DisposalVisualizer
state_free: conpipe-c state_free: conpipe-c
state_anchored: pipe-c state_anchored: pipe-c
state_broken: pipe-b
- type: Physics - type: Physics
- type: Fixtures - type: Fixtures
fixtures: fixtures:
@@ -322,3 +358,6 @@
!type:PhysShapeAabb !type:PhysShapeAabb
bounds: "-0.5,-0.5,0.25,0.25" bounds: "-0.5,-0.5,0.25,0.25"
layer: [ Underplating ] layer: [ Underplating ]
- type: Construction
graph: DisposalPipe
node: bend

View File

@@ -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

View File

@@ -1,4 +1,4 @@
#POWER # POWER
- type: construction - type: construction
name: APC name: APC
id: apc id: apc
@@ -15,7 +15,7 @@
canBuildInImpassable: true canBuildInImpassable: true
- type: construction - type: construction
name: Solar Assembly name: solar assembly
id: SolarPanel id: SolarPanel
graph: solarpanel graph: solarpanel
startNode: start startNode: start
@@ -32,7 +32,7 @@
- !type:TileNotBlocked {} - !type:TileNotBlocked {}
- type: construction - type: construction
name: Cable Terminal name: cable terminal
id: cableTerminal id: cableTerminal
graph: cable_terminal graph: cable_terminal
startNode: start startNode: start
@@ -47,7 +47,7 @@
canBuildInImpassable: false canBuildInImpassable: false
#DISPOSALS # DISPOSALS
- type: construction - type: construction
name: disposal unit name: disposal unit
id: DisposalUnit id: DisposalUnit
@@ -61,5 +61,95 @@
sprite: Structures/Piping/disposal.rsi sprite: Structures/Piping/disposal.rsi
state: "disposal" 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