diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index ea9c61914..9f3625d4c 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -310,7 +310,9 @@ typedef enum { VB_PLAY_FIRE_ARROW_CS, // Vanilla condition: INV_CONTENT(ITEM_ARROW_FIRE) == ITEM_NONE VB_SPAWN_FIRE_ARROW, - // Opt: *EventChkInf flag + // Opt: s32 entranceIndex + VB_ALLOW_ENTRANCE_CS_FOR_EITHER_AGE, + // Opt: s32 flag/EventChkInf, s32 entranceIndex VB_PLAY_ENTRANCE_CS, // Opt: *cutsceneId VB_PLAY_ONEPOINT_CS, diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp index 6e88a249f..80cd8dea8 100644 --- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp +++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp @@ -784,6 +784,15 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l va_copy(args, originalArgs); switch (id) { + case VB_ALLOW_ENTRANCE_CS_FOR_EITHER_AGE: { + s32 entranceIndex = va_arg(args, s32); + + // Allow Nabooru fight cutscene to play for child in rando + if (entranceIndex == ENTR_SPIRIT_TEMPLE_BOSS_ENTRANCE) { + *should = true; + } + break; + } case VB_PLAY_SLOW_CHEST_CS: { // We force fast chests if SkipGetItemAnimation is enabled because the camera in the CS looks pretty wonky otherwise if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipGetItemAnimation"), SGIA_DISABLED)) { diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index ee9dede06..85e0f0420 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -204,8 +204,13 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li break; } case VB_PLAY_ENTRANCE_CS: { - s32* entranceFlag = va_arg(args, s32*); - if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), IS_RANDO) && (*entranceFlag != EVENTCHKINF_EPONA_OBTAINED)) { + s32 entranceFlag = va_arg(args, s32); + s32 entranceIndex = va_arg(args, s32); + + // Epona LLR fence jump cutscenes not skipped to allow the player and epona to load in the world correctly + // Nabooru fight cutscene is handled by boss intro skip instead (which deals with other flags needing to be set) + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Entrances"), IS_RANDO) && + (entranceFlag != EVENTCHKINF_EPONA_OBTAINED) && entranceIndex != ENTR_SPIRIT_TEMPLE_BOSS_ENTRANCE) { *should = false; } break; diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 9247be6aa..4943b8390 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -2176,7 +2176,7 @@ void Cutscene_HandleEntranceTriggers(PlayState* play) { for (i = 0; i < ARRAY_COUNT(sEntranceCutsceneTable); i++) { entranceCutscene = &sEntranceCutsceneTable[i]; requiredAge = entranceCutscene->ageRestriction; - if (requiredAge == 2) { + if (GameInteractor_Should(VB_ALLOW_ENTRANCE_CS_FOR_EITHER_AGE, requiredAge == 2, entranceCutscene->entrance)) { requiredAge = gSaveContext.linkAge; } @@ -2185,7 +2185,7 @@ void Cutscene_HandleEntranceTriggers(PlayState* play) { (gSaveContext.cutsceneIndex < 0xFFF0) && ((u8)gSaveContext.linkAge == requiredAge) && (gSaveContext.respawnFlag <= 0)) { Flags_SetEventChkInf(entranceCutscene->flag); - if (GameInteractor_Should(VB_PLAY_ENTRANCE_CS, true, &entranceCutscene->flag)) { + if (GameInteractor_Should(VB_PLAY_ENTRANCE_CS, true, entranceCutscene->flag, entranceCutscene->entrance)) { Cutscene_SetSegment(play, entranceCutscene->segAddr); gSaveContext.cutsceneTrigger = 2; gSaveContext.showTitleCard = false; diff --git a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 9f89e7980..621fe3901 100644 --- a/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/soh/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -302,8 +302,8 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { if ((wallType == BWALL_DC_ENTRANCE) && (!Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN))) { Flags_SetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN); - s32 flag = EVENTCHKINF_ENTERED_DODONGOS_CAVERN; - if (GameInteractor_Should(VB_PLAY_ENTRANCE_CS, true, &flag)) { + if (GameInteractor_Should(VB_PLAY_ENTRANCE_CS, true, EVENTCHKINF_ENTERED_DODONGOS_CAVERN, + gSaveContext.entranceIndex)) { Cutscene_SetSegment(play, gDcOpeningCs); gSaveContext.cutsceneTrigger = 1; Player_SetCsActionWithHaltedActors(play, NULL, 0x31); diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index a1362a2bb..d8edfd736 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -117,8 +117,8 @@ void func_808BAF40(BgTokiSwd* this, PlayState* play) { if (((Flags_GetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER)) == 0) && (gSaveContext.sceneSetupIndex < 4) && Actor_IsFacingAndNearPlayer(&this->actor, 800.0f, 0x7530) && !Play_InCsMode(play)) { Flags_SetEventChkInf(EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER); - s32 flag = EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER; - if (GameInteractor_Should(VB_PLAY_ENTRANCE_CS, true, &flag)) { + if (GameInteractor_Should(VB_PLAY_ENTRANCE_CS, true, EVENTCHKINF_ENTERED_MASTER_SWORD_CHAMBER, + gSaveContext.entranceIndex)) { play->csCtx.segment = D_808BBD90; gSaveContext.cutsceneTrigger = 1; }