diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index 94b696321..a169e5cdc 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -1211,7 +1211,7 @@ void DrawEquipmentTab() { "Giant (500)", }; // only display Tycoon wallet if you're in a save file that would allow it. - if (gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > 1) { + if (gSaveContext.n64ddFlag && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS) { const std::string walletName = "Tycoon (999)"; walletNamesImpl.push_back(walletName); } diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index b845272d7..b0f2a8aac 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -602,7 +602,7 @@ const std::vector hellModePresetEntries = { PRESET_ENTRY_S32("gRandomizeLinksPocket", RO_LINKS_POCKET_NOTHING), PRESET_ENTRY_S32("gRandomizeMqDungeons", 2), PRESET_ENTRY_S32("gRandomizeRainbowBridge", RO_BRIDGE_DUNGEON_REWARDS), - PRESET_ENTRY_S32("gRandomizeShopsanity", 5), + PRESET_ENTRY_S32("gRandomizeShopsanity", RO_SHOPSANITY_FOUR_ITEMS), PRESET_ENTRY_S32("gRandomizeShuffleAdultTrade", 1), PRESET_ENTRY_S32("gRandomizeShuffleBeans", 1), PRESET_ENTRY_S32("gRandomizeShuffleCows", 1), diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 3b493e870..96d6fe82d 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -675,19 +675,19 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) { break; case RSK_SHOPSANITY: if(it.value() == "Off") { - gSaveContext.randoSettings[index].value = SHOPSANITY_OFF; + gSaveContext.randoSettings[index].value = RO_SHOPSANITY_OFF; } else if(it.value() == "0 Items") { - gSaveContext.randoSettings[index].value = SHOPSANITY_ZERO; + gSaveContext.randoSettings[index].value = RO_SHOPSANITY_ZERO_ITEMS; } else if(it.value() == "1 Item") { - gSaveContext.randoSettings[index].value = SHOPSANITY_ONE; + gSaveContext.randoSettings[index].value = RO_SHOPSANITY_ONE_ITEM; } else if(it.value() == "2 Items") { - gSaveContext.randoSettings[index].value = SHOPSANITY_TWO; + gSaveContext.randoSettings[index].value = RO_SHOPSANITY_TWO_ITEMS; } else if(it.value() == "3 Items") { - gSaveContext.randoSettings[index].value = SHOPSANITY_THREE; + gSaveContext.randoSettings[index].value = RO_SHOPSANITY_THREE_ITEMS; } else if(it.value() == "4 Items") { - gSaveContext.randoSettings[index].value = SHOPSANITY_FOUR; + gSaveContext.randoSettings[index].value = RO_SHOPSANITY_FOUR_ITEMS; } else if(it.value() == "Random") { - gSaveContext.randoSettings[index].value = SHOPSANITY_RANDOM; + gSaveContext.randoSettings[index].value = RO_SHOPSANITY_RANDOM; } break; case RSK_SHUFFLE_SCRUBS: @@ -1287,7 +1287,7 @@ ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerGet(RandomizerGe // Shopsanity with at least one item shuffled allows for a third wallet upgrade. // This is needed since Plentiful item pool also adds a third progressive wallet // but we should *not* get Tycoon's Wallet in that mode. - u8 numWallets = GetRandoSettingValue(RSK_SHOPSANITY) > 1 ? 3 : 2; + u8 numWallets = GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS ? 3 : 2; switch (randoGet) { case RG_NONE: case RG_TRIFORCE: @@ -2588,7 +2588,7 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_SHUFFLE_DUNGEON_REWARDS] = CVar_GetS32("gRandomizeShuffleDungeonReward", RO_DUNGEON_REWARDS_END_OF_DUNGEON); cvarSettings[RSK_SHUFFLE_SONGS] = CVar_GetS32("gRandomizeShuffleSongs", 0); cvarSettings[RSK_SHUFFLE_TOKENS] = CVar_GetS32("gRandomizeShuffleTokens", 0); - cvarSettings[RSK_SHOPSANITY] = CVar_GetS32("gRandomizeShopsanity", 0); + cvarSettings[RSK_SHOPSANITY] = CVar_GetS32("gRandomizeShopsanity", RO_SHOPSANITY_OFF); cvarSettings[RSK_SHUFFLE_SCRUBS] = CVar_GetS32("gRandomizeShuffleScrubs", 0); cvarSettings[RSK_SHUFFLE_COWS] = CVar_GetS32("gRandomizeShuffleCows", 0); cvarSettings[RSK_SHUFFLE_ADULT_TRADE] = CVar_GetS32("gRandomizeShuffleAdultTrade", 0); diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index d13440e93..e96972be4 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -280,7 +280,7 @@ ItemTrackerNumbers GetItemCurrentAndMax(ItemTrackerItem item) { case ITEM_WALLET_ADULT: case ITEM_WALLET_GIANT: result.currentCapacity = CUR_CAPACITY(UPG_WALLET); - result.maxCapacity = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > 1 ? 999 : 500; + result.maxCapacity = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SHOPSANITY) > RO_SHOPSANITY_ZERO_ITEMS ? 999 : 500; result.currentAmmo = gSaveContext.rupees; break; case ITEM_BOMBCHU: diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 9d04d3b09..e05b1efee 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -108,7 +108,7 @@ void SaveManager::LoadRandomizerVersion1() { if (randomizer->GetRandoSettingValue(RSK_SHUFFLE_SCRUBS) > 0) { merchantPricesSize += NUM_SCRUBS; } - if (randomizer->GetRandoSettingValue(RSK_SHOPSANITY) > 0) { + if (randomizer->GetRandoSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) { merchantPricesSize += NUM_SHOP_ITEMS; } diff --git a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 7746948c1..2c96f8f38 100644 --- a/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/soh/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -410,7 +410,7 @@ void EnGirlA_InitItem(EnGirlA* this, PlayState* play) { return; } - if (!gSaveContext.n64ddFlag || !Randomizer_GetSettingValue(RSK_SHOPSANITY)) { + if (!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF) { this->objBankIndex = Object_GetIndex(&play->objectCtx, shopItemEntries[params].objID); } else { s16 objectId = shopItemEntries[params].objID; @@ -603,7 +603,8 @@ s32 EnGirlA_CanBuy_DekuShield(PlayState* play, EnGirlA* this) { } s32 EnGirlA_CanBuy_GoronTunic(PlayState* play, EnGirlA* this) { - if (LINK_AGE_IN_YEARS == YEARS_CHILD && (!gSaveContext.n64ddFlag || !Randomizer_GetSettingValue(RSK_SHOPSANITY))) { + if (LINK_AGE_IN_YEARS == YEARS_CHILD && + (!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF)) { return CANBUY_RESULT_CANT_GET_NOW; } if (gBitFlags[9] & gSaveContext.inventory.equipment) { @@ -619,7 +620,8 @@ s32 EnGirlA_CanBuy_GoronTunic(PlayState* play, EnGirlA* this) { } s32 EnGirlA_CanBuy_ZoraTunic(PlayState* play, EnGirlA* this) { - if (LINK_AGE_IN_YEARS == YEARS_CHILD && (!gSaveContext.n64ddFlag || !Randomizer_GetSettingValue(RSK_SHOPSANITY))) { + if (LINK_AGE_IN_YEARS == YEARS_CHILD && + (!gSaveContext.n64ddFlag || Randomizer_GetSettingValue(RSK_SHOPSANITY) == RO_SHOPSANITY_OFF)) { return CANBUY_RESULT_CANT_GET_NOW; } if (gBitFlags[10] & gSaveContext.inventory.equipment) { diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 14551987f..1e470a89c 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -427,7 +427,7 @@ void EnOssan_SpawnItemsOnShelves(EnOssan* this, PlayState* play, ShopItem* shopI this->shelfSlots[i] = NULL; } else { itemParams = sShopItemReplaceFunc[shopItems->shopItemIndex](shopItems->shopItemIndex); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY)) { + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) { ShopItemIdentity shopItemIdentity = Randomizer_IdentifyShopItem(play->sceneNum, i); if (shopItemIdentity.randomizerCheck != RC_UNKNOWN_CHECK) { itemParams = shopItemIdentity.enGirlAShopItem; @@ -447,7 +447,7 @@ void EnOssan_SpawnItemsOnShelves(EnOssan* this, PlayState* play, ShopItem* shopI shelves->actor.world.pos.y + shopItems->yOffset, shelves->actor.world.pos.z + shopItems->zOffset, shelves->actor.shape.rot.x, shelves->actor.shape.rot.y + sItemShelfRot[i], shelves->actor.shape.rot.z, itemParams); - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY)) { + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHOPSANITY) != RO_SHOPSANITY_OFF) { this->shelfSlots[i]->randoSlotIndex = i; } }