From d9a08d0747bcde5e225b1f9b5e8e2055c74827d1 Mon Sep 17 00:00:00 2001 From: Oliver Schall Date: Tue, 6 Dec 2022 07:17:20 +0100 Subject: [PATCH] Added bombchu minigame difficulty menu (#2080) * Added bombchu bowling difficulty menu * Removed incorrect diff * Added bombchu bowling difficulty presets * Shortened cucco removal logic --- soh/soh/Enhancements/presets.h | 4 ++++ soh/soh/GameMenuBar.cpp | 16 ++++++++++++++++ .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 11 ++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index de3b48b6a..b875e9411 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -165,6 +165,10 @@ const std::vector enhancementsCvars = { "gConstantAdultGallery", "gChildShootingGalleryAmmunition", "gAdultShootingGalleryAmmunition", + "gCustomizeBombchuBowling", + "gBombchuBowlingNoSmallCucco", + "gBombchuBowlingNoBigCucco", + "gBombchuBowlingAmmunition", "gCreditsFix", }; diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index d41e96723..c8228197b 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -546,6 +546,22 @@ namespace GameMenuBar { UIWidgets::Spacer(0); + if (ImGui::BeginMenu("Bombchu Bowling")) { + UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeBombchuBowling"); + UIWidgets::Tooltip("Turn on/off changes to the bombchu bowling behavior"); + bool disabled = CVar_GetS32("gCustomizeBombchuBowling", 0) == 0; + const char* disabledTooltip = "This option is disabled because \"Customize Behavior\" is turned off"; + UIWidgets::EnhancementCheckbox("Remove Small Cucco", "gBombchuBowlingNoSmallCucco", disabled, disabledTooltip); + UIWidgets::Tooltip("Prevents the small cucco from appearing in the bombchu bowling minigame"); + UIWidgets::EnhancementCheckbox("Remove Big Cucco", "gBombchuBowlingNoBigCucco", disabled, disabledTooltip); + UIWidgets::Tooltip("Prevents the big cucco from appearing in the bombchu bowling minigame"); + UIWidgets::PaddedEnhancementSliderInt("Bombchu Count: %d", "##cBombchuBowlingAmmunition", "gBombchuBowlingAmmunition", 3, 20, "", 10, false, true, false, disabled, disabledTooltip); + UIWidgets::Tooltip("The number of bombchus available at the start of the bombchu bowling minigame"); + ImGui::EndMenu(); + } + + UIWidgets::Spacer(0); + if (ImGui::BeginMenu("Fishing")) { UIWidgets::EnhancementCheckbox("Customize Behavior", "gCustomizeFishing"); UIWidgets::Tooltip("Turn on/off changes to the fishing behavior"); diff --git a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 4016b2120..941038ad4 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -69,6 +69,10 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) { Actor_SetScale(&this->actor, 0.013f); for (i = 0; i < 2; i++) { + if(CVar_GetS32("gCustomizeBombchuBowling", 0) && CVar_GetS32(i == 0 ? "gBombchuBowlingNoSmallCucco" : "gBombchuBowlingNoBigCucco", 0)) { + continue; + } + cucco = (EnSyatekiNiw*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SYATEKI_NIW, cuccoSpawnPos[i].x, cuccoSpawnPos[i].y, cuccoSpawnPos[i].z, 0, 0, 0, 1); @@ -320,7 +324,12 @@ void EnBomBowlMan_HandlePlayChoice(EnBomBowlMan* this, PlayState* play) { Rupees_ChangeBy(-30); this->minigamePlayStatus = 1; this->wallStatus[0] = this->wallStatus[1] = 0; - play->bombchuBowlingStatus = 10; + if(CVar_GetS32("gCustomizeBombchuBowling", 0)) { + play->bombchuBowlingStatus = CVar_GetS32("gBombchuBowlingAmmunition", 10); + } + else { + play->bombchuBowlingStatus = 10; + } Flags_SetSwitch(play, 0x38); if (!this->startedPlaying && !this->playingAgain) {