khalil-CosmeticBoxConfig icon

CosmeticBoxConfig

Configure cosmetic box spawns per level within original spawn volumes. Fixed mode targets 0-20 actual boxes; Random mode guarantees at least one.

CHANGELOG

Changelog

v1.0.0 (2026-05-17)

Added

  • Initial release
  • SpawnMode enum config: left/right selector in in-game config UI (Random / Fixed)
  • Fixed mode: targets N actual cosmetic boxes using chance-gate forcing with compensation window
  • Random mode: guarantees at least 1 actual box when a spawn volume exists, then vanilla probability
  • Configurable range: 0–20 boxes in Fixed mode (0 = no boxes)
  • Transpiler patch: replaces chance-gate comparison in ValuableDirector.SetupHost.MoveNext with single-match fail-fast validation
  • Rarity fallback: scans cosmeticWorldObjectSetups for available volume when current rarity has none
  • Fail-safe patching: all target methods verified before registration; exception during patch triggers UnpatchSelf()
  • Random sequence preservation: GuaranteedChanceRoll consumes Unity Random before returning forced value

Technical

  • Target: ValuableDirector.SetupHost (cosmetic loop only)
  • No patches to EnemyDirector or LevelGenerator
  • Harmony transpiler with InvalidOperationException + self-unpatch on match failure
  • Prefix/Postfix with try/catch guards on all hooks