Rando Enhancement: Mysterious Shuffled Items (#3227)

* Add rando enhancement "Mysterious Shuffled Items", which obfuscates shuffled freestanding/drawn-in-world items (PoH, tokens, shop items) with a custom question mark model (thanks Hato), and uses the "mysterious item" functionality of `GetMerchantMessage` for everything that supports it, regardless of hint status on generation.

* Reverted back to rando enhancement, but added condition for Mysterious Shuffle not being on for the gem rotation fix to apply.

* First attempt at changing to fake GetItemEntry instead of directly calling the mystery draw function. Needs more work.

* Updated CVar to reflect CVar rework values.

Added `IsCheckShuffled` as preliminary function for checking *only* if a check is shuffled, not necessarily if it is just visible on the tracker. This accounts for the difference between tokensanity and "Always Show GS On Tracker", where you don't want to obfuscate the latter.

* Bit of cleanup.

* Cross-platform building edits. If anyone has a better idea of how to handle this fake GIE, I'm all ears.

* Update to CVar macros.

* Fix freestanding item gives.
Fix mysterious item model colors.

* Fix bombchu bowling mystery.

* Remove bowling bomchus check obfuscation (unused, removed in v3).
This commit is contained in:
Malkierian 2024-05-06 17:17:08 -07:00 committed by GitHub
commit b3d51441eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 896 additions and 41 deletions

View file

@ -1223,7 +1223,7 @@ void LoadSettings() {
}
}
bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj) {
bool IsCheckShuffled(RandomizerCheckObject rcObj) {
if (IS_RANDO && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_LOGIC_RULES) != RO_LOGIC_VANILLA) {
return
(rcObj.rcArea != RCAREA_INVALID) && // don't show Invalid locations
@ -1236,7 +1236,7 @@ bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj) {
rcObj.vOrMQ == RCVORMQ_MQ && OTRGlobals::Instance->gRandomizer->masterQuestDungeons.contains(rcObj.sceneId) ||
rcObj.vOrMQ == RCVORMQ_VANILLA && !OTRGlobals::Instance->gRandomizer->masterQuestDungeons.contains(rcObj.sceneId)
) &&
(rcObj.rcType != RCTYPE_SHOP || (showShops && (!hideShopRightChecks || hideShopRightChecks && rcObj.actorParams > 0x03))) &&
(rcObj.rcType != RCTYPE_SHOP || (showShops && rcObj.actorParams > 0x03)) &&
(rcObj.rcType != RCTYPE_SCRUB ||
showScrubs ||
rcObj.rc == RC_LW_DEKU_SCRUB_NEAR_BRIDGE || // The 3 scrubs that are always randomized
@ -1245,7 +1245,7 @@ bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj) {
) &&
(rcObj.rcType != RCTYPE_MERCHANT || showMerchants) &&
(rcObj.rcType != RCTYPE_OCARINA || showOcarinas) &&
(rcObj.rcType != RCTYPE_SKULL_TOKEN || alwaysShowGS ||
(rcObj.rcType != RCTYPE_SKULL_TOKEN ||
(showOverworldTokens && RandomizerCheckObjects::AreaIsOverworld(rcObj.rcArea)) ||
(showDungeonTokens && RandomizerCheckObjects::AreaIsDungeon(rcObj.rcArea))
) &&
@ -1265,6 +1265,7 @@ bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj) {
(rcObj.rcType != RCTYPE_BOSS_KEY || showBossKeysanity) &&
(rcObj.rcType != RCTYPE_GANON_BOSS_KEY || showGanonBossKey) &&
(rcObj.rc != RC_KAK_100_GOLD_SKULLTULA_REWARD || show100SkullReward) &&
(rcObj.rc != RC_MARKET_BOMBCHU_BOWLING_BOMBCHUS) &&
(rcObj.rcType != RCTYPE_GF_KEY && rcObj.rc != RC_GF_GERUDO_MEMBERSHIP_CARD ||
(showGerudoCard && rcObj.rc == RC_GF_GERUDO_MEMBERSHIP_CARD) ||
(fortressNormal && showGerudoFortressKeys && rcObj.rcType == RCTYPE_GF_KEY) ||
@ -1280,6 +1281,10 @@ bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj) {
return false;
}
bool IsVisibleInCheckTracker(RandomizerCheckObject rcObj) {
return IsCheckShuffled(rcObj) || (rcObj.rcType == RCTYPE_SKULL_TOKEN && alwaysShowGS) || (rcObj.rcType == RCTYPE_SHOP && (showShops && (!hideShopRightChecks)));
}
void UpdateInventoryChecks() {
//For all the areas with maps, if you have one, spoil the area
for (auto [scene, area] : DungeonRCAreasBySceneID) {
@ -1444,6 +1449,8 @@ void DrawLocation(RandomizerCheckObject rcObj) {
//Draw the extra info
txt = "";
bool mystery = CVarGetInteger(CVAR_RANDOMIZER_ENHANCEMENT("MysteriousShuffle"), 0) && OTRGlobals::Instance->gRandomizer->merchantPrices.contains(rcObj.rc);
if (checkData.hintItem != 0) {
// TODO hints
} else if (status != RCSHOW_UNCHECKED) {
@ -1466,16 +1473,16 @@ void DrawLocation(RandomizerCheckObject rcObj) {
case RCSHOW_IDENTIFIED:
case RCSHOW_SEEN:
if (IS_RANDO) {
if (gSaveContext.itemLocations[rcObj.rc].get.rgID == RG_ICE_TRAP) {
if (gSaveContext.itemLocations[rcObj.rc].get.rgID == RG_ICE_TRAP && !mystery) {
if (status == RCSHOW_IDENTIFIED) {
txt = gSaveContext.itemLocations[rcObj.rc].get.trickName;
} else {
txt = OTRGlobals::Instance->gRandomizer->EnumToSpoilerfileGetName[gSaveContext.itemLocations[rcObj.rc].get.fakeRgID][gSaveContext.language];
}
} else {
} else if (!mystery) {
txt = OTRGlobals::Instance->gRandomizer->EnumToSpoilerfileGetName[gSaveContext.itemLocations[rcObj.rc].get.rgID][gSaveContext.language];
}
if (status == RCSHOW_IDENTIFIED) {
if (!IsVisibleInCheckTracker(rcObj) && status == RCSHOW_IDENTIFIED && !mystery) {
txt += fmt::format(" - {}", gSaveContext.checkTrackerData[rcObj.rc].price);
}
} else {