From 3fb698bab87fc7d4687cdd76b9c2fdd5bb0d4420 Mon Sep 17 00:00:00 2001 From: LuigiXHero Date: Sun, 20 Aug 2023 11:24:08 -0700 Subject: [PATCH] Selection for Vanilla/MQ dungeons (#3058) * Selection for Vanilla/MQ dungeons * Match names to exclude location list --------- Co-authored-by: LuigiXHero --- .../randomizer/3drando/settings.cpp | 20 ++++- .../Enhancements/randomizer/randomizer.cpp | 77 ++++++++++++++++--- .../Enhancements/randomizer/randomizerTypes.h | 13 ++++ 3 files changed, 98 insertions(+), 12 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index 7f6b8d7d8..42c51797d 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -108,7 +108,8 @@ namespace Settings { Option BombchusInLogic = Option::Bool("Bombchus in Logic", {"Off", "On"}, {bombchuLogicDesc}); Option AmmoDrops = Option::U8 ("Ammo Drops", {"On", "On + Bombchu", "Off"}, {defaultAmmoDropsDesc, bombchuDropsDesc, noAmmoDropsDesc}, OptionCategory::Setting, AMMODROPS_BOMBCHU); Option HeartDropRefill = Option::U8 ("Heart Drops and Refills",{"On", "No Drop", "No Refill", "Off"}, {defaultHeartDropsDesc, noHeartDropsDesc, noHeartRefillDesc, scarceHeartsDesc}, OptionCategory::Setting, HEARTDROPREFILL_VANILLA); - Option MQDungeonCount = Option::U8 ("MQ Dungeon Count", {MultiVecOpts({NumOpts(0, 12), {"Random"}})}, {mqDungeonCountDesc}); + Option MQDungeonCount = Option::U8( + "MQ Dungeon Count", { MultiVecOpts({ NumOpts(0, 12), { "Random" }, { "Selection" } }) }, { mqDungeonCountDesc }); uint8_t MQSet; bool DungeonModesKnown[12]; Option SetDungeonTypes = Option::Bool("Set Dungeon Types", {"Off", "On"}, {setDungeonTypesDesc}); @@ -2877,12 +2878,27 @@ namespace Settings { } else { GanonsTrialsCount.SetSelectedIndex(cvarSettings[RSK_TRIAL_COUNT]); } + SetDungeonTypes.SetSelectedIndex(false); if (cvarSettings[RSK_RANDOM_MQ_DUNGEONS] == RO_MQ_DUNGEONS_RANDOM_NUMBER) { MQDungeonCount.SetSelectedIndex(13); } else if (cvarSettings[RSK_RANDOM_MQ_DUNGEONS] == RO_MQ_DUNGEONS_NONE) { MQDungeonCount.SetSelectedIndex(0); - } else { + } else if (cvarSettings[RSK_RANDOM_MQ_DUNGEONS] == RO_MQ_DUNGEONS_SET_NUMBER) { MQDungeonCount.SetSelectedIndex(cvarSettings[RSK_MQ_DUNGEON_COUNT]); + } else if (cvarSettings[RSK_RANDOM_MQ_DUNGEONS] == RO_MQ_DUNGEONS_SELECTION) { + SetDungeonTypes.SetSelectedIndex(true); + MQDeku.SetSelectedIndex(cvarSettings[RSK_MQ_DEKU_TREE]); + MQDodongo.SetSelectedIndex(cvarSettings[RSK_MQ_DODONGOS_CAVERN]); + MQJabu.SetSelectedIndex(cvarSettings[RSK_MQ_JABU_JABU]); + MQForest.SetSelectedIndex(cvarSettings[RSK_MQ_FOREST_TEMPLE]); + MQFire.SetSelectedIndex(cvarSettings[RSK_MQ_FIRE_TEMPLE]); + MQWater.SetSelectedIndex(cvarSettings[RSK_MQ_WATER_TEMPLE]); + MQSpirit.SetSelectedIndex(cvarSettings[RSK_MQ_SPIRIT_TEMPLE]); + MQShadow.SetSelectedIndex(cvarSettings[RSK_MQ_SHADOW_TEMPLE]); + MQIceCavern.SetSelectedIndex(cvarSettings[RSK_MQ_ICE_CAVERN]); + MQBotW.SetSelectedIndex(cvarSettings[RSK_MQ_BOTTOM_OF_THE_WELL]); + MQGTG.SetSelectedIndex(cvarSettings[RSK_MQ_GTG]); + MQCastle.SetSelectedIndex(cvarSettings[RSK_MQ_GANONS_CASTLE]); } ShuffleRewards.SetSelectedIndex(cvarSettings[RSK_SHUFFLE_DUNGEON_REWARDS]); ShuffleSongs.SetSelectedIndex(cvarSettings[RSK_SHUFFLE_SONGS]); diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 706605a01..e48c12968 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -349,7 +349,16 @@ std::unordered_map SpoilerfileSettingNameToEn { "Timesaver Settings:Skip Scarecrow's Song", RSK_SKIP_SCARECROWS_SONG }, { "Timesaver Settings:Enable Glitch-Useful Cutscenes", RSK_ENABLE_GLITCH_CUTSCENES }, { "World Settings:MQ Dungeons", RSK_RANDOM_MQ_DUNGEONS }, - { "World Settings:MQ Dungeon Count", RSK_MQ_DUNGEON_COUNT } + { "World Settings:MQ Dungeon Count", RSK_MQ_DUNGEON_COUNT }, + { "Shuffle Dungeon Quest:Forest Temple", RSK_MQ_FOREST_TEMPLE }, + { "Shuffle Dungeon Quest:Fire Temple", RSK_MQ_FIRE_TEMPLE }, + { "Shuffle Dungeon Quest:Water Temple", RSK_MQ_WATER_TEMPLE }, + { "Shuffle Dungeon Quest:Spirit Temple", RSK_MQ_SPIRIT_TEMPLE }, + { "Shuffle Dungeon Quest:Shadow Temple", RSK_MQ_SHADOW_TEMPLE }, + { "Shuffle Dungeon Quest:Bottom of the Well", RSK_MQ_BOTTOM_OF_THE_WELL }, + { "Shuffle Dungeon Quest:Ice Cavern", RSK_MQ_ICE_CAVERN }, + { "Shuffle Dungeon Quest:GTG", RSK_MQ_GTG }, + { "Shuffle Dungeon Quest:Ganon's Castle", RSK_MQ_GANONS_CASTLE }, }; std::string sanitize(std::string stringValue) { @@ -1105,12 +1114,19 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) { } break; case RSK_MQ_DUNGEON_COUNT: - if (it.value() == "Random") { - gSaveContext.randoSettings[index].value = 13; - break; + if (it.value() == "Count") { + numericValueString = it.value(); + gSaveContext.randoSettings[index].value = std::stoi(numericValueString); } - numericValueString = it.value(); - gSaveContext.randoSettings[index].value = std::stoi(numericValueString); + + else if (it.value() == "Random") { + gSaveContext.randoSettings[index].value = 13; + } + + else if (it.value() == "Selection") { + gSaveContext.randoSettings[index].value = RO_MQ_DUNGEONS_SELECTION; + } + break; case RSK_SHUFFLE_DUNGEON_ENTRANCES: if (it.value() == "Off") { @@ -2939,6 +2955,19 @@ void GenerateRandomizerImgui(std::string seed = "") { cvarSettings[RSK_MQ_DUNGEON_COUNT] = 0; } + cvarSettings[RSK_MQ_DEKU_TREE] = CVarGetInteger("gRandomizeMqDungeonsDekuTree", 0); + cvarSettings[RSK_MQ_DODONGOS_CAVERN] = CVarGetInteger("gRandomizeMqDungeonsDodongosCavern", 0); + cvarSettings[RSK_MQ_JABU_JABU] = CVarGetInteger("gRandomizeMqDungeonsJabuJabu", 0); + cvarSettings[RSK_MQ_FOREST_TEMPLE] = CVarGetInteger("gRandomizeMqDungeonsForestTemple", 0); + cvarSettings[RSK_MQ_FIRE_TEMPLE] = CVarGetInteger("gRandomizeMqDungeonsFireTemple", 0); + cvarSettings[RSK_MQ_WATER_TEMPLE] = CVarGetInteger("gRandomizeMqDungeonsWaterTemple", 0); + cvarSettings[RSK_MQ_SPIRIT_TEMPLE] = CVarGetInteger("gRandomizeMqDungeonsSpiritTemple", 0); + cvarSettings[RSK_MQ_SHADOW_TEMPLE] = CVarGetInteger("gRandomizeMqDungeonsShadowTemple", 0); + cvarSettings[RSK_MQ_BOTTOM_OF_THE_WELL] = CVarGetInteger("gRandomizeMqDungeonsBottomOfTheWell", 0); + cvarSettings[RSK_MQ_ICE_CAVERN] = CVarGetInteger("gRandomizeMqDungeonsIceCavern", 0); + cvarSettings[RSK_MQ_GTG] = CVarGetInteger("gRandomizeMqDungeonsGTG", 0); + cvarSettings[RSK_MQ_GANONS_CASTLE] = CVarGetInteger("gRandomizeMqDungeonsGanonsCastle", 0); + // Enable if any of the entrance rando options are enabled. cvarSettings[RSK_SHUFFLE_ENTRANCES] = CVarGetInteger("gRandomizeShuffleDungeonsEntrances", RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) || CVarGetInteger("gRandomizeShuffleBossEntrances", RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF) || @@ -3030,7 +3059,7 @@ void RandomizerSettingsWindow::DrawElement() { "Dungeon rewards", "Dungeons", "Tokens", "Greg" }; static const char* randoBridgeRewardOptions[3] = { "Standard Rewards", "Greg as Reward", "Greg as Wildcard" }; static const char* randoGanonsTrial[3] = { "Skip", "Set Number", "Random Number" }; - static const char* randoMqDungeons[3] = { "None", "Set Number", "Random Number" }; + static const char* randoMqDungeons[4] = { "None", "Set Number", "Random Number", "Selection" }; // World Settings static const char* randoStartingAge[3] = { "Child", "Adult", "Random" }; @@ -3449,13 +3478,41 @@ void RandomizerSettingsWindow::DrawElement() { "Set Number - Select a number of dungeons that will be their Master Quest versions " "using the slider below. Which dungeons are set to be the Master Quest variety will be random.\n" "\n" - "Random Number - A Random number and set of dungeons will be their Master Quest varieties." + "Random Number - A Random number and set of dungeons will be their Master Quest varieties.\n" + "\n" + "Selection - Leave unchecked for Vanilla and checked for Master Quest." ); UIWidgets::EnhancementCombobox("gRandomizeMqDungeons", randoMqDungeons, RO_MQ_DUNGEONS_NONE); ImGui::PopItemWidth(); if (CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_SET_NUMBER) { - UIWidgets::PaddedEnhancementSliderInt("Master Quest Dungeon Count: %d", "##RandoMqDungeonCount", - "gRandomizeMqDungeonCount", 1, 12, "", CVarGetInteger("gRandomizeMqDungeonCount", 12), true, true, false); + UIWidgets::PaddedEnhancementSliderInt( + "Master Quest Dungeon Count: %d", "##RandoMqDungeonCount", "gRandomizeMqDungeonCount", 1, + 12, "", CVarGetInteger("gRandomizeMqDungeonCount", 12), true, true, false); + } + else if (CVarGetInteger("gRandomizeMqDungeons", RO_MQ_DUNGEONS_NONE) == RO_MQ_DUNGEONS_SELECTION) { + UIWidgets::EnhancementCheckbox("Deku Tree##RandomizeMqDungeons", + "gRandomizeMqDungeonsDekuTree"); + UIWidgets::EnhancementCheckbox("Dodongo's Cavern##RandomizeMqDungeons", + "gRandomizeMqDungeonsDodongosCavern"); + UIWidgets::EnhancementCheckbox("Jabu Jabu's Belly##RandomizeMqDungeons", + "gRandomizeMqDungeonsJabuJabu"); + UIWidgets::EnhancementCheckbox("Forest Temple##RandomizeMqDungeons", + "gRandomizeMqDungeonsForestTemple"); + UIWidgets::EnhancementCheckbox("Fire Temple##RandomizeMqDungeons", + "gRandomizeMqDungeonsFireTemple"); + UIWidgets::EnhancementCheckbox("Water Temple##RandomizeMqDungeons", + "gRandomizeMqDungeonsWaterTemple"); + UIWidgets::EnhancementCheckbox("Spirit Temple##RandomizeMqDungeons", + "gRandomizeMqDungeonsSpiritTemple"); + UIWidgets::EnhancementCheckbox("Shadow Temple##RandomizeMqDungeons", + "gRandomizeMqDungeonsShadowTemple"); + UIWidgets::EnhancementCheckbox("Bottom of the Well##RandomizeMqDungeons", + "gRandomizeMqDungeonsBottomOfTheWell"); + UIWidgets::EnhancementCheckbox("Ice Cavern##RandomizeMqDungeons", + "gRandomizeMqDungeonsIceCavern"); + UIWidgets::EnhancementCheckbox("Gerudo Training Grounds##RandomizeMqDungeons", "gRandomizeMqDungeonsGTG"); + UIWidgets::EnhancementCheckbox("Ganon's Castle##RandomizeMqDungeons", + "gRandomizeMqDungeonsGanonsCastle"); } } diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index e9be6740c..8f2bad63c 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -1404,6 +1404,18 @@ typedef enum { RSK_LINKS_POCKET, RSK_RANDOM_MQ_DUNGEONS, RSK_MQ_DUNGEON_COUNT, + RSK_MQ_DEKU_TREE, + RSK_MQ_DODONGOS_CAVERN, + RSK_MQ_JABU_JABU, + RSK_MQ_FOREST_TEMPLE, + RSK_MQ_FIRE_TEMPLE, + RSK_MQ_WATER_TEMPLE, + RSK_MQ_SPIRIT_TEMPLE, + RSK_MQ_SHADOW_TEMPLE, + RSK_MQ_BOTTOM_OF_THE_WELL, + RSK_MQ_ICE_CAVERN, + RSK_MQ_GTG, + RSK_MQ_GANONS_CASTLE, RSK_LACS_STONE_COUNT, RSK_LACS_MEDALLION_COUNT, RSK_LACS_REWARD_COUNT, @@ -1734,6 +1746,7 @@ typedef enum { RO_MQ_DUNGEONS_NONE, RO_MQ_DUNGEONS_SET_NUMBER, RO_MQ_DUNGEONS_RANDOM_NUMBER, + RO_MQ_DUNGEONS_SELECTION, } RandoOptionMQDungeons; typedef enum {