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

View File

@@ -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");
/// <summary>
@@ -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();
}
}
}

View File

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

View File

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

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