Makes lightbulbs destructible (#2955)

* Renames WindowBreak soundCollection to GlassBreak

* Implements destructible lightbulbs
moved the parent to the top as well

* Fixes the old `glassbreak` soundCollection, renames it

* Deletes the windows.yml version of glassbreak

* Fixes the sound for bulbs being thrown

* Removes name from abstract lightbulb

* Implements IDestroyAct for lightbulbs

* Implements onBreak for lightbulbs

* Lights get damaged by getting hit and throwing

* Lights now have an intermediate 'broken' state before destruction
This commit is contained in:
ZeWaka
2021-01-08 18:06:36 -07:00
committed by GitHub
parent 76d2729722
commit 75c4ed6a09
5 changed files with 48 additions and 28 deletions

View File

@@ -33,7 +33,7 @@
15:
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: WindowBreak
soundCollection: GlassBreak
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
@@ -71,7 +71,7 @@
75:
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: WindowBreak
soundCollection: GlassBreak
- !type:SpawnEntitiesBehavior
spawn:
ShardGlassReinforced:
@@ -103,7 +103,7 @@
100:
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: WindowBreak
soundCollection: GlassBreak
- !type:SpawnEntitiesBehavior
spawn:
ShardGlassPhoron:
@@ -118,10 +118,3 @@
- type: Construction
graph: window
node: phoronWindow
- type: soundCollection
id: WindowBreak
files:
- /Audio/Effects/glass_break1.ogg
- /Audio/Effects/glass_break2.ogg
- /Audio/Effects/glass_break3.ogg

View File

@@ -29,7 +29,7 @@
5:
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: WindowBreak
soundCollection: GlassBreak
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:

View File

@@ -1,4 +1,35 @@
- type: entity
parent: BaseItem
id: BaseLightbulb
abstract: true
components:
- type: LightBulb
- type: Damageable
- type: DamageOnLand
amount: 5
- type: DamageOtherOnHit
amount: 5
- type: Destructible
thresholds:
5:
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: GlassBreak
- !type:DoActsBehavior
acts: [ "Breakage" ]
10:
behaviors:
- !type:PlaySoundCollectionBehavior
soundCollection: GlassBreak
- !type:SpawnEntitiesBehavior
spawn:
ShardGlass:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
parent: BaseLightbulb
name: light bulb
id: LightBulb
@@ -10,14 +41,6 @@
sprite: Objects/Power/light_bulb.rsi
state: normal
- type: entity
parent: BaseItem
name: baselightbulb
id: BaseLightbulb
abstract: true
components:
- type: LightBulb
- type: entity
parent: BaseLightbulb
name: light tube

View File

@@ -1,6 +1,6 @@
- type: soundCollection
id: glassbreak
id: GlassBreak
files:
- /Audio/Effects/glassbreak1.ogg
- /Audio/Effects/glassbreak2.ogg
- /Audio/Effects/glassbreak3.ogg
- /Audio/Effects/glass_break1.ogg
- /Audio/Effects/glass_break2.ogg
- /Audio/Effects/glass_break3.ogg