diff --git a/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp b/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp index b54b330bf..c5a0297de 100644 --- a/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp +++ b/soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp @@ -1,5 +1,6 @@ #include #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/OTRGlobals.h" #include "soh/ShipInit.hpp" #include "z64save.h" @@ -24,7 +25,11 @@ void OnGameFrameUpdateInfiniteAmmo() { AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER); AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); if (INV_CONTENT(ITEM_BOMBCHU) != ITEM_NONE) { - AMMO(ITEM_BOMBCHU) = 50; + int chuCapacity = 50; + if (IS_RANDO && RAND_GET_OPTION(RSK_BOMBCHU_BAG).Is(RO_BOMBCHU_BAG_PROGRESSIVE)) { + chuCapacity = OTRGlobals::Instance->gRandoContext->GetBombchuCapacity(); + } + AMMO(ITEM_BOMBCHU) = chuCapacity; } } diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index f823d99f6..3c99ea19e 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -1,4 +1,5 @@ #include "debugSaveEditor.h" +#include "soh/Enhancements/randomizer/randomizerTypes.h" #include "soh/util.h" #include "soh/SohGui/ImGuiUtils.h" #include "soh/OTRGlobals.h" @@ -1392,6 +1393,39 @@ void DrawEquipmentTab() { "40", }; DrawUpgrade("Deku Nut Capacity", UPG_NUTS, nutNames); + + if (IS_RANDO && + OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_BOMBCHU_BAG) == RO_BOMBCHU_BAG_PROGRESSIVE) { + const std::vector bombchuNames = { + "None", + "20", + "30", + "50", + }; + ImGui::Text("%s", "Bombchu Bag Capacity"); + ImGui::SameLine(); + ImGui::PushID("Bombchu Bag Capacity"); + PushStyleCombobox(THEME_COLOR); + ImGui::AlignTextToFramePadding(); + auto value = gSaveContext.ship.quest.data.randomizer.bombchuUpgradeLevel; + auto name = value < bombchuNames.size() ? bombchuNames[value].c_str() : "Glitched"; + if (ImGui::BeginCombo("##upgrade", name)) { + for (size_t i = 0; i < bombchuNames.size(); i++) { + if (ImGui::Selectable(bombchuNames[i].c_str())) { + gSaveContext.ship.quest.data.randomizer.bombchuUpgradeLevel = i; + if (i > 0) { + INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU; + } else { + INV_CONTENT(ITEM_BOMBCHU) = ITEM_NONE; + } + } + } + ImGui::EndCombo(); + } + PopStyleCombobox(); + ImGui::PopID(); + UIWidgets::Tooltip("Bombchu Bag Capapcity"); + } } // Draws a toggleable icon for a quest item that is faded when disabled