Airlock construction (#3609)

* Add construction and deconstsruction of airlocks

* Change name to door electronics

* Rearrange things

* Fix errors

* Fix physics error from bumping

* Prevent editing the map for now

* Address reviews

* Change switch to if

* Fix newlines
This commit is contained in:
ShadowCommander
2021-03-17 05:07:49 -07:00
committed by GitHub
parent 0c0c66ff6f
commit 51178b9ae7
10 changed files with 301 additions and 12 deletions

View File

@@ -24,6 +24,7 @@
- state: panel_open
map: ["enum.WiresVisualLayers.MaintenancePanel"]
- type: Physics
mass: 100
fixtures:
- shape:
!type:PhysShapeAabb
@@ -37,6 +38,7 @@
- VaultImpassable
- SmallImpassable
- type: Door
board: DoorElectronics
- type: Airlock
- type: Appearance
visuals:
@@ -68,8 +70,58 @@
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- type: Construction
graph: airlock
node: airlock
- type: IconSmooth
key: walls
mode: NoSprite
placement:
mode: SnapgridCenter
- type: entity
id: AirlockAssembly
name: airlock assembly
description: It opens, it closes, and maybe crushes you.
components:
- type: Clickable
- type: RCDDeconstructWhitelist
- type: InteractionOutline
- type: Sprite
netsync: false
drawdepth: Mobs
sprite: Constructible/Structures/Doors/Standard/basic.rsi
state: "assembly"
- type: Physics
mass: 100
fixtures:
- shape:
!type:PhysShapeAabb
bounds: "-0.49,-0.49,0.49,0.49"
mask:
- MobImpassable
layer:
- MobImpassable
- VaultImpassable
- type: Anchorable
snap: true
- type: Pullable
- type: SnapGrid
offset: Center
- type: Damageable
resistances: metallicResistances
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 300
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- type: Construction
graph: airlock
node: assembly
placement:
mode: SnapgridCenter

View File

@@ -0,0 +1,12 @@
- type: entity
id: DoorElectronics
parent: BaseItem
name: door electronics
components:
- type: Tag
tags:
- DoorElectronics
- type: Sprite
sprite: Constructible/Misc/module.rsi
state: door_electronics
- type: AccessReader

View File

@@ -79,6 +79,10 @@
- coillv-10
- coillv-20
- coillv-30
- type: Material
materials:
- key: enum.MaterialKeys.Stack
mat: Cable
- type: entity
parent: ApcExtensionCableStack
@@ -90,7 +94,6 @@
- type: Item
size: 3
- type: Stack
stackType: ApcExtensionCableStack1
count: 1
- type: entity

View File

@@ -0,0 +1,107 @@
- type: constructionGraph
id: airlock
start: start
graph:
- node: start
edges:
- to: assembly
completed:
- !type:SetAnchor
value: false
steps:
- material: Steel
amount: 4
doAfter: 2
- node: assembly
entity: AirlockAssembly
actions:
- !type:SpriteStateChange
state: assembly
- !type:SnapToGrid {}
- !type:SetAnchor {}
edges:
- to: wired
conditions:
- !type:EntityAnchored {}
steps:
- material: Cable
amount: 5
doAfter: 1
- to: start
conditions:
- !type:EntityAnchored
anchored: false
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 4
- !type:DeleteEntity {}
steps:
- tool: Welding
doAfter: 2
- node: wired
entity: AirlockAssembly
edges:
- to: electronics
conditions:
- !type:EntityAnchored {}
steps:
- tag: DoorElectronics
store: board
name: "door electronics circuit board"
icon:
sprite: "Constructible/Misc/module.rsi"
state: "door_electronics"
doAfter: 1
- to: assembly
completed:
- !type:SpawnPrototype
prototype: ApcExtensionCableStack1
amount: 5
steps:
- tool: Cutting
doAfter: 1
- node: electronics
edges:
- to: airlock
conditions:
- !type:EntityAnchored {}
steps:
- tool: Screwing
doAfter: 2
- node: airlock
entity: Airlock
edges:
- to: wired
conditions:
- !type:EntityAnchored {}
- !type:DoorWelded {}
- !type:AirlockBolted
value: false
- !type:WirePanel {}
- !type:ContainerNotEmpty # TODO ShadowCommander: Remove when map gets updated
container: board
completed:
- !type:EmptyAllContainers {}
steps:
- tool: Prying
doAfter: 1
- to: wired # TODO ShadowCommander: Remove when board spawning is implemented in ServerDoorComponent.cs. Needs a map update.
conditions:
- !type:EntityAnchored {}
- !type:DoorWelded {}
- !type:AirlockBolted
value: false
- !type:WirePanel {}
- !type:ContainerEmpty
container: board
completed:
- !type:SpawnPrototype
prototype: DoorElectronics
steps:
- tool: Prying
doAfter: 1

View File

@@ -213,3 +213,20 @@
canBuildInImpassable: false
conditions:
- !type:TileNotBlocked {}
- type: construction
name: Airlock
id: airlock
graph: airlock
startNode: start
targetNode: airlock
category: Structures
description: It opens, it closes, and maybe crushes you.
icon:
sprite: Constructible/Structures/Doors/Standard/basic.rsi
state: assembly
objectType: Structure
placementMode: SnapgridCenter
canBuildInImpassable: false
conditions:
- !type:TileNotBlocked {}

View File

@@ -4,6 +4,9 @@
- type: Tag
id: ConveyorAssembly
- type: Tag
id: DoorElectronics
- type: Tag
id: ExplosivePassable