diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 9659c69d8..841c422a6 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -420,6 +420,14 @@ typedef enum { // - None VB_DEKU_SCRUBS_REACT_TO_MASK_OF_TRUTH, + // #### `result` + // ```c + // (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play) + // ``` + // #### `args` + // - None + VB_DEKU_THEATER_FINISH_GIVING_PRIZE, + // #### `result` // ```c // CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) @@ -808,6 +816,14 @@ typedef enum { // - `*EnCow` VB_GIVE_ITEM_FROM_COW, + // #### `result` + // ```c + // true + // ``` + // #### `args` + // - `*EnDntJiji` + VB_GIVE_ITEM_FROM_DEKU_THEATER, + // #### `result` // ```c // true diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 8bb89e56c..bebe1c2b2 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -45,6 +45,7 @@ extern "C" { #include "src/overlays/actors/ovl_En_Ge1/z_en_ge1.h" #include "src/overlays/actors/ovl_En_Ge2/z_en_ge2.h" #include "src/overlays/actors/ovl_En_Ds/z_en_ds.h" +#include "src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h" #include "src/overlays/actors/ovl_En_Gm/z_en_gm.h" #include "src/overlays/actors/ovl_En_Js/z_en_js.h" #include "src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.h" @@ -71,6 +72,7 @@ extern s32 Player_SetupWaitForPutAway(PlayState* play, Player* player, AfterPutA extern void Play_InitEnvironment(PlayState* play, s16 skyboxId); extern void EnMk_Wait(EnMk* enMk, PlayState* play); extern void func_80ABA778(EnNiwLady* enNiwLady, PlayState* play); +extern void EnDntJiji_GivePrize(EnDntJiji* enDntJiji, PlayState* play); extern void EnGe1_Wait_Archery(EnGe1* enGe1, PlayState* play); extern void EnGe1_SetAnimationIdle(EnGe1* enGe1); extern void EnGe1_SetAnimationIdle(EnGe1* enGe1); @@ -1192,6 +1194,12 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l *should = !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_SARIAS_SONG); break; } + case VB_GIVE_ITEM_FROM_DEKU_THEATER: { + EnDntJiji* enDntJiji = va_arg(args, EnDntJiji*); + enDntJiji->actionFunc = EnDntJiji_GivePrize; + *should = false; + break; + } case VB_GIVE_ITEM_FROM_GRANNYS_SHOP: { if (!EnDs_RandoCanGetGrannyItem()) { break; @@ -1307,6 +1315,9 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } break; } + case VB_DEKU_THEATER_FINISH_GIVING_PRIZE: + *should = true; + break; case VB_FROGS_GO_TO_IDLE: { EnFr* enFr = va_arg(args, EnFr*); diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 508a5bd1a..53fce0b75 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -79,13 +79,17 @@ void EnFu_EndTeachSong(EnFu* enFu, PlayState* play) { void EnDntDemo_JudgeSkipToReward(EnDntDemo* enDntDemo, PlayState* play) { // todo: figure out a better way to handle toggling so we don't // need to double check cvars like this - if (!(IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) || - (IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_SPEAK)) || enDntDemo->actor.xzDistToPlayer > 30.0f) { + if (!(IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO))) { + EnDntDemo_Judge(enDntDemo, play); + return; + } else if ((IS_RANDO && RAND_GET_OPTION(RSK_SHUFFLE_SPEAK)) || enDntDemo->actor.xzDistToPlayer > 30.0f) { + if (enDntDemo->judgeTimer > 0 && enDntDemo->judgeTimer < 40) { + enDntDemo->judgeTimer = 40; + } EnDntDemo_Judge(enDntDemo, play); return; } - Player* player = GET_PLAYER(play); switch (Player_GetMask(play)) { case PLAYER_MASK_SKULL: { Flags_SetItemGetInf(ITEMGETINF_OBTAINED_STICK_UPGRADE_FROM_STAGE); diff --git a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 16b1d7db2..0009c25dd 100644 --- a/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/soh/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -6,7 +6,6 @@ #include "z_en_cow.h" #include "objects/object_cow/object_cow.h" -#include "soh/OTRGlobals.h" #include "soh/ResourceManagerHelpers.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c index ba5d8a92f..e16a781b7 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Demo/z_en_dnt_demo.c @@ -9,7 +9,6 @@ #include "overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.h" #include "overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.h" #include "vt.h" -#include "soh/OTRGlobals.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS 0 diff --git a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c index 832b33cbf..e72249477 100644 --- a/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c +++ b/soh/src/overlays/actors/ovl_En_Dnt_Jiji/z_en_dnt_jiji.c @@ -10,6 +10,7 @@ #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" #include "vt.h" #include "soh/ResourceManagerHelpers.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_CULLING_DISABLED) @@ -259,8 +260,10 @@ void EnDntJiji_Talk(EnDntJiji* this, PlayState* play) { Message_CloseTextbox(play); Player_SetCsActionWithHaltedActors(play, NULL, 7); this->actor.parent = NULL; - Actor_OfferGetItem(&this->actor, play, this->getItemId, 400.0f, 200.0f); - this->actionFunc = EnDntJiji_SetupGivePrize; + if (GameInteractor_Should(VB_GIVE_ITEM_FROM_DEKU_THEATER, true, this)) { + Actor_OfferGetItem(&this->actor, play, this->getItemId, 400.0f, 200.0f); + this->actionFunc = EnDntJiji_SetupGivePrize; + } } } @@ -275,7 +278,8 @@ void EnDntJiji_SetupGivePrize(EnDntJiji* this, PlayState* play) { void EnDntJiji_GivePrize(EnDntJiji* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) { + if (GameInteractor_Should(VB_DEKU_THEATER_FINISH_GIVING_PRIZE, + (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play))) { if ((this->getItemId == GI_NUT_UPGRADE_30) || (this->getItemId == GI_NUT_UPGRADE_40)) { // "nut" osSyncPrintf("実 \n");