diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 2afdac7b64..f37b91f2ec 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1496,6 +1496,14 @@ typedef enum { // - `*EnKz` VB_KING_ZORA_TUNIC_CHECK, + // #### `result` + // ```c + // false if in Jabu, carrying Ruto, abducted flag set, door is id 21 or 3 + // ``` + // #### `args` + // - `*Actor` (shutter door) + VB_JABU_PREVENT_RUTO_REENTER_BIGOCTO, + // #### `result` // ```c // varies diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index bed8946b2f..c93851a7ef 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -1271,6 +1271,17 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l } break; } + case VB_JABU_PREVENT_RUTO_REENTER_BIGOCTO: { + // Don't let player carry Ruto through doors 21 and 3 to Bigocto room if Ruto abducted flag set + Player* player = va_arg(args, Player*); + Actor* doorActor = va_arg(args, Actor*); + if (gPlayState->sceneNum == SCENE_JABU_JABU && GET_INFTABLE(INFTABLE_146) && + (GET_TRANSITION_ACTOR_INDEX(doorActor) == 21 || GET_TRANSITION_ACTOR_INDEX(doorActor) == 3) && + player->heldActor != NULL && player->heldActor->id == ACTOR_EN_RU1) { + *should = false; + } + break; + } case VB_BIGGORON_CONSIDER_SWORD_COLLECTED: { *should = Flags_GetRandomizerInf(RAND_INF_ADULT_TRADES_DMT_TRADE_CLAIM_CHECK); break; diff --git a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 284d3596a7..c402fe9a73 100644 --- a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -402,22 +402,23 @@ void DoorShutter_Idle(DoorShutter* this, PlayState* play) { if (doorDirection != 0) { Player* player = GET_PLAYER(play); - - if (this->unlockTimer != 0) { - if (this->doorType == SHUTTER_BOSS) { - if (!CHECK_DUNGEON_ITEM(DUNGEON_KEY_BOSS, gSaveContext.mapIndex)) { - player->naviTextId = -0x204; + if (GameInteractor_Should(VB_JABU_PREVENT_RUTO_REENTER_BIGOCTO, true, player, &this->dyna.actor)) { + if (this->unlockTimer != 0) { + if (this->doorType == SHUTTER_BOSS) { + if (!CHECK_DUNGEON_ITEM(DUNGEON_KEY_BOSS, gSaveContext.mapIndex)) { + player->naviTextId = -0x204; + return; + } + } else if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) { + player->naviTextId = -0x203; return; } - } else if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) { - player->naviTextId = -0x203; - return; + player->doorTimer = 10; } - player->doorTimer = 10; + player->doorType = PLAYER_DOORTYPE_SLIDING; + player->doorDirection = doorDirection; + player->doorActor = &this->dyna.actor; } - player->doorType = PLAYER_DOORTYPE_SLIDING; - player->doorDirection = doorDirection; - player->doorActor = &this->dyna.actor; } } }