From 2a71253f57daf469b60960b407c20a62090cfef8 Mon Sep 17 00:00:00 2001 From: SnappingOpossum Date: Tue, 6 Jan 2026 11:14:02 +1100 Subject: [PATCH] Move some miscellaneous random spawners to entity tables (#42245) * Move some miscellaneous RandomSpawners to entity tables * Fix a parenting issue and some conventions --- .../Catalog/Fills/Crates/permaescape.yml | 55 ++++++++++--------- .../Clothing/Uniforms/random_suit.yml | 15 ++--- .../Markers/Spawners/Random/crates.yml | 33 +++++------ .../Entities/Mobs/NPCs/elemental.yml | 46 ++++++++-------- .../Entities/Mobs/Player/silicon.yml | 15 ++--- .../Objects/Materials/crystal_shard.yml | 22 ++++---- 6 files changed, 95 insertions(+), 91 deletions(-) diff --git a/Resources/Prototypes/Catalog/Fills/Crates/permaescape.yml b/Resources/Prototypes/Catalog/Fills/Crates/permaescape.yml index 1516cb71c7..6c80d93bbd 100644 --- a/Resources/Prototypes/Catalog/Fills/Crates/permaescape.yml +++ b/Resources/Prototypes/Catalog/Fills/Crates/permaescape.yml @@ -3,33 +3,34 @@ id: CratePermaEscapeSpawner name: Perma Escape Crate Spawner components: - - type: RandomSpawner - prototypes: - # Please note any duplicates & alphabetize <3 - - ClosetMaintenanceFilledRandom # x3 - - ClosetMaintenanceFilledRandom - - ClosetMaintenanceFilledRandom - - CrateEngineeringMiniJetpack - - CratePermaEscapeBureaucracy - - CratePermaEscapeComs # x2 - - CratePermaEscapeComs - - CratePermaEscapeDigging # x2 - - CratePermaEscapeDigging - - CratePermaEscapeEVA - - CratePermaEscapeGiftsFromSyndicate - - CratePermaEscapeGun - - CratePermaEscapeLights - - CratePermaEscapeMats #x2 - - CratePermaEscapeMats - - CratePermaEscapeMerc - - CratePermaEscapeTowercap # x2 - - CratePermaEscapeTowercap - - CrateTrashCartFilled - - CrateServiceCustomSmokable - rarePrototypes: - - MobTick # These need to be killable by one dude with a shovel. - rareChance: .30 - chance: 1 + - type: EntityTableSpawner + table: !type:GroupSelector + children: + - id: MobTick # These need to be killable by one dude with a shovel. + weight: 0.3 + - !type:GroupSelector + weight: 0.7 + children: + # Please alphabetize <3 + - id: ClosetMaintenanceFilledRandom + weight: 3 + - id: CrateEngineeringMiniJetpack + - id: CratePermaEscapeBureaucracy + - id: CratePermaEscapeComs + weight: 2 + - id: CratePermaEscapeDigging + weight: 2 + - id: CratePermaEscapeEVA + - id: CratePermaEscapeGiftsFromSyndicate + - id: CratePermaEscapeGun + - id: CratePermaEscapeLights + - id: CratePermaEscapeMats + weight: 2 + - id: CratePermaEscapeMerc + - id: CratePermaEscapeTowercap + weight: 2 + - id: CrateTrashCartFilled + - id: CrateServiceCustomSmokable offset: 0.0 - type: entity diff --git a/Resources/Prototypes/Entities/Clothing/Uniforms/random_suit.yml b/Resources/Prototypes/Entities/Clothing/Uniforms/random_suit.yml index 7d4dfc5990..28a045ce6c 100644 --- a/Resources/Prototypes/Entities/Clothing/Uniforms/random_suit.yml +++ b/Resources/Prototypes/Entities/Clothing/Uniforms/random_suit.yml @@ -36,14 +36,15 @@ id: ClothingRandomSpawner name: random colorful costume components: - - type: RandomSpawner + - type: EntityTableSpawner + table: !type:GroupSelector + children: + - id: ClothingUniformRandomArmless + - id: ClothingUniformRandomStandard + - id: ClothingUniformRandomBra + - id: ClothingUniformRandomShorts + - id: ClothingUniformRandomShirt offset: 0 - prototypes: - - ClothingUniformRandomArmless - - ClothingUniformRandomStandard - - ClothingUniformRandomBra - - ClothingUniformRandomShorts - - ClothingUniformRandomShirt - type: entity parent: ClothingUniformRandom diff --git a/Resources/Prototypes/Entities/Markers/Spawners/Random/crates.yml b/Resources/Prototypes/Entities/Markers/Spawners/Random/crates.yml index 31f15ffad0..f8761987cd 100644 --- a/Resources/Prototypes/Entities/Markers/Spawners/Random/crates.yml +++ b/Resources/Prototypes/Entities/Markers/Spawners/Random/crates.yml @@ -1,27 +1,28 @@ - type: entity - name: Empty Crate Spawner - id: CrateEmptySpawner parent: MarkerBase + id: CrateEmptySpawner + name: Empty Crate Spawner components: - type: Sprite layers: - state: red - sprite: Structures/Storage/Crates/generic.rsi state: icon - - type: RandomSpawner - prototypes: - - CrateGenericSteel - - CratePlastic - - CrateFreezer - - CrateHydroponics - - CrateMedical - - CrateRadiation - - CrateInternals - - CrateElectrical - - CrateEngineering - - CrateScience - - CrateSurgery - chance: 0.7 + - type: EntityTableSpawner + table: !type:GroupSelector + prob: 0.7 + children: + - id: CrateGenericSteel + - id: CratePlastic + - id: CrateFreezer + - id: CrateHydroponics + - id: CrateMedical + - id: CrateRadiation + - id: CrateInternals + - id: CrateElectrical + - id: CrateEngineering + - id: CrateScience + - id: CrateSurgery offset: 0.0 - type: entityTable diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml b/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml index e9f0c4a8ef..b3f7749246 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml @@ -388,31 +388,31 @@ solution: bloodstream - type: entity - name: Reagent Slime Spawner - id: ReagentSlimeSpawner parent: MarkerBase + id: ReagentSlimeSpawner + name: Reagent Slime Spawner components: - - type: Sprite - layers: - - state: red - - sprite: Mobs/Aliens/elemental.rsi - state: alive - - type: RandomSpawner - prototypes: - - ReagentSlime - - ReagentSlimeBeer - - ReagentSlimePax - - ReagentSlimeNocturine - - ReagentSlimeTHC - - ReagentSlimeBicaridine - - ReagentSlimeToxin - - ReagentSlimeNapalm - - ReagentSlimeOmnizine - - ReagentSlimeMuteToxin - - ReagentSlimeNorepinephricAcid - - ReagentSlimeEphedrine - - ReagentSlimeRobustHarvest - chance: 1 + - type: Sprite + layers: + - state: red + - sprite: Mobs/Aliens/elemental.rsi + state: alive + - type: EntityTableSpawner + table: !type:GroupSelector + children: + - id: ReagentSlime + - id: ReagentSlimeBeer + - id: ReagentSlimePax + - id: ReagentSlimeNocturine + - id: ReagentSlimeTHC + - id: ReagentSlimeBicaridine + - id: ReagentSlimeToxin + - id: ReagentSlimeNapalm + - id: ReagentSlimeOmnizine + - id: ReagentSlimeMuteToxin + - id: ReagentSlimeNorepinephricAcid + - id: ReagentSlimeEphedrine + - id: ReagentSlimeRobustHarvest - type: entity id: ReagentSlimeBeer diff --git a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml index d9bc7c5829..6041c4e9e9 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/silicon.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/silicon.yml @@ -610,20 +610,21 @@ - type: GhostTakeoverAvailable - type: entity - name: syndicate invasion borg spawner - id: PlayerBorgSyndicateInvasionGhostRoleSpawner parent: MarkerBase + id: PlayerBorgSyndicateInvasionGhostRoleSpawner + name: syndicate invasion borg spawner components: - type: Sprite layers: - state: red - sprite: Structures/Decoration/banner.rsi state: banner_syndicate - - type: RandomSpawner - prototypes: - - PlayerBorgSyndicateAssaultGhostRole - - PlayerBorgSyndicateAssaultGhostRole # Saboteurs are kinda like cyborg medics, we want less. - - PlayerBorgSyndicateSaboteurGhostRole + - type: EntityTableSpawner + table: !type:GroupSelector + children: + - id: PlayerBorgSyndicateAssaultGhostRole + - id: PlayerBorgSyndicateSaboteurGhostRole + weight: 0.5 # Saboteurs are kinda like cyborg medics, we want less. - type: entity parent: EngineeringBorgChassisDerelict diff --git a/Resources/Prototypes/Entities/Objects/Materials/crystal_shard.yml b/Resources/Prototypes/Entities/Objects/Materials/crystal_shard.yml index f4c110817c..25d80eaee6 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/crystal_shard.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/crystal_shard.yml @@ -174,14 +174,14 @@ id: ShardCrystalRandom name: random crystal shard components: - - type: RandomSpawner - prototypes: - - ShardCrystalGreen - - ShardCrystalPink - - ShardCrystalYellow - - ShardCrystalBlack - - ShardCrystalOrange - - ShardCrystalBlue - - ShardCrystalCyan - - ShardCrystalRed - chance: 1 + - type: EntityTableSpawner + table: !type:GroupSelector + children: + - id: ShardCrystalGreen + - id: ShardCrystalPink + - id: ShardCrystalYellow + - id: ShardCrystalBlack + - id: ShardCrystalOrange + - id: ShardCrystalBlue + - id: ShardCrystalCyan + - id: ShardCrystalRed -- 2.52.0