From 23606325e631797a553af6d6fb2d3d59f2d66806 Mon Sep 17 00:00:00 2001 From: Jordan Longstaff Date: Thu, 29 Jan 2026 09:36:46 -0500 Subject: [PATCH] Hookify Goron Pot (#6208) --- soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp | 11 +++++++++++ .../vanilla-behavior/GIVanillaBehavior.h | 8 ++++++++ .../actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp diff --git a/soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp b/soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp new file mode 100644 index 000000000..80a6395a5 --- /dev/null +++ b/soh/soh/Enhancements/Difficulty/AlwaysWinGoronPot.cpp @@ -0,0 +1,11 @@ +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ShipInit.hpp" + +#define CVAR_WIN_GORON_POT_NAME CVAR_ENHANCEMENT("GoronPot") +#define CVAR_WIN_GORON_POT_VALUE CVarGetInteger(CVAR_WIN_GORON_POT_NAME, 0) + +static void RegisterWinGoronPot() { + COND_VB_SHOULD(VB_WIN_GORON_POT, CVAR_WIN_GORON_POT_VALUE, { *should = true; }); +} + +static RegisterShipInitFunc initFunc(RegisterWinGoronPot, { CVAR_WIN_GORON_POT_NAME }); diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index f36676f6a..da262f6ea 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -2354,6 +2354,14 @@ typedef enum { // - `*EnMk` VB_USE_EYEDROP_DIALOGUE, + // #### `result` + // ```c + // (shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19) + // ``` + // #### `args` + // - None + VB_WIN_GORON_POT, + // #### `result` // ```c // true diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 07751f7eb..72e59a80d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -1,6 +1,7 @@ #include "z_bg_spot18_basket.h" #include "objects/object_spot18_obj/object_spot18_obj.h" #include "vt.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -296,7 +297,7 @@ void func_808B7F74(BgSpot18Basket* this) { shapeRotY = this->dyna.actor.shape.rot.y; this->actionFunc = func_808B7FC0; - if ((shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19) || CVarGetInteger(CVAR_ENHANCEMENT("GoronPot"), 0)) { + if (GameInteractor_Should(VB_WIN_GORON_POT, (shapeRotY < -0x2E93) || (shapeRotY >= 0x7C19))) { this->unk_218 = 2; } else if (shapeRotY < 0x26C2) { this->unk_218 = 1;