From 8841e0b607db1cd128462d1a3fde78e858785d01 Mon Sep 17 00:00:00 2001 From: Oliver Schall Date: Tue, 22 Nov 2022 00:53:23 +0100 Subject: [PATCH] Fixed Shooting Gallery Difficulty Menu implementation issues (#1991) --- soh/soh/GameMenuBar.cpp | 11 +++++++++++ .../actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c | 4 ++-- .../actors/ovl_En_Syateki_Man/z_en_syateki_man.c | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/soh/soh/GameMenuBar.cpp b/soh/soh/GameMenuBar.cpp index f087a7171..f52c9bfee 100644 --- a/soh/soh/GameMenuBar.cpp +++ b/soh/soh/GameMenuBar.cpp @@ -235,6 +235,17 @@ namespace GameMenuBar { // Fairy Revive Percent Restore CVar_SetS32("gFairyRevivePercentRestore", 0); + // Customize Shooting Gallery + CVar_SetS32("gCustomizeShootingGallery", 0); + // Shooting Gallery Instant Win + CVar_SetS32("gInstantShootingGalleryWin", 0); + // Constant Adult Shooting Gallery + CVar_SetS32("gConstantAdultGallery", 0); + // Child Starting Ammunition (10 to 30) + CVar_SetS32("gChildShootingGalleryAmmunition", 15); + // Adult Starting Ammunition (10 to 30) + CVar_SetS32("gAdultShootingGalleryAmmunition", 15); + // Instant Fishing CVar_SetS32("gInstantFishing", 0); // Guarantee Bite diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c index dec99b6e6..f45d7ce13 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Itm/z_en_syateki_itm.c @@ -111,7 +111,7 @@ void EnSyatekiItm_Idle(EnSyatekiItm* this, PlayState* play) { player->actor.world.rot.x = player->actor.shape.rot.x = player->actor.world.rot.z = player->actor.shape.rot.z = 0; s32 ammunition = 15; - if(CVar_Get("gCustomizeShootingGallery", 0)) { + if(CVar_GetS32("gCustomizeShootingGallery", 0)) { ammunition = CVar_GetS32(LINK_IS_ADULT ? "gAdultShootingGalleryAmmunition" : "gChildShootingGalleryAmmunition", 15); } func_8008EF44(play, ammunition); @@ -132,7 +132,7 @@ void EnSyatekiItm_StartRound(EnSyatekiItm* this, PlayState* play) { Player* player = GET_PLAYER(play); if (this->unkTimer == 0) { - if (LINK_IS_ADULT && !(CVar_Get("gCustomizeShootingGallery", 0) && CVar_Get("gConstantAdultGallery", 0))) { + if (LINK_IS_ADULT && !(CVar_GetS32("gCustomizeShootingGallery", 0) && CVar_GetS32("gConstantAdultGallery", 0))) { for (i = 0, j = 0; i < SYATEKI_ROUND_MAX; i++) { if (this->roundFlags[i]) { j++; diff --git a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 992c477e0..c489f869a 100644 --- a/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/soh/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -289,7 +289,7 @@ void EnSyatekiMan_StartGame(EnSyatekiMan* this, PlayState* play) { Message_CloseTextbox(play); gallery = ((EnSyatekiItm*)this->actor.parent); if (gallery->actor.update != NULL) { - if(CVar_Get("gCustomizeShootingGallery", 0) && CVar_Get("gInstantShootingGalleryWin", 0)) { + if(CVar_GetS32("gCustomizeShootingGallery", 0) && CVar_GetS32("gInstantShootingGalleryWin", 0)) { gallery->hitCount = 10; gallery->signal = ENSYATEKI_END; } else { @@ -401,7 +401,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) { case SYATEKI_RESULT_ALMOST: this->timer = 20; s32 ammunition = 15; - if(CVar_Get("gCustomizeShootingGallery", 0)) { + if(CVar_GetS32("gCustomizeShootingGallery", 0)) { ammunition = CVar_GetS32(LINK_IS_ADULT ? "gAdultShootingGalleryAmmunition" : "gChildShootingGalleryAmmunition", 15); } func_8008EF44(play, ammunition);