From 6606eefbf1c52aa4b950aa6f205dffc8d417c720 Mon Sep 17 00:00:00 2001 From: Jordan Longstaff Date: Fri, 16 Jan 2026 08:55:36 -0500 Subject: [PATCH] Add option to disable Link spinning with the Goron Pot (#6138) Make Link focus on Goron Pot instead --- .../Graphics/DisableLinkSpinWithGoronPot.cpp | 29 +++++++++++++++++++ .../vanilla-behavior/GIVanillaBehavior.h | 8 +++++ soh/soh/SohGui/SohMenuEnhancements.cpp | 4 +++ soh/src/code/z_onepointdemo.c | 4 ++- 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp diff --git a/soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp b/soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp new file mode 100644 index 000000000..c6fcbf913 --- /dev/null +++ b/soh/soh/Enhancements/Graphics/DisableLinkSpinWithGoronPot.cpp @@ -0,0 +1,29 @@ +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" +#include "soh/ShipInit.hpp" + +extern "C" { +#include "functions.h" +#include "src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.h" +extern PlayState* gPlayState; +} + +static constexpr int32_t CVAR_LINK_SPIN_DISABLE_DEFAULT = 0; +#define CVAR_LINK_SPIN_DISABLE_NAME CVAR_ENHANCEMENT("DisableLinkSpinWithGoronPot") +#define CVAR_LINK_SPIN_DISABLE_VALUE CVarGetInteger(CVAR_LINK_SPIN_DISABLE_NAME, CVAR_LINK_SPIN_DISABLE_DEFAULT) + +static void MakeLinkFocusOnPot() { + BgSpot18Basket* bgSpot18 = + (BgSpot18Basket*)Actor_Find(&gPlayState->actorCtx, ACTOR_BG_SPOT18_BASKET, ACTORCAT_PROP); + if (bgSpot18 != NULL) { + func_8002DF38(gPlayState, &bgSpot18->dyna.actor, 1); + } +} + +static void RegisterDisableLinkSpinWithGoronPot() { + COND_VB_SHOULD(VB_LINK_SPIN_WITH_GORON_POT, CVAR_LINK_SPIN_DISABLE_VALUE, { + MakeLinkFocusOnPot(); + *should = false; + }); +} + +static RegisterShipInitFunc initFunc(RegisterDisableLinkSpinWithGoronPot, { CVAR_LINK_SPIN_DISABLE_NAME }); diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 311779e2c..c16fb6fc8 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1338,6 +1338,14 @@ typedef enum { // - `*EnKz` VB_KING_ZORA_TUNIC_CHECK, + // #### `result` + // ```c + // true + // ``` + // #### `args` + // - None + VB_LINK_SPIN_WITH_GORON_POT, + // #### `result` // ```c // !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) diff --git a/soh/soh/SohGui/SohMenuEnhancements.cpp b/soh/soh/SohGui/SohMenuEnhancements.cpp index 017676b7c..e913bf8ef 100644 --- a/soh/soh/SohGui/SohMenuEnhancements.cpp +++ b/soh/soh/SohGui/SohMenuEnhancements.cpp @@ -695,6 +695,10 @@ void SohMenu::AddMenuEnhancements() { .CVar(CVAR_ENHANCEMENT("RemoveSpinAttackDarkness")) .RaceDisable(false) .Options(CheckboxOptions().Tooltip("Remove the Darkness that appears when charging a Spin Attack.")); + AddWidget(path, "Disable Link Spinning With Goron Pot", WIDGET_CVAR_CHECKBOX) + .CVar(CVAR_ENHANCEMENT("DisableLinkSpinWithGoronPot")) + .RaceDisable(false) + .Options(CheckboxOptions().Tooltip("Link will not spin when the Goron Pot starts to spin.")); AddWidget(path, "Draw Distance", WIDGET_SEPARATOR_TEXT).RaceDisable(false); AddWidget(path, "Increase Actor Draw Distance: %dx", WIDGET_CVAR_SLIDER_INT) .CVar(CVAR_ENHANCEMENT("DisableDrawDistance")) diff --git a/soh/src/code/z_onepointdemo.c b/soh/src/code/z_onepointdemo.c index c68f1b522..c3c2c2e76 100644 --- a/soh/src/code/z_onepointdemo.c +++ b/soh/src/code/z_onepointdemo.c @@ -883,7 +883,9 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 camIdx, s16 csId, Actor* actor csInfo->keyFrameCnt = 1; func_800C0808(play, camIdx, player, CAM_SET_CS_C); - func_8002DF38(play, &player->actor, 1); + if (GameInteractor_Should(VB_LINK_SPIN_WITH_GORON_POT, true)) { + func_8002DF38(play, &player->actor, 1); + } i = Quake_Add(csCam, 3); Quake_SetSpeed(i, 12000);