Destructible spawning fix redux (#2892)

* Fix SpawnEntitiesBehavior crash and add test

* Fix comparer, add duplicated behavior

Turns out this isn't Java

* Threshold behaviors are now "linearly" executed

* Fixes YAML threshold behaviors to be linear

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
Vera Aguilera Puerto
2021-01-02 20:06:00 +01:00
committed by GitHub
parent cc4669244d
commit 85add420b0
13 changed files with 223 additions and 103 deletions

View File

@@ -25,8 +25,6 @@
thresholds:
30:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
@@ -34,6 +32,9 @@
WoodPlank:
min: 1
max: 1
- !type:DoActsBehavior
acts: ["Destruction"]
- type: Occluder
sizeX: 32
sizeY: 32

View File

@@ -33,8 +33,6 @@
thresholds:
30:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
@@ -42,6 +40,8 @@
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
id: Shelf
@@ -78,8 +78,6 @@
thresholds:
30:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
@@ -87,3 +85,5 @@
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]

View File

@@ -41,8 +41,6 @@
thresholds:
15:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
@@ -50,6 +48,8 @@
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
id: TableFrame
@@ -67,8 +67,6 @@
thresholds:
1:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
@@ -76,6 +74,8 @@
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Construction
graph: Tables
node: TableFrame
@@ -96,8 +96,6 @@
thresholds:
1:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
@@ -105,6 +103,8 @@
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
id: TableMetal
@@ -122,8 +122,6 @@
thresholds:
15:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
@@ -131,6 +129,8 @@
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Construction
graph: Tables
node: MetalTable
@@ -151,8 +151,6 @@
thresholds:
75:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
@@ -160,6 +158,8 @@
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Construction
graph: Tables
node: ReinforcedTable
@@ -180,8 +180,6 @@
thresholds:
5:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/glass_break2.ogg
- !type:SpawnEntitiesBehavior
@@ -189,6 +187,8 @@
ShardGlass:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Construction
graph: Tables
node: GlassTable
@@ -209,8 +209,6 @@
thresholds:
20:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/glass_break2.ogg
- !type:SpawnEntitiesBehavior
@@ -218,6 +216,8 @@
ShardGlass:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Construction
graph: Tables
node: RGlassTable
@@ -238,8 +238,6 @@
thresholds:
15:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
@@ -247,6 +245,8 @@
WoodPlank:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Construction
graph: Tables
node: WoodTable
@@ -267,8 +267,6 @@
thresholds:
15:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/woodhit.ogg
- !type:SpawnEntitiesBehavior
@@ -276,6 +274,8 @@
WoodPlank:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Construction
graph: Tables
node: PokerTable
@@ -296,10 +296,10 @@
thresholds:
50:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/picaxe2.ogg
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
id: TableDebug

View File

@@ -55,13 +55,13 @@
thresholds:
100:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
HVWireStack1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
parent: WireBase
@@ -92,13 +92,13 @@
thresholds:
100:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
MVWireStack1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: entity
parent: WireBase
@@ -131,10 +131,10 @@
thresholds:
100:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
ApcExtensionCableStack1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]

View File

@@ -37,13 +37,13 @@
thresholds:
50:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
chem_master_broken:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: UserInterface
interfaces:
- key: enum.ChemMasterUiKey.Key
@@ -86,13 +86,13 @@
thresholds:
25:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: UserInterface
interfaces:
- key: enum.ChemMasterUiKey.Key

View File

@@ -32,13 +32,13 @@
thresholds:
50:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: SnapGrid
offset: Edge
placement:

View File

@@ -50,13 +50,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: brick
@@ -76,13 +76,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: clock
@@ -102,13 +102,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: clown
@@ -129,13 +129,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: cult
@@ -155,13 +155,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: debug
@@ -181,13 +181,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: diamond
@@ -208,13 +208,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: gold
@@ -234,13 +234,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: ice
@@ -260,13 +260,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: metal
@@ -286,13 +286,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: plasma
@@ -312,13 +312,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: plastic
@@ -371,13 +371,13 @@
thresholds:
1000:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: riveted
@@ -397,13 +397,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: sandstone
@@ -423,13 +423,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: silver
@@ -477,13 +477,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: uranium
@@ -503,13 +503,13 @@
thresholds:
300:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:SpawnEntitiesBehavior
spawn:
Girder:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: IconSmooth
key: walls
base: wood

View File

@@ -32,8 +32,6 @@
thresholds:
15:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundCollectionBehavior
soundCollection: WindowBreak
- !type:SpawnEntitiesBehavior
@@ -41,6 +39,8 @@
ShardGlass:
min: 1
max: 2
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: SnapGrid
offset: Center
- type: Airtight
@@ -70,8 +70,6 @@
thresholds:
75:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundCollectionBehavior
soundCollection: WindowBreak
- !type:SpawnEntitiesBehavior
@@ -79,6 +77,8 @@
ShardGlassReinforced:
min: 1
max: 2
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Window
base: rwindow
maxDamage: 75
@@ -102,8 +102,6 @@
thresholds:
100:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundCollectionBehavior
soundCollection: WindowBreak
- !type:SpawnEntitiesBehavior
@@ -111,6 +109,8 @@
ShardGlassPhoron:
min: 1
max: 2
- !type:DoActsBehavior
acts: [ "Destruction" ]
resistances: metallicResistances
- type: Window
base: pwindow

View File

@@ -29,8 +29,6 @@
thresholds:
5:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundCollectionBehavior
soundCollection: WindowBreak
- !type:SpawnEntitiesBehavior
@@ -38,6 +36,8 @@
ShardGlass:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: DamageOnLand
amount: 5
- type: DamageOtherOnHit

View File

@@ -133,8 +133,6 @@
thresholds:
10:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/glass_break1.ogg
- !type:SpawnEntitiesBehavior
@@ -142,6 +140,8 @@
FloodlightBroken:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Appearance
visuals:
- type: FlashLightVisualizer
@@ -162,8 +162,6 @@
thresholds:
20:
behaviors:
- !type:DoActsBehavior
acts: ["Destruction"]
- !type:PlaySoundBehavior
sound: /Audio/Effects/metalbreak.ogg
- !type:SpawnEntitiesBehavior
@@ -171,6 +169,8 @@
SteelSheet1:
min: 1
max: 1
- !type:DoActsBehavior
acts: [ "Destruction" ]
- type: Physics
shapes:
- !type:PhysShapeAabb