Refactor stacks to use prototypes (#3387)

* Refactor stacks to use prototypes

* Fix not assigned warning

* Add names to stacks

* Make machine baords and material constructions use the name as well

* Remove defaulting stacks to prototype id

* Fix tests

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
DrSmugleaf
2021-02-25 06:18:29 +01:00
committed by GitHub
parent 7c32574547
commit fdcbece63d
33 changed files with 326 additions and 186 deletions

View File

@@ -22,7 +22,7 @@
parent: BaseItem
components:
- type: Stack
stacktype: enum.StackType.PaperRolling
stackType: PaperRolling
max: 5
count: 1
- type: Sprite
@@ -39,7 +39,7 @@
parent: BaseItem
components:
- type: Stack
stacktype: enum.StackType.CigaretteFilter
stackType: CigaretteFilter
max: 5
count: 1
- type: Sprite

View File

@@ -19,7 +19,7 @@
- key: enum.MaterialKeys.Stack
mat: steel
- type: Stack
stacktype: enum.StackType.Metal
stackType: Steel
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: metal
@@ -37,7 +37,7 @@
suffix: 1
components:
- type: Stack
stacktype: enum.StackType.Metal
stackType: Steel
count: 1
- type: entity
@@ -51,7 +51,7 @@
- key: enum.MaterialKeys.Stack
mat: glass
- type: Stack
stacktype: enum.StackType.Glass
stackType: Glass
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: glass
@@ -66,7 +66,7 @@
suffix: 1
components:
- type: Stack
stacktype: enum.StackType.Glass
stackType: Glass
count: 1
- type: entity
@@ -80,7 +80,7 @@
- key: enum.MaterialKeys.Stack
mat: rglass
- type: Stack
stacktype: enum.StackType.ReinforcedGlass
stackType: ReinforcedGlass
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: rglass
@@ -95,7 +95,7 @@
suffix: 1
components:
- type: Stack
StackType: enum.StackType.ReinforcedGlass
stackType: ReinforcedGlass
count: 1
@@ -110,7 +110,7 @@
- key: enum.MaterialKeys.Stack
mat: plasteel
- type: Stack
stacktype: enum.StackType.Plasteel
stackType: Plasteel
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: plasteel
@@ -125,7 +125,7 @@
suffix: 1
components:
- type: Stack
stacktype: enum.StackType.Plasteel
stackType: Plasteel
count: 1
- type: entity
@@ -139,7 +139,7 @@
- key: enum.MaterialKeys.Stack
mat: gold
- type: Stack
stacktype: enum.StackType.Gold
stackType: Gold
- type: Sprite
sprite: Objects/Materials/materials.rsi
state: goldbar_30
@@ -162,6 +162,7 @@
sprite: Objects/Materials/materials.rsi
state: goldbar_10
- type: Stack
stackType: GoldStack1
count: 1
- type: entity
@@ -184,7 +185,7 @@
- key: enum.MaterialKeys.Stack
mat: plasma
- type: Stack
stacktype: enum.StackType.Plasma
stackType: Plasma
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: plasma
@@ -199,6 +200,7 @@
suffix: 1
components:
- type: Stack
stackType: PlasmaStack1
count: 1
- type: entity
@@ -212,7 +214,7 @@
- key: enum.MaterialKeys.Stack
mat: wood
- type: Stack
stacktype: enum.StackType.Wood
stackType: Wood
- type: Sprite
sprite: Objects/Materials/materials.rsi
state: wood
@@ -227,6 +229,7 @@
suffix: 1
components:
- type: Stack
stackType: WoodPlank1
count: 1
- type: entity
@@ -240,7 +243,7 @@
- key: enum.MaterialKeys.Stack
mat: plastic
- type: Stack
stacktype: enum.StackType.Plastic
stackType: Plastic
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: plastic
@@ -255,4 +258,5 @@
suffix: 1
components:
- type: Stack
stackType: PlasticSheet1
count: 1

View File

@@ -16,7 +16,7 @@
graph: metalRod
node: MetalRod
- type: Stack
stacktype: enum.StackType.MetalRod
stackType: MetalRod
count: 50
max: 50
- type: FloorTile
@@ -30,6 +30,6 @@
suffix: 1
components:
- type: Stack
stacktype: enum.StackType.MetalRod
stackType: MetalRod
count: 1
max: 50

View File

@@ -10,7 +10,7 @@
suffix: Full
components:
- type: Stack
stacktype: enum.StackType.Cable
stackType: Cable
- type: Sprite
sprite: Objects/Tools/cables.rsi
netsync: false
@@ -27,7 +27,7 @@
suffix: Full
components:
- type: Stack
stacktype: enum.StackType.HVCable
stackType: HVCable
- type: Sprite
state: coilhv-30
- type: Item
@@ -50,10 +50,11 @@
suffix: 1
components:
- type: Sprite
state: coilhv-10
state: coilhv-10
- type: Item
size: 3
- type: Stack
stackType: HVWireStack1
count: 1
- type: entity
@@ -89,6 +90,7 @@
- type: Item
size: 3
- type: Stack
stackType: ApcExtensionCableStack1
count: 1
- type: entity
@@ -98,7 +100,7 @@
suffix: Full
components:
- type: Stack
stacktype: enum.StackType.MVCable
stackType: MVCable
- type: Sprite
state: coilmv-30
- type: Item
@@ -125,4 +127,5 @@
- type: Item
size: 3
- type: Stack
stackType: MVWireStack1
count: 1

View File

@@ -276,7 +276,7 @@
description: "Dried cannabis leaves, ready to be ground."
components:
- type: Stack
stacktype: enum.StackType.LeavesCannabisDried
stackType: LeavesCannabisDried
max: 5
count: 1
- type: SolutionContainer
@@ -295,7 +295,7 @@
description: "Ground cannabis, ready to take you on a trip."
components:
- type: Stack
stacktype: enum.StackType.GroundCannabis
stackType: GroundCannabis
max: 5
count: 1
- type: SolutionContainer
@@ -329,7 +329,7 @@
description: "Dried tobacco leaves, ready to be ground."
components:
- type: Stack
stacktype: enum.StackType.LeavesTobaccoDried
stackType: LeavesTobaccoDried
max: 5
count: 1
- type: SolutionContainer
@@ -348,7 +348,7 @@
description: "Ground tobacco, perfect for hand-rolled cigarettes."
components:
- type: Stack
stacktype: enum.StackType.GroundTobacco
stackType: GroundTobacco
max: 5
count: 1
- type: SolutionContainer

View File

@@ -31,7 +31,6 @@
parent: BaseItem
abstract: true
components:
- type: Stack
- type: Item
- type: Healing
@@ -48,9 +47,9 @@
heal:
Heat: 10
- type: Stack
stackType: Ointment
max: 5
count: 5
stacktype: enum.StackType.Ointment
- type: entity
name: bruise pack
@@ -65,9 +64,9 @@
heal:
Blunt: 10
- type: Stack
stackType: Brutepack
max: 5
count: 5
stacktype: enum.StackType.Brutepack
- type: entity
name: roll of gauze
@@ -82,6 +81,6 @@
# heal:
# Blunt: 10
- type: Stack
stackType: Gauze
max: 5
count: 5
stacktype: enum.StackType.Gauze

View File

@@ -12,7 +12,7 @@
- plating
- floor_steel
- type: Stack
stacktype: FloorTileSteel
stackType: FloorTileSteel
count: 1
max: 8
@@ -41,7 +41,7 @@
- plating
- floor_wood
- type: Stack
stacktype: FloorTileWood
stackType: FloorTileWood
count: 1
max: 8
@@ -61,7 +61,7 @@
- plating
- floor_white
- type: Stack
stacktype: FloorTileWhite
stackType: FloorTileWhite
count: 1
max: 8
@@ -81,7 +81,7 @@
- plating
- floor_dark
- type: Stack
stacktype: FloorTileDark
stackType: FloorTileDark
count: 1
max: 8

View File

@@ -6,7 +6,7 @@
edges:
- to: apc
steps:
- material: Metal
- material: Steel
amount: 3
- node: apc

View File

@@ -9,7 +9,7 @@
- !type:SetAnchor
value: false
steps:
- material: Metal
- material: Steel
amount: 5
- node: frameUnsecured

View File

@@ -45,7 +45,7 @@
completed:
- !type:SnapToGrid {}
steps:
- material: Metal
- material: Steel
amount: 2
doAfter: 1
- node: lever

View File

@@ -8,7 +8,7 @@
completed:
- !type:SnapToGrid { }
steps:
- material: Metal
- material: Steel
amount: 3
doAfter: 1

View File

@@ -9,7 +9,7 @@
- !type:SnapToGrid
southRotation: true
steps:
- material: Metal
- material: Steel
amount: 2
doAfter: 1
@@ -41,7 +41,7 @@
conditions:
- !type:EntityAnchored {}
steps:
- material: Metal
- material: Steel
amount: 2
- to: reinforcedGirder

View File

@@ -6,12 +6,12 @@
edges:
- to: bulbLight
steps:
- material: Metal
- material: Steel
amount: 1
doAfter: 2.0
doAfter: 2.0
- to: tubeLight
steps:
- material: Metal
- material: Steel
amount: 2
doAfter: 2.0
- node: tubeLight
@@ -28,7 +28,7 @@
- !type:SpawnPrototype
prototype: SteelSheet1
amount: 2
- !type:DeleteEntity {}
- !type:DeleteEntity {}
- node: bulbLight
entity: PoweredSmallLightEmpty
edges:

View File

@@ -15,7 +15,7 @@
edges:
- to: lowWall
steps:
- material: Metal
- material: Steel
amount: 3
doAfter: 5

View File

@@ -13,7 +13,7 @@
- !type:SetAnchor
value: false
steps:
- material: Metal
- material: Steel
amount: 5
doAfter: 2.5

View File

@@ -9,7 +9,7 @@
- !type:SetStackCount
amount: 2
steps:
- material: Metal
- material: Steel
amount: 1
- node: MetalRod

View File

@@ -6,7 +6,7 @@
edges:
- to: spear
steps:
- material: Metal
- material: Steel
amount: 2
doAfter: 2
- material: Glass

View File

@@ -31,7 +31,7 @@
- to: MetalTable
steps:
- material: Metal
- material: Steel
amount: 1
doAfter: 1

View File

@@ -8,7 +8,7 @@
completed:
- !type:SnapToGrid { }
steps:
- material: Metal
- material: Steel
amount: 5
doAfter: 1
- node: toilet
@@ -18,12 +18,12 @@
- !type:SpawnPrototype
prototype: SteelSheet1
amount: 5
- !type:EmptyAllContainers {}
- !type:EmptyAllContainers {}
- !type:DeleteEntity {}
conditions:
- !type:EntityAnchored
anchored: false
- !type:ToiletLidClosed {}
- !type:ToiletLidClosed {}
steps:
- tool: Welding
doAfter: 2
doAfter: 2

View File

@@ -6,7 +6,7 @@
edges:
- to: plasmaWindow
steps:
- material: Metal
- material: Steel
amount: 2
doAfter: 2
- material: Glass

View File

@@ -0,0 +1,19 @@
- type: stack
id: FloorTileSteel
name: steel tile
- type: stack
id: FloorTileCarpet
name: carpet tile
- type: stack
id: FloorTileWhite
name: white tile
- type: stack
id: FloorTileDark
name: dark tile
- type: stack
id: FloorTileWood
name: wood tile

View File

@@ -0,0 +1,61 @@
- type: stack
id: Steel
name: steel
icon: "/Textures/Objects/Materials/sheets.rsi/metal.png"
spawn: SteelSheet1
- type: stack
id: Glass
name: glass
icon: "/Textures/Objects/Materials/sheets.rsi/glass.png"
spawn: GlassSheet1
- type: stack
id: ReinforcedGlass
name: reinforced glass
- type: stack
id: Plasteel
name: plasteel
icon: "/Textures/Objects/Materials/sheets.rsi/plasteel.png"
spawn: PlasteelSheet1
- type: stack
id: Wood
name: wood
- type: stack
id: Plastic
name: plastic
- type: stack
id: Gold
name: gold
- type: stack
id: Plasma
name: plasma
icon: "/Textures/Objects/Materials/sheets.rsi/phoron.png"
spawn: PlasmaStack1
- type: stack
id: MetalRod
name: metal rod
icon: "/Textures/Objects/Materials/materials.rsi/rods.png"
spawn: MetalRodStack1
- type: stack
id: GoldStack1
name: gold
- type: stack
id: PlasmaStack1
name: plasma
- type: stack
id: WoodPlank1
name: wood
- type: stack
id: PlasticSheet1
name: plastic

View File

@@ -0,0 +1,11 @@
- type: stack
id: Ointment
name: ointment
- type: stack
id: Gauze
name: gauze
- type: stack
id: Brutepack
name: brutepack

View File

@@ -0,0 +1,25 @@
- type: stack
id: Cable
name: cable
icon: "/Textures/Objects/Tools/cables.rsi/coil-30.png"
spawn: ApcExtensionCableStack1
- type: stack
id: MVCable
name: mv cable
- type: stack
id: HVCable
name: hv cable
- type: stack
id: HVWireStack1
name: hv wire
- type: stack
id: MVWireStack1
name: mv wire
- type: stack
id: ApcExtensionCableStack1
name: apc extension cable

View File

@@ -0,0 +1,23 @@
- type: stack
id: PaperRolling
name: paper rolling
- type: stack
id: CigaretteFilter
name: cigarette filter
- type: stack
id: GroundTobacco
name: ground tobacco
- type: stack
id: GroundCannabis
name: ground cannabis
- type: stack
id: LeavesTobaccoDried
name: dried tobacco leaves
- type: stack
id: LeavesCannabisDried
name: dried cannabis leaves