From 12737143c7c5470ba90963cf02c92d5de5cec019 Mon Sep 17 00:00:00 2001 From: Christopher Leggett Date: Thu, 19 Jan 2023 04:10:47 -0500 Subject: [PATCH] Adds option to add higher pitches to silver rupee jingle (#2246) * Adds option to add higher pitches to silver rupee jingle. Some rooms in Master Quest had 10 silver rupees, but the game was programmed to only play the jingle 5 times and then just went silent for the rest. This option adds 5 more transposition values to the array, and an option to play them (so that authentic behavior is preserved by default). * Adds the new option to Vanilla Plus preset and up Also adds it to the list to be reset back to 0 when applying the default preset. * Changes display name of checkbox. * Change CVar_GetS32 to CVarGetInteger --- soh/soh/Enhancements/presets.h | 7 +++++++ soh/soh/GameMenuBar.cpp | 4 ++++ soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/presets.h b/soh/soh/Enhancements/presets.h index 8c6a3cab6..3cdcd6180 100644 --- a/soh/soh/Enhancements/presets.h +++ b/soh/soh/Enhancements/presets.h @@ -173,6 +173,7 @@ const std::vector enhancementsCvars = { "gBombchuBowlingNoBigCucco", "gBombchuBowlingAmmunition", "gCreditsFix", + "gSilverRupeeJingleExtend" }; const std::vector randomizerCvars = { @@ -320,6 +321,8 @@ const std::vector vanillaPlusPresetEntries = { PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1), // Fix Navi text HUD position PRESET_ENTRY_S32("gNaviTextFix", 1), + // Extend Silver Rupee Jingle + PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1), // Red Ganon blood PRESET_ENTRY_S32("gRedGanonBlood", 1), @@ -383,6 +386,8 @@ const std::vector enhancedPresetEntries = { PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1), // Fix Navi text HUD position PRESET_ENTRY_S32("gNaviTextFix", 1), + // Extend Silver Rupee Jingle + PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1), // Red Ganon blood PRESET_ENTRY_S32("gRedGanonBlood", 1), @@ -495,6 +500,8 @@ const std::vector randomizerPresetEntries = { PRESET_ENTRY_S32("gDekuNutUpgradeFix", 1), // Fix Navi text HUD position PRESET_ENTRY_S32("gNaviTextFix", 1), + // Extend Silver Rupee Jingle + PRESET_ENTRY_S32("gSilverRupeeJingleExtend", 1), // Red Ganon blood PRESET_ENTRY_S32("gRedGanonBlood", 1), diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index b6dea1dc5..a1bcdbec1 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -761,6 +761,10 @@ namespace GameMenuBar { UIWidgets::Tooltip("Fixes camera getting stuck on collision when standing still, also fixes slight shift back in camera when stop moving"); UIWidgets::PaddedEnhancementCheckbox("Fix Hanging Ledge Swing Rate", "gFixHangingLedgeSwingRate", true, false); UIWidgets::Tooltip("Fixes camera swing rate when player falls of a ledge and camera swings around"); + UIWidgets::PaddedEnhancementCheckbox("Fix Missing Jingle after 5 Silver Rupees", "gSilverRupeeJingleExtend", true, false); + UIWidgets::Tooltip( + "Adds 5 higher pitches for the Silver Rupee Jingle for the rooms with more than 5 Silver Rupees. " + "Currently only relevant in Master Quest."); ImGui::EndMenu(); } diff --git a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index e152da4f3..1cbcf8b1e 100644 --- a/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/soh/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -226,10 +226,10 @@ void EnGSwitch_WaitForObject(EnGSwitch* this, PlayState* play) { } void EnGSwitch_SilverRupeeTracker(EnGSwitch* this, PlayState* play) { - static s8 majorScale[] = { 0, 2, 4, 5, 7 }; + static s8 majorScale[] = { 0, 2, 4, 5, 7, 9, 11, 13, 15, 17 }; if (this->noteIndex < sCollectedCount) { - if (sCollectedCount < 5) { + if (sCollectedCount < (CVarGetInteger("gSilverRupeeJingleExtend", 0) ? 10 : 5)) { // "sound?" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 音? ☆☆☆☆☆ %d\n" VT_RST, this->noteIndex); Audio_PlaySoundTransposed(&D_801333D4, NA_SE_EV_FIVE_COUNT_LUPY, majorScale[this->noteIndex]);