Roundstart variation game rules (#24397)

* Raise `StationPostInitEvent` broadcast

* Basic variation pass handling

* standardize names + rule entities

* why does it work like that?

* add to defaults

* light break variation pass

* ent spawn entry

* move some stationevent utility functions to gamerule + add one for finding random tile on specified station

* forgot how statistics works

* powered light variation pass is good now

* station tile count function

* public method to ensure all solutions (for procedural use before mapinit)

* move gamerulesystem utility funcs to partial

* ensure all solutions before spilling in puddlesystem. for use when spilling before mapinit

* trash & puddle variation passes!

* oh yeah

* ehh lets live a little

* std

* utility for game rule check based on comp

* entprotoid the trash spawner oops

* generalize trash variation

* use added instead of started for secret rule

* random cleanup

* generic replacement variation system

* Wall rusting variation rule

* account for modifying while enumerating

* use localaabb

* fix test

* minor tweaks

* reinforced wall replacer + puddletweaker

(cherry picked from commit cc24ba6a317c4bee84ffa1eda8397c255ca92be9)
This commit is contained in:
Kara
2024-01-31 06:52:35 +01:00
committed by Debug
parent aa4c6f9c6a
commit d35e2f39a7
37 changed files with 978 additions and 149 deletions

View File

@@ -127,6 +127,19 @@
lightRadius: 6
lightSoftness: 1.1
- type: entity
parent: LightBulb
name: old incandescent light bulb
id: LightBulbOld
description: An aging light bulb.
components:
- type: LightBulb
bulb: Bulb
color: "#FFD1A3" # 4000K color temp
lightEnergy: 0.3 # old incandescents just arent as bright
lightRadius: 6
lightSoftness: 1.1
- type: entity
suffix: Broken
parent: BaseLightbulb
@@ -164,6 +177,19 @@
lightSoftness: 1
PowerUse: 25
- type: entity
parent: LightTube
name: old fluorescent light tube
id: LightTubeOld
description: An aging light fixture.
components:
- type: LightBulb
color: "#FFDABB" # old fluorescents are yellower-4500K temp
lightEnergy: 0.5
lightRadius: 10
lightSoftness: 1
PowerUse: 10
- type: entity
suffix: Broken
parent: BaseLightTube

View File

@@ -550,7 +550,8 @@
3: { state: reinf_construct-3, visible: true}
4: { state: reinf_construct-4, visible: true}
5: { state: reinf_construct-5, visible: true}
- type: StaticPrice #DynamicPrice
- type: ReinforcedWallReplacementMarker
- type: StaticPrice
price: 150
- type: RadiationBlocker
resistance: 5
@@ -843,6 +844,7 @@
- RCDDeconstructWhitelist
- type: Sprite
sprite: Structures/Walls/solid.rsi
- type: WallReplacementMarker
- type: Construction
graph: Girder
node: wall

View File

@@ -125,3 +125,22 @@
noSpawn: true
components:
- type: RampingStationEventScheduler
# variation passes
- type: entity
id: BasicRoundstartVariation
parent: BaseGameRule
noSpawn: true
components:
- type: RoundstartStationVariationRule
rules:
- id: BasicPoweredLightVariationPass
- id: BasicTrashVariationPass
- id: SolidWallRustingVariationPass
- id: ReinforcedWallRustingVariationPass
- id: BasicPuddleMessVariationPass
prob: 0.99
orGroup: puddleMess
- id: BloodbathPuddleMessVariationPass
prob: 0.01
orGroup: puddleMess

View File

@@ -0,0 +1,120 @@
# Base
- type: entity
id: BaseVariationPass
parent: BaseGameRule
abstract: true
noSpawn: true
components:
- type: StationVariationPassRule
# Actual rules
- type: entity
id: BasicPoweredLightVariationPass
parent: BaseVariationPass
noSpawn: true
components:
- type: PoweredLightVariationPass
- type: entity
id: SolidWallRustingVariationPass
parent: BaseVariationPass
noSpawn: true
components:
- type: WallReplaceVariationPass
- type: EntityReplaceVariationPass
entitiesPerReplacementAverage: 10
entitiesPerReplacementStdDev: 2
replacements:
- id: WallSolidRust
- type: entity
id: ReinforcedWallRustingVariationPass
parent: BaseVariationPass
noSpawn: true
components:
- type: ReinforcedWallReplaceVariationPass
- type: EntityReplaceVariationPass
entitiesPerReplacementAverage: 12
entitiesPerReplacementStdDev: 2
replacements:
- id: WallReinforcedRust
- type: entity
id: BasicTrashVariationPass
parent: BaseVariationPass
noSpawn: true
components:
- type: EntitySpawnVariationPass
tilesPerEntityAverage: 35
tilesPerEntityStdDev: 4
entities:
- id: RandomSpawner
- type: weightedRandomFillSolution
id: RandomFillTrashPuddle
fills:
- quantity: 80
weight: 5
reagents:
- Vomit
- InsectBlood
- WeldingFuel
- Mold
- quantity: 55
weight: 4
reagents:
- PlantBGone
- Potassium # :trollface:
- VentCrud
- Carbon
- Hydrogen
- Fat
- SpaceLube
- SpaceGlue
- Sulfur
- Acetone
- Bleach
- quantity: 40
weight: 3
reagents:
- Blood
- CopperBlood
- Slime
- quantity: 25
weight: 1
reagents:
- Omnizine
- Desoxyephedrine
- Napalm
- Radium
- Gold
- Silver
- Sodium
- type: weightedRandomFillSolution
id: RandomFillTrashPuddleBloodbath
fills:
- quantity: 80
weight: 1
reagents:
- Blood
- type: entity
id: BasicPuddleMessVariationPass
parent: BaseVariationPass
noSpawn: true
components:
- type: PuddleMessVariationPass
randomPuddleSolutionFill: RandomFillTrashPuddle
- type: entity
id: BloodbathPuddleMessVariationPass
parent: BaseVariationPass
noSpawn: true
components:
- type: PuddleMessVariationPass
tilesPerSpillAverage: 150
tilesPerSpillStdDev: 10
randomPuddleSolutionFill: RandomFillTrashPuddleBloodbath

View File

@@ -7,6 +7,7 @@
description: survival-description
rules:
- RampingStationEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: AllAtOnce
@@ -30,6 +31,7 @@
description: extended-description
rules:
- BasicStationEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: Greenshift
@@ -39,6 +41,8 @@
name: greenshift-title
showInVote: false #4boring4vote
description: greenshift-description
rules:
- BasicRoundstartVariation
- type: gamePreset
id: Secret
@@ -72,6 +76,7 @@
rules:
- Traitor
- BasicStationEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: Deathmatch
@@ -96,6 +101,7 @@
rules:
- Nukeops
- BasicStationEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: Revolutionary
@@ -109,6 +115,7 @@
rules:
- Revolutionary
- BasicStationEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: Zombie
@@ -124,6 +131,7 @@
rules:
- Zombie
- BasicStationEventScheduler
- BasicRoundstartVariation
- type: gamePreset
id: Pirates
@@ -135,3 +143,4 @@
rules:
- Pirates
- BasicStationEventScheduler
- BasicRoundstartVariation