From e6947c733c93b2b6dfbba9196c867cf1add5e65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Sun, 15 Feb 2026 00:48:00 +0000 Subject: [PATCH] Business Scrubs: don't speak without jabber nut (#6255) most speak checks conservatively only apply to Link initiating speech, but didn't realize business scrubs speak unprompted & that would make deku jabber nut mostly useless this doesn't apply to other scrubs (such as 123 scrubs), maybe in future we can block more, such as showing trade items --- .../game-interactor/vanilla-behavior/GIVanillaBehavior.h | 8 ++++++++ soh/soh/Enhancements/randomizer/ShuffleSpeak.cpp | 6 ++++++ soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c | 2 +- soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c | 1 - 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 0cf3fe92b..9659c69d8 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -262,6 +262,14 @@ typedef enum { // - `*EnShopnuts` VB_BUSINESS_SCRUB_DESPAWN, + // #### `result` + // ```c + // this->actor.xzDistToPlayer < 130.0f + // ``` + // #### `args` + // - None + VB_BUSINESS_SCRUB_SPEAK, + // #### `result` // ```c // true diff --git a/soh/soh/Enhancements/randomizer/ShuffleSpeak.cpp b/soh/soh/Enhancements/randomizer/ShuffleSpeak.cpp index ab299a5c2..b775bd0eb 100644 --- a/soh/soh/Enhancements/randomizer/ShuffleSpeak.cpp +++ b/soh/soh/Enhancements/randomizer/ShuffleSpeak.cpp @@ -9,6 +9,12 @@ extern PlayState* gPlayState; void RegisterShuffleSpeak() { bool shouldRegister = IS_RANDO && Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_SPEAK).Get(); + COND_VB_SHOULD(VB_BUSINESS_SCRUB_SPEAK, shouldRegister, { + if (!Flags_GetRandomizerInf(RAND_INF_CAN_SPEAK_DEKU)) { + *should = false; + } + }); + COND_VB_SHOULD(VB_SPEAK, shouldRegister, { Actor* talkActor = GET_PLAYER(gPlayState)->talkActor; if (talkActor != NULL && talkActor->category == ACTORCAT_NPC && diff --git a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 4ba3520b1..89044687e 100644 --- a/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/soh/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -321,7 +321,7 @@ void EnDns_Idle(EnDns* this, PlayState* play) { } else { this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED; } - if (this->actor.xzDistToPlayer < 130.0f) { + if (GameInteractor_Should(VB_BUSINESS_SCRUB_SPEAK, this->actor.xzDistToPlayer < 130.0f)) { func_8002F2F4(&this->actor, play); } } diff --git a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c index 5ac3c7e8d..a40cc2736 100644 --- a/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c +++ b/soh/src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c @@ -1,7 +1,6 @@ #include "z_en_shopnuts.h" #include "objects/object_shopnuts/object_shopnuts.h" #include "overlays/actors/ovl_En_Dns/z_en_dns.h" -#include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"