- Devs place a bunch of waypoints for chests of an appropriate CR
- Devs place a special object that specifies min & max number of chests for each CR, % chance of being trapped for each CR, min & max number of mimics for each CR, and mimic CR for each chest CR (defaults to the chest CR if none selected).
- Devs manually place boss chests, magic strongboxes, and other chests which should not be randomized
- Begin loop over CRs
- Count the number of waypoints for this CR
- Spawn between the minimum and maximum number of chests for this CR. (Equal chance for all numbers in the range, so if it's 3-5 chests, you get three 1/3rd of the time, four 1/3rd of the time, and five 1/3rd of the time.)
- Spawn between the minimum and maximum number of mimics for this CR. If you run out of waypoints, no further mimics are spawned. (This should never happen, but the code is careful.)
- End loop over CRs
Mimics can't prevent chests from spawning, but if you randomized CR28 with a single waypoint and had 0-1 chests and 1 mimic, then there's a 50/50 chance that the chest would be a mimic every reset. (Since it can't be a mimic if there's already a chest there.) This sort of thing may or may not be happening in several places of BGTSCC at various CRs.