Add conditional spawning component (#1069)

* Add conditional spawning component

* Remove null checks

* Remove leftover return

* Properly spawn items when game rule gets added

* Fix duplicate uids in saltern

* GameRules returns IEnumerable using yield.
This commit is contained in:
Víctor Aguilera Puerto
2020-06-05 19:42:43 +02:00
committed by GitHub
parent 470f81fca1
commit e1df008bce
11 changed files with 429 additions and 1 deletions

View File

@@ -0,0 +1,99 @@
- type: entity
name: base conditional spawner
id: BaseConditionalSpawner
abstract: true
components:
- type: Sprite
netsync: false
visible: false
sprite: Objects/markers.rsi
state: cross_blue
- type: Icon
sprite: Objects/markers.rsi
state: cross_blue
- type: Marker
- type: Clickable
- type: InteractionOutline
- type: Collidable
- type: ConditionalSpawner
placement:
mode: AlignTileAny
- type: entity
name: Suspicion Rifle Spawner
id: SuspicionRifleSpawner
parent: BaseConditionalSpawner
components:
- type: Sprite
netsync: false
visible: false
sprite: Objects/markers.rsi
state: spawner_rifle
- type: Icon
sprite: Objects/markers.rsi
state: spawner_rifle
- type: ConditionalSpawner
prototypes:
- RifleAk
- RifleBlackAk
- RifleCarbine
- RifleDallas
- RifleIhHeavy
- RifleSolEot
- RifleSolPara
- RifleSts
chance: 0.75
gameRules:
- RuleSuspicion
- type: entity
name: Suspicion Pistol Spawner
id: SuspicionPistolSpawner
parent: BaseConditionalSpawner
components:
- type: Sprite
netsync: false
visible: false
sprite: Objects/markers.rsi
state: spawner_pistol
- type: Icon
sprite: Objects/markers.rsi
state: spawner_pistol
- type: ConditionalSpawner
prototypes:
- PistolClarissa
- PistolDeagle
- PistolDeckard
- PistolGiskard
- PistolGyro
- PistolLamia
- PistolMakarov
- PistolMk58
- PistolOlivawCivil
chance: 0.75
gameRules:
- RuleSuspicion
- type: entity
name: Suspicion Melee Spawner
id: SuspicionMeleeSpawner
parent: BaseConditionalSpawner
components:
- type: Sprite
netsync: false
visible: false
sprite: Objects/markers.rsi
state: spawner_melee
- type: Icon
sprite: Objects/markers.rsi
state: spawner_melee
- type: ConditionalSpawner
prototypes:
- ButchCleaver
- Pickaxe
- Spear
- ToolboxEmergency
- CrowbarRed
chance: 0.75
gameRules:
- RuleSuspicion