make emergency lights (de)constructable (#32945)

* add an emergency light node to the LightFixture construction graph
* add a recipe entry to the construction menu for emergency light
* make emergency light entity at the emergency light node on the graph
* Make emergency light destroy to 1 steel and 1 glass shard to match
  the construction recipe

Co-authored-by: BooleanBuckeye <booleanbuckeye@gmail.com>
This commit is contained in:
Boolean-Buckeye
2024-11-03 21:24:22 -06:00
committed by GitHub
parent f5fac7c5f2
commit ad78b30ca3
3 changed files with 75 additions and 3 deletions

View File

@@ -43,7 +43,7 @@
- type: RCDDeconstructable
cost: 4
delay: 2
fx: EffectRCDDeconstruct2
fx: EffectRCDDeconstruct2
- type: Destructible
thresholds:
- trigger:
@@ -74,7 +74,7 @@
mode: SnapgridCenter
snap:
- Wallmount
- type: entity
name: light
description: "A light fixture. Draws power and produces light when equipped with a light tube."
@@ -400,6 +400,37 @@
shader: "unshaded"
visible: false
- type: Appearance
- type: Construction
graph: LightFixture
node: emergencyLight
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 100
behaviors: #excess damage, don't spawn entities.
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
- trigger:
!type:DamageTrigger
damage: 25
behaviors:
- !type:SpawnEntitiesBehavior
spawn:
SheetSteel1:
min: 1
max: 1
ShardGlass:
min: 1
max: 1
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound:
collection: GlassBreak
placement:
mode: SnapgridCenter
snap:

View File

@@ -24,6 +24,14 @@
- material: Steel
amount: 1
doAfter: 2.0
- to: emergencyLight
steps:
- material: Steel
amount: 1
doAfter: 1.0
- material: Glass
amount: 1
doAfter: 1.0
- node: tubeLight
entity: PoweredlightEmpty
edges:
@@ -83,4 +91,19 @@
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 1
- !type:DeleteEntity {}
- !type:DeleteEntity {}
- node: emergencyLight
entity: EmergencyLight
edges:
- to: start
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 1
- !type:SpawnPrototype
prototype: SheetGlass1
amount: 1
- !type:DeleteEntity {}

View File

@@ -1456,6 +1456,24 @@
# Same here. - 20kdc
- !type:TileNotBlocked
- type: construction
name: emergency light
id: EmergencyLightFixture
graph: LightFixture
startNode: start
targetNode: emergencyLight
category: construction-category-structures
description: An emergency light.
icon:
sprite: Structures/Wallmounts/Lighting/emergency_light.rsi
state: base
objectType: Structure
placementMode: SnapgridCenter
canRotate: true
canBuildInImpassable: false
conditions:
- !type:TileNotBlocked
- type: construction
name: ground light post
id: LightGroundFixture