Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
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.MoveNextwith single-match fail-fast validation - Rarity fallback: scans
cosmeticWorldObjectSetupsfor available volume when current rarity has none - Fail-safe patching: all target methods verified before registration; exception during patch triggers
UnpatchSelf() - Random sequence preservation:
GuaranteedChanceRollconsumes Unity Random before returning forced value
Technical
- Target:
ValuableDirector.SetupHost(cosmetic loop only) - No patches to
EnemyDirectororLevelGenerator - Harmony transpiler with
InvalidOperationException+ self-unpatch on match failure - Prefix/Postfix with try/catch guards on all hooks