Skip to content

Commit

Permalink
Make button frames constructable and destructible
Browse files Browse the repository at this point in the history
* Add construction graph for button frames
* Add button frames to construction menu
* Make button frames desctructible
  • Loading branch information
Boolean-Buckeye committed Nov 6, 2024
1 parent 01ac967 commit 8d16ec7
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Resources/Prototypes/Entities/Structures/Wallmounts/switch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,28 @@
state: grey
- type: Rotatable
- type: Fixtures
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Metallic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 80
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 40
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
collection: MetalBreak
params:
volume: -8

- type: entity
id: ButtonFrameGrey
Expand All @@ -527,6 +549,9 @@
drawdepth: SmallObjects
sprite: Structures/Wallmounts/switch_frame.rsi
state: grey
- type: Construction
graph: ButtonFrameGraph
node: ButtonFrameGreyNode

- type: entity
id: ButtonFrameCaution
Expand All @@ -537,6 +562,9 @@
drawdepth: SmallObjects
sprite: Structures/Wallmounts/switch_frame.rsi
state: caution
- type: Construction
graph: ButtonFrameGraph
node: ButtonFrameCautionNode

- type: entity
id: ButtonFrameCautionSecurity
Expand All @@ -547,6 +575,9 @@
drawdepth: SmallObjects
sprite: Structures/Wallmounts/switch_frame.rsi
state: caution_security
- type: Construction
graph: ButtonFrameGraph
node: ButtonFrameCautionSecurityNode

- type: entity
id: ButtonFrameExit
Expand All @@ -557,6 +588,9 @@
drawdepth: SmallObjects
sprite: Structures/Wallmounts/switch_frame.rsi
state: exit
- type: Construction
graph: ButtonFrameGraph
node: ButtonFrameExitNode

- type: entity
id: ButtonFrameJanitor
Expand All @@ -567,3 +601,7 @@
drawdepth: SmallObjects
sprite: Structures/Wallmounts/switch_frame.rsi
state: janitor
- type: Construction
graph: ButtonFrameGraph
node: ButtonFrameJanitorNode

Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,95 @@
prototype: CableApcStack1
amount: 1
- !type:DeleteEntity {}

- type: constructionGraph
id: ButtonFrameGraph
start: start
graph:
- node: start
edges:
- to: ButtonFrameGreyNode
steps:
- material: Steel
amount: 1
doAfter: 2.0
- to: ButtonFrameCautionNode
steps:
- material: Steel
amount: 1
doAfter: 2.0
- to: ButtonFrameCautionSecurityNode
steps:
- material: Steel
amount: 1
doAfter: 2.0
- to: ButtonFrameExitNode
steps:
- material: Steel
amount: 1
doAfter: 2.0
- to: ButtonFrameJanitorNode
steps:
- material: Steel
amount: 1
doAfter: 2.0
- node: ButtonFrameGreyNode
entity: ButtonFrameGrey
edges:
- to: start
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 1
- !type:DeleteEntity {}
- node: ButtonFrameCautionSecurityNode
entity: ButtonFrameCautionSecurity
edges:
- to: start
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 1
- !type:DeleteEntity {}
- node: ButtonFrameCautionNode
entity: ButtonFrameCaution
edges:
- to: start
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 1
- !type:DeleteEntity {}
- node: ButtonFrameExitNode
entity: ButtonFrameExit
edges:
- to: start
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 1
- !type:DeleteEntity {}
- node: ButtonFrameJanitorNode
entity: ButtonFrameJanitor
edges:
- to: start
steps:
- tool: Screwing
doAfter: 2.0
completed:
- !type:SpawnPrototype
prototype: SheetSteel1
amount: 1
- !type:DeleteEntity {}
81 changes: 81 additions & 0 deletions Resources/Prototypes/Recipes/Construction/structures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1747,3 +1747,84 @@
state: closed
conditions:
- !type:TileNotBlocked

# an entry for each of the switch frames from switch.yml
- type: construction
name: Gray Button Frame
id: ButtonFrameGrey
graph: ButtonFrameGraph
startNode: start
targetNode: ButtonFrameGreyNode
category: construction-category-structures
description: A grey button frame
objectType: Structure
placementMode: SnapgridCenter
canBuildInImpassable: true
canRotate: true
icon:
sprite: Structures/Wallmounts/switch_frame.rsi
state: grey
- type: construction
name: Caution Button Frame
id: CautionButtonFrame
graph: ButtonFrameGraph
startNode: start
targetNode: ButtonFrameCautionNode
category: construction-category-structures
description: A caution button frame
objectType: Structure
placementMode: SnapgridCenter
canBuildInImpassable: true
canRotate: true
icon:
sprite: Structures/Wallmounts/switch_frame.rsi
state: caution
- type: construction
name: CautionSecurity Button Frame
id: CautionSecurityButtonFrame
graph: ButtonFrameGraph
startNode: start
targetNode: ButtonFrameCautionSecurityNode
category: construction-category-structures
description: A security caution button frame
objectType: Structure
placementMode: SnapgridCenter
canBuildInImpassable: true
canRotate: true
icon:
sprite: Structures/Wallmounts/switch_frame.rsi
state: caution_security
- type: construction
name: Exit Button Frame
id: ExitButtonFrame
graph: ButtonFrameGraph
startNode: start
targetNode: ButtonFrameExitNode
category: construction-category-structures
description: An exit button frame
objectType: Structure
placementMode: SnapgridCenter
canBuildInImpassable: true
canRotate: true
icon:
sprite: Structures/Wallmounts/switch_frame.rsi
state: exit
- type: construction
name: Janitor Button Frame
id: JanitorButtonFrame
graph: ButtonFrameGraph
startNode: start
targetNode: ButtonFrameJanitorNode
category: construction-category-structures
description: A janitor button frame
objectType: Structure
placementMode: SnapgridCenter
canBuildInImpassable: true
canRotate: true
icon:
sprite: Structures/Wallmounts/switch_frame.rsi
state: janitor




0 comments on commit 8d16ec7

Please sign in to comment.