Chest Appearance Does Not Match Contents #1950
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a “Chest, Pot, Crate, & Beehive Appearance Does Not Match Contents” setting that inverts the effect of the “Chest Appearance Matches Contents” and “Pot, Crate, & Beehive Appearance Matches Contents” settings (the latter only if set to “Texture (Match Content)”) so that the appearance of each container will be randomly chosen from all possible appearances except the correct one for the item it contains.
For example, if “Chest Appearance Matches Contents” is set to “Texture”, a boss key can be in a wooden (junk item), gilded (major item), silver (small key), webbed (token), or pink (heart) chest, but never in a golden (boss key) chest, and if “Pot, Crate, & Beehive Appearance Matches Contents” is set to “Texture (Match Content)”, a beehive will wiggle if it contains a junk item.
I was originally going to seed the randomization using the randomizer seed xor'd with the override key of the container, ensuring that each container's appearance remains consistent across reloads. However, I ran into an issue where numerically adjacent seeds appear to yield identical random values, and containers that are physically close to each other tend to have similar override keys. So now the override keys are byteswapped before being xor'd with the randomizer seed, which seems to result in the randomization working properly.
The chest types that can be selected do not account for whether such a chest could normally be in that location, but do account for the size of webbed and pink chests (which depends on win conditions). This is similar to how ice trap cloaks behave.
Depending on settings, there are up to three chests (
Ganons Castle Light Trial Lullaby Chest
,Spirit Temple Compass Chest
, andSpirit Temple Silver Gauntlets Chest
) which are moved depending on their size. These are special-cased so a chest type whose physical size does not match that of the item's normal chest type is always selected. For example, if the non-MQ Spirit temple's compass chest is a small key, it can only appear in a gilded, golden, or (depending on wincons) webbed or pink chest.Special thanks to @rrealmuto and @mracsys for unwittingly assisting with this PR.