summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Leggett <chris@leggett.dev>2026-03-28 02:58:41 +0000
committerGitHub <noreply@github.com>2026-03-28 02:58:41 +0000
commit42ba25449ee39ed280821f328275c569ea41e975 (patch)
treeca13b9aa4b8b88720d99c2c3fb1220255178a78d
parentd1643aa19646a5483e2c90ef7bf5f565594727db (diff)
Make Infinite Ammo Cheat respect Progressive Bombchu Bag Capacities (#6421)
Cap infinite ammo for chus according to rando settings Add bombchuUpgradeLevel to save editor
-rw-r--r--soh/soh/Enhancements/Cheats/Infinite/Ammo.cpp7
-rw-r--r--soh/soh/Enhancements/debugger/debugSaveEditor.cpp34
2 files changed, 40 insertions, 1 deletions
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 <libultraship/bridge.h>
#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<std::string> 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