]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
make emergency lights (de)constructable (#32945)
authorBoolean-Buckeye <36829021+Boolean-Buckeye@users.noreply.github.com>
Mon, 4 Nov 2024 03:24:22 +0000 (21:24 -0600)
committerGitHub <noreply@github.com>
Mon, 4 Nov 2024 03:24:22 +0000 (21:24 -0600)
* 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>
Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml
Resources/Prototypes/Recipes/Construction/Graphs/structures/lighting.yml
Resources/Prototypes/Recipes/Construction/structures.yml

index f684ca3425a3cd3a8945ec02dee464cbc1b1c134..99973845a9f3644b131ca190f42dfe1b41a4b4bb 100644 (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."
       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:
index f70a44efe3c1ef641bd8941b1d671bd5d177fc84..fe9bca8b7858f65a3b9cfbb6dde32c8dcb91477b 100644 (file)
             - 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:
             - !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 {}
index fee1217c1658696aa05f039184293ad4dd626cd5..71fdbeedafdeaee4a40f0454f2c191a47a5fef42 100644 (file)
   # 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