From ad78b30ca318eb1f4b8cd743431da119293dba9c Mon Sep 17 00:00:00 2001 From: Boolean-Buckeye <36829021+Boolean-Buckeye@users.noreply.github.com> Date: Sun, 3 Nov 2024 21:24:22 -0600 Subject: [PATCH] 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 --- .../Structures/Lighting/base_lighting.yml | 35 +++++++++++++++++-- .../Graphs/structures/lighting.yml | 25 ++++++++++++- .../Recipes/Construction/structures.yml | 18 ++++++++++ 3 files changed, 75 insertions(+), 3 deletions(-) diff --git a/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml b/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml index f684ca3425..99973845a9 100644 --- a/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml +++ b/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml @@ -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: diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/lighting.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/lighting.yml index f70a44efe3..fe9bca8b78 100644 --- a/Resources/Prototypes/Recipes/Construction/Graphs/structures/lighting.yml +++ b/Resources/Prototypes/Recipes/Construction/Graphs/structures/lighting.yml @@ -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 {} \ No newline at end of file + - !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 {} diff --git a/Resources/Prototypes/Recipes/Construction/structures.yml b/Resources/Prototypes/Recipes/Construction/structures.yml index fee1217c16..71fdbeedaf 100644 --- a/Resources/Prototypes/Recipes/Construction/structures.yml +++ b/Resources/Prototypes/Recipes/Construction/structures.yml @@ -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 -- 2.51.2