From 3aefd4c5192c044492ace6004639d94c81df76ee Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 3 Sep 2022 12:47:32 +0200 Subject: [PATCH 1/9] gSaveContext access in GameMenuBar.cpp --- soh/soh/GameMenuBar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index 26b4b1ffb..e9db4c949 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -24,6 +24,7 @@ #include "UIWidgets.hpp" #include "include/z64audio.h" +#include "include/variables.h" #define EXPERIMENTAL() \ ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 50, 50, 255)); \ From 8d2f63419f94b26e4bcdd4f8618b0dbcf03c20b5 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 3 Sep 2022 14:40:41 +0200 Subject: [PATCH 2/9] Implement Skip Scarecrow's Song --- soh/soh/Enhancements/randomizer/3drando/logic.cpp | 2 +- soh/soh/Enhancements/randomizer/3drando/settings.cpp | 4 +++- .../Enhancements/randomizer/3drando/spoiler_log.cpp | 3 ++- soh/soh/Enhancements/randomizer/randomizer.cpp | 12 ++++++++++++ soh/soh/Enhancements/randomizer/randomizerTypes.h | 1 + soh/soh/GameMenuBar.cpp | 9 +++++++-- .../overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c | 10 ++++++---- 7 files changed, 32 insertions(+), 9 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/logic.cpp b/soh/soh/Enhancements/randomizer/3drando/logic.cpp index f85e4ed2a..f23c78649 100644 --- a/soh/soh/Enhancements/randomizer/3drando/logic.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/logic.cpp @@ -685,7 +685,7 @@ namespace Logic { MasterSword = MasterSword || IsAdult; BiggoronSword = BiggoronSword || ProgressiveGiantKnife >= 2; - ScarecrowSong = ScarecrowSong || (ChildScarecrow && AdultScarecrow); + ScarecrowSong = ScarecrowSong || FreeScarecrow || (ChildScarecrow && AdultScarecrow); Scarecrow = Hookshot && CanPlay(ScarecrowSong); DistantScarecrow = Longshot && CanPlay(ScarecrowSong); diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index dba8859e9..ed53f12f6 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -258,7 +258,7 @@ namespace Settings { Option SkipTowerEscape = Option::Bool("Skip Tower Escape", {"Don't Skip", "Skip"}, {skipTowerEscapeDesc}, OptionCategory::Setting, SKIP); Option SkipEponaRace = Option::Bool("Skip Epona Race", {"Don't Skip", "Skip"}, {skipEponaRaceDesc}); Option SkipMinigamePhases = Option::Bool("Minigames repetitions", {"Don't Skip", "Skip"}, {skipMinigamePhasesDesc}); - Option FreeScarecrow = Option::Bool("Free Scarecrow", {"Off", "On"}, {freeScarecrowDesc}); + Option FreeScarecrow = Option::Bool("Skip Scarecrow's Song", {"Off", "On"}, {freeScarecrowDesc}); Option FourPoesCutscene = Option::Bool("Four Poes Cutscene", {"Don't Skip", "Skip"}, {fourPoesDesc}, OptionCategory::Setting, SKIP); Option LakeHyliaOwl = Option::Bool("Lake Hylia Owl", {"Don't Skip", "Skip"}, {lakeHyliaOwlDesc}, OptionCategory::Setting, SKIP); Option BigPoeTargetCount = Option::U8 ("Big Poe Target Count", {NumOpts(1, 10)}, {bigPoeTargetCountDesc}); @@ -2588,6 +2588,8 @@ namespace Settings { CompleteMaskQuest.SetSelectedIndex(cvarSettings[RSK_COMPLETE_MASK_QUEST]); + FreeScarecrow.SetSelectedIndex(cvarSettings[RSK_SKIP_SCARECROWS_SONG]); + EnableGlitchCutscenes.SetSelectedIndex(cvarSettings[RSK_ENABLE_GLITCH_CUTSCENES]); NightGSExpectSuns.SetSelectedIndex(cvarSettings[RSK_SKULLS_SUNS_SONG]); diff --git a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp index 09f98f6ce..461b54cb9 100644 --- a/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/spoiler_log.cpp @@ -346,7 +346,8 @@ static void WriteSettings(const bool printAll = false) { setting->GetName() == "Skip Epona Race" || setting->GetName() == "Skip Tower Escape" || setting->GetName() == "Skip Child Stealth" || - setting->GetName() == "Complete Mask Quest" || + setting->GetName() == "Complete Mask Quest" || + setting->GetName() == "Skip Scarecrow's Song" || setting->GetName() == "Enable Glitch-Useful Cutscenes") { std::string settingName = menu->name + ":" + setting->GetName(); jsonData["settings"][settingName] = setting->GetSelectedOptionText(); diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index a81fdb839..7dfa20c3b 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -595,6 +595,7 @@ std::unordered_map SpoilerfileSettingNameToEn { "Timesaver Settings:Skip Epona Race", RSK_SKIP_EPONA_RACE }, { "Timesaver Settings:Skip Tower Escape", RSK_SKIP_TOWER_ESCAPE }, { "Timesaver Settings:Complete Mask Quest", RSK_COMPLETE_MASK_QUEST }, + { "Timesaver Settings:Skip Scarecrow's Song", RSK_SKIP_SCARECROWS_SONG }, { "Timesaver Settings:Enable Glitch-Useful Cutscenes", RSK_ENABLE_GLITCH_CUTSCENES }, }; @@ -823,6 +824,7 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) { case RSK_STARTING_DEKU_SHIELD: case RSK_STARTING_KOKIRI_SWORD: case RSK_COMPLETE_MASK_QUEST: + case RSK_SKIP_SCARECROWS_SONG: case RSK_ENABLE_GLITCH_CUTSCENES: case RSK_BOMBCHUS_IN_LOGIC: if(it.value() == "Off") { @@ -3466,6 +3468,7 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_SKIP_EPONA_RACE] = CVar_GetS32("gRandomizeSkipEponaRace", 0); cvarSettings[RSK_SKIP_TOWER_ESCAPE] = CVar_GetS32("gRandomizeSkipTowerEscape", 0); cvarSettings[RSK_COMPLETE_MASK_QUEST] = CVar_GetS32("gRandomizeCompleteMaskQuest", 0); + cvarSettings[RSK_SKIP_SCARECROWS_SONG] = CVar_GetS32("gRandomizeSkipScarecrowsSong", 0); cvarSettings[RSK_ENABLE_GLITCH_CUTSCENES] = CVar_GetS32("gRandomizeEnableGlitchCutscenes", 0); cvarSettings[RSK_SKULLS_SUNS_SONG] = CVar_GetS32("gRandomizeGsExpectSunsSong", 0); @@ -4178,6 +4181,15 @@ void DrawRandoEditor(bool& open) { UIWidgets::PaddedSeparator(); + // Skip Scarecrow Song + UIWidgets::EnhancementCheckbox(Settings::FreeScarecrow.GetName().c_str(), + "gRandomizeSkipScarecrowsSong"); + UIWidgets::InsertHelpHoverText( + "Start with the ability to summon Pierre the scarecrow. Pulling out an ocarina in the usual locations will automatically summon him." + ); + + UIWidgets::PaddedSeparator(); + ImGui::EndChild(); // COLUMN 2 - Item Pool & Hint Settings diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index 064cdc499..9619f7db3 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -1014,6 +1014,7 @@ typedef enum { RSK_SKIP_EPONA_RACE, RSK_SKIP_TOWER_ESCAPE, RSK_COMPLETE_MASK_QUEST, + RSK_SKIP_SCARECROWS_SONG, RSK_ENABLE_GLITCH_CUTSCENES, RSK_SKULLS_SUNS_SONG, RSK_SHUFFLE_ADULT_TRADE, diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index e9db4c949..4e27c5777 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -23,8 +23,8 @@ #endif #include "UIWidgets.hpp" +#include "include/global.h" #include "include/z64audio.h" -#include "include/variables.h" #define EXPERIMENTAL() \ ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 50, 50, 255)); \ @@ -689,8 +689,13 @@ namespace GameMenuBar { UIWidgets::PaddedEnhancementCheckbox("Better Owl", "gBetterOwl", true, false); UIWidgets::Tooltip("The default response to Kaepora Gaebora is always that you understood what he said"); UIWidgets::PaddedEnhancementCheckbox("Fast Ocarina Playback", "gFastOcarinaPlayback", true, false); + bool forceSkipScarecrow = gSaveContext.n64ddFlag && + OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_SKIP_SCARECROWS_SONG); + const char* forceSkipScarecrowText = + "This setting is forcefully enabled because a savefile\nwith \"Skip Scarecrow Song\" is loaded"; UIWidgets::Tooltip("Skip the part where the Ocarina playback is called when you play a song"); - UIWidgets::PaddedEnhancementCheckbox("Skip Scarecrow Song", "gSkipScarecrow", true, false); + UIWidgets::PaddedEnhancementCheckbox("Skip Scarecrow Song", "gSkipScarecrow", true, false, + forceSkipScarecrow, forceSkipScarecrowText, UIWidgets::CheckboxGraphics::Checkmark); UIWidgets::Tooltip("Pierre appears when Ocarina is pulled out. Requires learning scarecrow song."); UIWidgets::PaddedEnhancementCheckbox("Instant Putaway", "gInstantPutaway", true, false); UIWidgets::Tooltip("Allow Link to put items away without having to wait around"); diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index a7be7866d..f6f37e489 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -118,10 +118,12 @@ void func_80A90264(EnKakasi2* this, GlobalContext* globalCtx) { this->unk_194++; - if (((BREG(1) != 0) || ((CVar_GetS32("gSkipScarecrow", 0) != 0) && - (globalCtx->msgCtx.ocarinaAction == OCARINA_ACTION_FREE_PLAY) && gSaveContext.scarecrowSpawnSongSet)) && - (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && - (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)){ + bool skipScarecrow = + (CVar_GetS32("gSkipScarecrow", 0) && gSaveContext.scarecrowSpawnSongSet && globalCtx->msgCtx.ocarinaAction == OCARINA_ACTION_FREE_PLAY) || + (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_SCARECROWS_SONG) && globalCtx->msgCtx.ocarinaAction == OCARINA_ACTION_FREE_PLAY); + + if ((BREG(1) != 0) || skipScarecrow && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && + (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) { this->actor.draw = func_80A90948; Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); From f5fae6df32307e19b7451fd460979178626950eb Mon Sep 17 00:00:00 2001 From: lil David <1337lilDavid@gmail.com> Date: Sat, 3 Sep 2022 07:51:28 -0500 Subject: [PATCH 3/9] Reimplement progressive Bombchus --- soh/soh/Enhancements/randomizer/randomizer.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index a81fdb839..cd8cd61f9 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -1323,15 +1323,15 @@ ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerGet(RandomizerGe case RG_BUY_BOMBCHU_10: case RG_BUY_BOMBCHU_20: case RG_BUY_BOMBCHU_5: + case RG_BOMBCHU_DROP: // If Bombchus aren't in logic, you need a bomb bag to purchase them // If they are in logic, you need to have already obtained them somewhere else + // Bombchu Drop is only used as a bowling reward, so it needs the same logic if (GetRandoSettingValue(RSK_BOMBCHUS_IN_LOGIC)) { return INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU ? CAN_OBTAIN : CANT_OBTAIN_NEED_UPGRADE; } else { return CUR_UPG_VALUE(UPG_BOMB_BAG) ? CAN_OBTAIN : CANT_OBTAIN_NEED_UPGRADE; } - case RG_BOMBCHU_DROP: - return INV_CONTENT(ITEM_BOMBCHU) == ITEM_BOMBCHU ? CAN_OBTAIN : CANT_OBTAIN_NEED_UPGRADE; case RG_PROGRESSIVE_HOOKSHOT: switch (INV_CONTENT(ITEM_HOOKSHOT)) { case ITEM_NONE: @@ -1690,7 +1690,13 @@ GetItemID Randomizer::GetItemIdFromRandomizerGet(RandomizerGet randoGet, GetItem return GI_OCARINA_OOT; } case RG_PROGRESSIVE_BOMBCHUS: - return GI_BOMBCHUS_20; + if (INV_CONTENT(ITEM_BOMBCHU) == ITEM_NONE) { + return GI_BOMBCHUS_20; + } + if (AMMO(ITEM_BOMBCHU) < 5) { + return GI_BOMBCHUS_10; + } + return GI_BOMBCHUS_5; case RG_BOMBCHU_5: case RG_BUY_BOMBCHU_5: case RG_BOMBCHU_DROP: From 5421ad27c99699597baca039cc1d0e570d18ebaa Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Sat, 3 Sep 2022 09:24:37 -0400 Subject: [PATCH 4/9] Rando-next: Deku Nut and Seed ammo gives a blue rupee Fixes #1390 --- soh/soh/OTRGlobals.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 2781d6a6e..b70533a77 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1637,6 +1637,10 @@ extern "C" GetItemEntry ItemTable_RetrieveEntry(s16 tableID, s16 getItemID) { extern "C" GetItemEntry Randomizer_GetItemFromActor(s16 actorId, s16 sceneNum, s16 actorParams, GetItemID ogId) { s16 getItemModIndex; RandomizerCheck randomizerCheck = OTRGlobals::Instance->gRandomizer->GetCheckFromActor(actorId, sceneNum, actorParams); + // if we got unknown check here, we don't need to do anything else, just return the ogId. + if (randomizerCheck == RC_UNKNOWN_CHECK) { + return ItemTable_RetrieveEntry(MOD_NONE, ogId); + } if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(randomizerCheck)) { getItemModIndex = MOD_NONE; } else { @@ -1653,6 +1657,11 @@ extern "C" GetItemEntry Randomizer_GetItemFromActor(s16 actorId, s16 sceneNum, s extern "C" GetItemEntry Randomizer_GetItemFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) { s16 getItemModIndex; + + // if we got unknown check here, we don't need to do anything else, just return the ogId. + if (randomizerCheck == RC_UNKNOWN_CHECK) { + return ItemTable_RetrieveEntry(MOD_NONE, ogId); + } if (OTRGlobals::Instance->gRandomizer->CheckContainsVanillaItem(randomizerCheck)) { getItemModIndex = MOD_NONE; } else { From e079c254f1ad7cb705141b1f0f12fa22744a0e18 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Sat, 3 Sep 2022 09:39:03 -0400 Subject: [PATCH 5/9] Fixes Link starting with BGS --- soh/src/code/z_sram.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 20d255bca..9a9407277 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -101,6 +101,9 @@ void GiveLinksPocketItem() { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LINKS_POCKET, RG_NONE); if (getItemEntry.modIndex == MOD_NONE) { + if (getItemEntry.getItemId == GI_SWORD_BGS) { + gSaveContext.bgsFlag = true; + } Item_Give(NULL, getItemEntry.itemId); } else if (getItemEntry.modIndex == MOD_RANDOMIZER) { Randomizer_Item_Give(NULL, getItemEntry); @@ -400,6 +403,9 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { s32 giid = getItem.getItemId; if (getItem.modIndex == MOD_NONE) { + if (getItem.getItemId == GI_SWORD_BGS) { + gSaveContext.bgsFlag = true; + } Item_Give(NULL, getItem.itemId); } else if (getItem.modIndex == MOD_RANDOMIZER) { Randomizer_Item_Give(NULL, getItem); From 274242e0d714cba83234b880f2f5e4974c910cb4 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 3 Sep 2022 20:17:12 +0200 Subject: [PATCH 6/9] Implement rando bombchu drops --- .../randomizer/3drando/settings.cpp | 4 +++- .../Enhancements/randomizer/randomizer.cpp | 19 +++++++++++++++++++ .../Enhancements/randomizer/randomizerTypes.h | 1 + soh/soh/GameMenuBar.cpp | 8 +++++++- soh/src/code/z_en_item00.c | 3 ++- 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index dba8859e9..94093f833 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -2561,8 +2561,10 @@ namespace Settings { MapsAndCompasses.SetSelectedIndex(cvarSettings[RSK_STARTING_MAPS_COMPASSES]); + // RANDOTODO: Implement ammo drops entirely. Currently only "On" (index 0) or "On + Bombchus" (index 1) is implemented. + AmmoDrops.SetSelectedIndex(cvarSettings[RSK_ENABLE_BOMBCHU_DROPS]); + BombchusInLogic.SetSelectedIndex(cvarSettings[RSK_BOMBCHUS_IN_LOGIC]); - AmmoDrops.SetSelectedIndex(AMMODROPS_VANILLA); // Ensure logic knows bombchu drops aren't implemented yet StartingConsumables.SetSelectedIndex(cvarSettings[RSK_STARTING_CONSUMABLES]); StartingMaxRupees.SetSelectedIndex(cvarSettings[RSK_FULL_WALLETS]); diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index a81fdb839..5856ab0c5 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -582,6 +582,7 @@ std::unordered_map SpoilerfileSettingNameToEn { "Shuffle Dungeon Items:Gerudo Fortress Keys", RSK_GERUDO_KEYS }, { "Shuffle Dungeon Items:Boss Keys", RSK_BOSS_KEYSANITY }, { "Shuffle Dungeon Items:Ganon's Boss Key", RSK_GANONS_BOSS_KEY }, + { "World Settings:Ammo Drops", RSK_ENABLE_BOMBCHU_DROPS }, { "World Settings:Bombchus in Logic", RSK_BOMBCHUS_IN_LOGIC }, { "Misc Settings:Gossip Stone Hints", RSK_GOSSIP_STONE_HINTS }, { "Misc Settings:Hint Clarity", RSK_HINT_CLARITY }, @@ -831,6 +832,15 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) { gSaveContext.randoSettings[index].value = 1; } break; + // Uses Ammo Drops option for now. "Off" not yet implemented + case RSK_ENABLE_BOMBCHU_DROPS: + if (it.value() == "On") { + gSaveContext.randoSettings[index].value = 0; + } else if (it.value() == "On + Bombchu") { + gSaveContext.randoSettings[index].value = 1; + } else if (it.value() == "Off") { + gSaveContext.randoSettings[index].value = 2; + } case RSK_STARTING_MAPS_COMPASSES: if(it.value() == "Start With") { gSaveContext.randoSettings[index].value = 0; @@ -3429,6 +3439,7 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_SHUFFLE_COWS] = CVar_GetS32("gRandomizeShuffleCows", 0); cvarSettings[RSK_SHUFFLE_ADULT_TRADE] = CVar_GetS32("gRandomizeShuffleAdultTrade", 0); cvarSettings[RSK_SHUFFLE_MAGIC_BEANS] = CVar_GetS32("gRandomizeShuffleBeans", 0); + cvarSettings[RSK_ENABLE_BOMBCHU_DROPS] = CVar_GetS32("gRandomizeEnableBombchuDrops", 0); cvarSettings[RSK_BOMBCHUS_IN_LOGIC] = CVar_GetS32("gRandomizeBombchusInLogic", 0); cvarSettings[RSK_SKIP_CHILD_ZELDA] = CVar_GetS32("gRandomizeSkipChildZelda", 0); @@ -4304,6 +4315,14 @@ void DrawRandoEditor(bool& open) { UIWidgets::PaddedSeparator(); + // Enable Bombchu Drops + UIWidgets::EnhancementCheckbox("Enable Bombchu Drops", "gRandomizeEnableBombchuDrops"); + UIWidgets::InsertHelpHoverText( + "Once you obtain bombchus for the first time, refills can be found in bushes and other places where bomb drops can normally spawn." + ); + + UIWidgets::PaddedSeparator(); + UIWidgets::EnhancementCheckbox("WIP - Blue Fire Arrows", "gRandomizeBlueIceArrows", true, "In development"); UIWidgets::InsertHelpHoverText( "Ice Arrows act like Blue Fire, making them able to melt red ice. " diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index 064cdc499..ea7446f36 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -1018,6 +1018,7 @@ typedef enum { RSK_SKULLS_SUNS_SONG, RSK_SHUFFLE_ADULT_TRADE, RSK_SHUFFLE_MAGIC_BEANS, + RSK_ENABLE_BOMBCHU_DROPS, RSK_BOMBCHUS_IN_LOGIC, RSK_LINKS_POCKET } RandomizerSettingKey; diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index 26b4b1ffb..93c816d8d 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -23,6 +23,7 @@ #endif #include "UIWidgets.hpp" +#include "include/global.h" #include "include/z64audio.h" #define EXPERIMENTAL() \ @@ -745,7 +746,12 @@ namespace GameMenuBar { ); UIWidgets::PaddedEnhancementCheckbox("No Random Drops", "gNoRandomDrops", true, false); UIWidgets::Tooltip("Disables random drops, except from the Goron Pot, Dampe, and bosses"); - UIWidgets::PaddedEnhancementCheckbox("Enable Bombchu Drops", "gBombchuDrops", true, false); + bool forceEnableBombchuDrops = gSaveContext.n64ddFlag && + OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_ENABLE_BOMBCHU_DROPS) == 1; + const char* forceEnableBombchuDropsText = + "This setting is forcefully enabled because a savefile\nwith \"Enable Bombchu Drops\" is loaded."; + UIWidgets::PaddedEnhancementCheckbox("Enable Bombchu Drops", "gBombchuDrops", true, false, + forceEnableBombchuDrops, forceEnableBombchuDropsText, UIWidgets::CheckboxGraphics::Checkmark); UIWidgets::Tooltip("Bombchus will sometimes drop in place of bombs"); UIWidgets::PaddedEnhancementCheckbox("No Heart Drops", "gNoHeartDrops", true, false); UIWidgets::Tooltip("Disables heart drops, but not heart placements, like from a Deku Scrub running off\nThis simulates Hero Mode from other games in the series"); diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 986d5a135..2279abc71 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -1507,7 +1507,8 @@ s16 func_8001F404(s16 dropId) { } } - if (CVar_GetS32("gBombchuDrops", 0) && + if ((CVar_GetS32("gBombchuDrops", 0) || + (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_ENABLE_BOMBCHU_DROPS) == 1)) && (dropId == ITEM00_BOMBS_A || dropId == ITEM00_BOMBS_B || dropId == ITEM00_BOMBS_SPECIAL)) { dropId = EnItem00_ConvertBombDropToBombchu(dropId); } From ae0ccb9ccae350983afc34c603baae2057d79b21 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 3 Sep 2022 20:18:54 +0200 Subject: [PATCH 7/9] Missing break --- soh/soh/Enhancements/randomizer/randomizer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 5856ab0c5..4b734279a 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -841,6 +841,7 @@ void Randomizer::ParseRandomizerSettingsFile(const char* spoilerFileName) { } else if (it.value() == "Off") { gSaveContext.randoSettings[index].value = 2; } + break; case RSK_STARTING_MAPS_COMPASSES: if(it.value() == "Start With") { gSaveContext.randoSettings[index].value = 0; From 8d033c67664368849ab9993607c3f96487374817 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 3 Sep 2022 20:29:45 +0200 Subject: [PATCH 8/9] Update settings.cpp --- soh/soh/Enhancements/randomizer/3drando/settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/settings.cpp b/soh/soh/Enhancements/randomizer/3drando/settings.cpp index 94093f833..634dc4250 100644 --- a/soh/soh/Enhancements/randomizer/3drando/settings.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/settings.cpp @@ -2561,7 +2561,7 @@ namespace Settings { MapsAndCompasses.SetSelectedIndex(cvarSettings[RSK_STARTING_MAPS_COMPASSES]); - // RANDOTODO: Implement ammo drops entirely. Currently only "On" (index 0) or "On + Bombchus" (index 1) is implemented. + // RANDOTODO: Implement disabling ammo drops. Currently only "On" (index 0) or "On + Bombchus" (index 1) is implemented. AmmoDrops.SetSelectedIndex(cvarSettings[RSK_ENABLE_BOMBCHU_DROPS]); BombchusInLogic.SetSelectedIndex(cvarSettings[RSK_BOMBCHUS_IN_LOGIC]); From 6cd8d6ca3af976c51dde0957ed85bb441902b3d8 Mon Sep 17 00:00:00 2001 From: aMannus Date: Sat, 3 Sep 2022 20:48:00 +0200 Subject: [PATCH 9/9] Clean up bool --- soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index f6f37e489..5e3992fc1 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -118,9 +118,9 @@ void func_80A90264(EnKakasi2* this, GlobalContext* globalCtx) { this->unk_194++; - bool skipScarecrow = - (CVar_GetS32("gSkipScarecrow", 0) && gSaveContext.scarecrowSpawnSongSet && globalCtx->msgCtx.ocarinaAction == OCARINA_ACTION_FREE_PLAY) || - (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_SCARECROWS_SONG) && globalCtx->msgCtx.ocarinaAction == OCARINA_ACTION_FREE_PLAY); + bool skipScarecrow = globalCtx->msgCtx.ocarinaAction == OCARINA_ACTION_FREE_PLAY && + ((CVar_GetS32("gSkipScarecrow", 0) && gSaveContext.scarecrowSpawnSongSet) || + (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_SCARECROWS_SONG))); if ((BREG(1) != 0) || skipScarecrow && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) && (fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) {