diff --git a/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp b/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp index 1cd6fd829..db7dd96a3 100644 --- a/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp +++ b/soh/soh/Enhancements/TimeSavers/FasterHeavyBlockLift.cpp @@ -1,7 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" -#include "spdlog/spdlog.h" +#include "soh/ShipInit.hpp" extern "C" { #include "z64save.h" diff --git a/soh/soh/Enhancements/TimeSavers/FasterRupeeAccumulator.cpp b/soh/soh/Enhancements/TimeSavers/FasterRupeeAccumulator.cpp index 2417f5d1e..5fcfb0d26 100644 --- a/soh/soh/Enhancements/TimeSavers/FasterRupeeAccumulator.cpp +++ b/soh/soh/Enhancements/TimeSavers/FasterRupeeAccumulator.cpp @@ -1,7 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" -#include "spdlog/spdlog.h" +#include "soh/ShipInit.hpp" extern "C" { #include "z64save.h" diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/SkipIntro.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/SkipIntro.cpp index 35710c484..c5b5688d5 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/SkipIntro.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/SkipIntro.cpp @@ -1,6 +1,6 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/Enhancements/randomizer/context.h" +#include "soh/ShipInit.hpp" extern "C" { #include "z64save.h" @@ -15,7 +15,7 @@ void RegisterSkipIntro() { // If we're playing rando and if starting age is adult and/or overworld spawns are shuffled we need to skip // the cutscene regardless of the enhancement being on. bool adultStart = gSaveContext.linkAge == LINK_AGE_ADULT; - bool shuffleEntrances = OTRGlobals::Instance->gRandoContext->GetOption(RSK_SHUFFLE_ENTRANCES).Is(true); + bool shuffleEntrances = Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_ENTRANCES).Is(true); if ((CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Intro"), IS_RANDO) || (IS_RANDO && (adultStart || shuffleEntrances))) && gSaveContext.cutsceneIndex == 0xFFF1) { @@ -46,4 +46,4 @@ void RegisterSkipIntro() { }); } -static RegisterShipInitFunc initFunc(RegisterSkipIntro, {}); +static RegisterShipInitFunc initFunc(RegisterSkipIntro); diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp index e7b7a4135..facdc0ca5 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipBlueWarp.cpp @@ -1,6 +1,7 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/Enhancements/randomizer/context.h" +#include "soh/ShipInit.hpp" extern "C" { #include "macros.h" @@ -14,118 +15,6 @@ extern "C" { static bool sEnteredBlueWarp = false; -/** - * This will override the transitions into the blue warp cutscenes, set any appropriate flags, and - * set the entrance index to where you would normally end up after the blue warp cutscene. This - * should also account for the difference between your first and following visits to the blue warp. - */ -void SkipBlueWarp_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_list originalArgs) { - // Do nothing when in a boss rush - if (IS_BOSS_RUSH) { - return; - } - - bool overrideBlueWarpDestinations = - IS_RANDO && (RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || - RAND_GET_OPTION(RSK_SHUFFLE_BOSS_ENTRANCES) != RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF); - - // Force blue warp skip on when ER needs to place Link somewhere else. - // This is preferred over having story cutscenes play in the overworld and then reloading Link somewhere else after. - if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO) || overrideBlueWarpDestinations) { - bool isBlueWarpCutscene = false; - // Deku Tree Blue warp - if (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0 && gSaveContext.cutsceneIndex == 0xFFF1) { - gSaveContext.entranceIndex = ENTR_KOKIRI_FOREST_DEKU_TREE_BLUE_WARP; - isBlueWarpCutscene = true; - // Dodongo's Cavern Blue warp - } else if (gSaveContext.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_BOTTOM_EXIT && - gSaveContext.cutsceneIndex == 0xFFF1) { - gSaveContext.entranceIndex = ENTR_DEATH_MOUNTAIN_TRAIL_DODONGO_BLUE_WARP; - isBlueWarpCutscene = true; - // Jabu Jabu's Blue warp - } else if (gSaveContext.entranceIndex == ENTR_ZORAS_FOUNTAIN_JABU_JABU_BLUE_WARP && - gSaveContext.cutsceneIndex == 0xFFF0) { - gSaveContext.entranceIndex = ENTR_ZORAS_FOUNTAIN_JABU_JABU_BLUE_WARP; - isBlueWarpCutscene = true; - // Forest Temple Blue warp - } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && - gSaveContext.chamberCutsceneNum == CHAMBER_CS_FOREST) { - // Normally set in the blue warp cutscene - Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_DEKU_TREE_SPROUT); - - if (IS_RANDO) { - gSaveContext.entranceIndex = ENTR_SACRED_FOREST_MEADOW_FOREST_TEMPLE_BLUE_WARP; - } else { - gSaveContext.entranceIndex = ENTR_KOKIRI_FOREST_12; - } - - isBlueWarpCutscene = true; - // Fire Temple Blue warp - } else if (gSaveContext.entranceIndex == ENTR_KAKARIKO_VILLAGE_FRONT_GATE && - gSaveContext.cutsceneIndex == 0xFFF3) { - // Normally set in the blue warp cutscene - Flags_SetEventChkInf(EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED); - - gSaveContext.entranceIndex = ENTR_DEATH_MOUNTAIN_CRATER_FIRE_TEMPLE_BLUE_WARP; - isBlueWarpCutscene = true; - // Water Temple Blue warp - } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && - gSaveContext.chamberCutsceneNum == CHAMBER_CS_WATER) { - // Normally set in the blue warp cutscene - gSaveContext.dayTime = gSaveContext.skyboxTime = 0x4800; - Flags_SetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER); - - gSaveContext.entranceIndex = ENTR_LAKE_HYLIA_WATER_TEMPLE_BLUE_WARP; - isBlueWarpCutscene = true; - // Spirit Temple Blue warp - } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && - gSaveContext.chamberCutsceneNum == CHAMBER_CS_SPIRIT) { - gSaveContext.entranceIndex = ENTR_DESERT_COLOSSUS_SPIRIT_TEMPLE_BLUE_WARP; - isBlueWarpCutscene = true; - // Shadow Temple Blue warp - } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && - gSaveContext.chamberCutsceneNum == CHAMBER_CS_SHADOW) { - gSaveContext.entranceIndex = ENTR_GRAVEYARD_SHADOW_TEMPLE_BLUE_WARP; - isBlueWarpCutscene = true; - } - - if (isBlueWarpCutscene) { - if (gSaveContext.entranceIndex != ENTR_LAKE_HYLIA_WATER_TEMPLE_BLUE_WARP) { - // Normally set in the blue warp cutscene - gSaveContext.dayTime = gSaveContext.skyboxTime = 0x8000; - } - - *should = false; - gSaveContext.cutsceneIndex = 0; - } - - // This is outside the above condition because we want to handle both first and following visits to the blue - // warp - if (sEnteredBlueWarp && overrideBlueWarpDestinations) { - Entrance_OverrideBlueWarp(); - } - } - - sEnteredBlueWarp = false; -} - -/** - * Using this hook to simply observe that Link has entered a bluewarp - * This way we know to allow entrance rando overrides to be processed on the next tranisition hook - */ -void SkipBlueWarp_ShouldPlayBlueWarpCS(GIVanillaBehavior _, bool* should, va_list originalArgs) { - sEnteredBlueWarp = true; -} - -/** - * While we could rely on the Item_Give that's normally called, it's not very clear to the player that they - * received the item when skipping the blue warp cutscene, so we'll prevent that and queue it up to be given - * to the player instead. - */ -void SkipBlueWarp_ShouldGiveItem(GIVanillaBehavior _, bool* should, va_list originalArgs) { - *should = false; -} - // Todo: Move item queueing here /** @@ -153,34 +42,138 @@ void SkipBlueWarp_OnActorUpdate(void* actorPtr) { } } -/** - * This will ensure that the Deku Tree Sprout considers the Forest Temple finished when you skip the blue warp cutscene. - * Typically this checks for if you have the medallion, and when skipping the cutscene at this point you don't have it - * yet. - */ -void SkipBlueWarp_ShouldDekuJrConsiderForestTempleFinished(GIVanillaBehavior _, bool* should, va_list originalArgs) { - if (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_DEKU_TREE_BLUE_WARP && gSaveContext.cutsceneIndex == 0xFFF1) { - *should = Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP); - } -} - void RegisterSkipBlueWarp() { COND_ID_HOOK(OnActorUpdate, ACTOR_EN_KO, CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), SkipBlueWarp_OnActorUpdate); - COND_ID_HOOK(OnVanillaBehavior, VB_DEKU_JR_CONSIDER_FOREST_TEMPLE_FINISHED, - CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), - SkipBlueWarp_ShouldDekuJrConsiderForestTempleFinished); - COND_ID_HOOK(OnVanillaBehavior, VB_GIVE_ITEM_FROM_BLUE_WARP, - CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), - SkipBlueWarp_ShouldGiveItem); + + /** + * This will ensure that the Deku Tree Sprout considers the Forest Temple finished when you skip the blue warp + * cutscene. Typically this checks for if you have the medallion, and when skipping the cutscene at this point you + * don't have it yet. + */ + COND_VB_SHOULD(VB_DEKU_JR_CONSIDER_FOREST_TEMPLE_FINISHED, + CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), { + if (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_DEKU_TREE_BLUE_WARP && + gSaveContext.cutsceneIndex == 0xFFF1) { + *should = Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP); + } + }); + + /** + * While we could rely on the Item_Give that's normally called, it's not very clear to the player that they + * received the item when skipping the blue warp cutscene, so we'll prevent that and queue it up to be given + * to the player instead. + */ + COND_VB_SHOULD(VB_GIVE_ITEM_FROM_BLUE_WARP, + CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), { *should = false; }); } void RegisterShouldPlayBlueWarp() { - COND_ID_HOOK(OnVanillaBehavior, VB_PLAY_TRANSITION_CS, true, SkipBlueWarp_ShouldPlayTransitionCS); - COND_ID_HOOK(OnVanillaBehavior, VB_PLAY_BLUE_WARP_CS, true, SkipBlueWarp_ShouldPlayBlueWarpCS); + /** + * This will override the transitions into the blue warp cutscenes, set any appropriate flags, and + * set the entrance index to where you would normally end up after the blue warp cutscene. This + * should also account for the difference between your first and following visits to the blue warp. + */ + REGISTER_VB_SHOULD(VB_PLAY_TRANSITION_CS, { + // Do nothing when in a boss rush + if (IS_BOSS_RUSH) { + return; + } + + bool overrideBlueWarpDestinations = + IS_RANDO && (RAND_GET_OPTION(RSK_SHUFFLE_DUNGEON_ENTRANCES) != RO_DUNGEON_ENTRANCE_SHUFFLE_OFF || + RAND_GET_OPTION(RSK_SHUFFLE_BOSS_ENTRANCES) != RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF); + + // Force blue warp skip on when ER needs to place Link somewhere else. + // This is preferred over having story cutscenes play in the overworld and then reloading Link somewhere else + // after. + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO) || + overrideBlueWarpDestinations) { + bool isBlueWarpCutscene = false; + // Deku Tree Blue warp + if (gSaveContext.entranceIndex == ENTR_KOKIRI_FOREST_0 && gSaveContext.cutsceneIndex == 0xFFF1) { + gSaveContext.entranceIndex = ENTR_KOKIRI_FOREST_DEKU_TREE_BLUE_WARP; + isBlueWarpCutscene = true; + // Dodongo's Cavern Blue warp + } else if (gSaveContext.entranceIndex == ENTR_DEATH_MOUNTAIN_TRAIL_BOTTOM_EXIT && + gSaveContext.cutsceneIndex == 0xFFF1) { + gSaveContext.entranceIndex = ENTR_DEATH_MOUNTAIN_TRAIL_DODONGO_BLUE_WARP; + isBlueWarpCutscene = true; + // Jabu Jabu's Blue warp + } else if (gSaveContext.entranceIndex == ENTR_ZORAS_FOUNTAIN_JABU_JABU_BLUE_WARP && + gSaveContext.cutsceneIndex == 0xFFF0) { + gSaveContext.entranceIndex = ENTR_ZORAS_FOUNTAIN_JABU_JABU_BLUE_WARP; + isBlueWarpCutscene = true; + // Forest Temple Blue warp + } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && + gSaveContext.chamberCutsceneNum == CHAMBER_CS_FOREST) { + // Normally set in the blue warp cutscene + Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_DEKU_TREE_SPROUT); + + if (IS_RANDO) { + gSaveContext.entranceIndex = ENTR_SACRED_FOREST_MEADOW_FOREST_TEMPLE_BLUE_WARP; + } else { + gSaveContext.entranceIndex = ENTR_KOKIRI_FOREST_12; + } + + isBlueWarpCutscene = true; + // Fire Temple Blue warp + } else if (gSaveContext.entranceIndex == ENTR_KAKARIKO_VILLAGE_FRONT_GATE && + gSaveContext.cutsceneIndex == 0xFFF3) { + // Normally set in the blue warp cutscene + Flags_SetEventChkInf(EVENTCHKINF_DEATH_MOUNTAIN_ERUPTED); + + gSaveContext.entranceIndex = ENTR_DEATH_MOUNTAIN_CRATER_FIRE_TEMPLE_BLUE_WARP; + isBlueWarpCutscene = true; + // Water Temple Blue warp + } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && + gSaveContext.chamberCutsceneNum == CHAMBER_CS_WATER) { + // Normally set in the blue warp cutscene + gSaveContext.dayTime = gSaveContext.skyboxTime = 0x4800; + Flags_SetEventChkInf(EVENTCHKINF_RAISED_LAKE_HYLIA_WATER); + + gSaveContext.entranceIndex = ENTR_LAKE_HYLIA_WATER_TEMPLE_BLUE_WARP; + isBlueWarpCutscene = true; + // Spirit Temple Blue warp + } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && + gSaveContext.chamberCutsceneNum == CHAMBER_CS_SPIRIT) { + gSaveContext.entranceIndex = ENTR_DESERT_COLOSSUS_SPIRIT_TEMPLE_BLUE_WARP; + isBlueWarpCutscene = true; + // Shadow Temple Blue warp + } else if (gSaveContext.entranceIndex == ENTR_CHAMBER_OF_THE_SAGES_0 && gSaveContext.cutsceneIndex == 0x0 && + gSaveContext.chamberCutsceneNum == CHAMBER_CS_SHADOW) { + gSaveContext.entranceIndex = ENTR_GRAVEYARD_SHADOW_TEMPLE_BLUE_WARP; + isBlueWarpCutscene = true; + } + + if (isBlueWarpCutscene) { + if (gSaveContext.entranceIndex != ENTR_LAKE_HYLIA_WATER_TEMPLE_BLUE_WARP) { + // Normally set in the blue warp cutscene + gSaveContext.dayTime = gSaveContext.skyboxTime = 0x8000; + } + + *should = false; + gSaveContext.cutsceneIndex = 0; + } + + // This is outside the above condition because we want to handle both first and following visits to the blue + // warp + if (sEnteredBlueWarp && overrideBlueWarpDestinations) { + Entrance_OverrideBlueWarp(); + } + } + + sEnteredBlueWarp = false; + }); + + /** + * Using this hook to simply observe that Link has entered a bluewarp + * This way we know to allow entrance rando overrides to be processed on the next tranisition hook + */ + REGISTER_VB_SHOULD(VB_PLAY_BLUE_WARP_CS, { sEnteredBlueWarp = true; }); } static RegisterShipInitFunc initFunc(RegisterSkipBlueWarp, { CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), "IS_RANDO" }); -static RegisterShipInitFunc initFunc2(RegisterShouldPlayBlueWarp, {}); +static RegisterShipInitFunc initFunc2(RegisterShouldPlayBlueWarp); diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp index ff8c511d4..9faa312a1 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipDekuTreeIntro.cpp @@ -1,6 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/ShipInit.hpp" extern "C" { #include "src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h" diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp index 6f789a69c..d743bead9 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipLostWoodsBridge.cpp @@ -1,6 +1,6 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/ShipInit.hpp" extern "C" { #include "z64save.h" diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipToGivingZeldasLetter.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipToGivingZeldasLetter.cpp index b78c6c852..1acd6dabe 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipToGivingZeldasLetter.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipToGivingZeldasLetter.cpp @@ -1,6 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/ShipInit.hpp" extern "C" { #include "src/overlays/actors/ovl_En_Zl4/z_en_zl4.h" diff --git a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp index d1c9eeb38..ae82ff9f0 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipCutscene/Story/SkipZeldaFleeingCastle.cpp @@ -1,6 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/ShipInit.hpp" extern "C" { #include "z64save.h" @@ -8,16 +7,6 @@ extern "C" { extern SaveContext gSaveContext; } -void SkipZeldaFleeingCastle_ShouldPlayTransitionCS(GIVanillaBehavior _, bool* should, va_list originalArgs) { - if (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_PAST_BRIDGE_SPAWN && gSaveContext.cutsceneIndex == 0xFFF1) { - // Normally set in the cutscene - gSaveContext.dayTime = gSaveContext.skyboxTime = 0x4AAA; - - gSaveContext.cutsceneIndex = 0; - *should = false; - } -} - /** * When this cutscene is skipped, walking up to the bridge to castle town triggers a quick fade in/out * which can be confusing to beginners, because they need to then fetch the Ocarina of Time from the water. @@ -61,9 +50,15 @@ void RegisterSkipZeldaFleeingCastle() { COND_ID_HOOK(OnActorInit, ACTOR_ITEM_OCARINA, CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), SkipZeldaFleeingCastle_OnActorInit); - COND_ID_HOOK(OnVanillaBehavior, VB_PLAY_TRANSITION_CS, - CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), - SkipZeldaFleeingCastle_ShouldPlayTransitionCS); + COND_VB_SHOULD(VB_PLAY_TRANSITION_CS, CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), { + if (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_PAST_BRIDGE_SPAWN && gSaveContext.cutsceneIndex == 0xFFF1) { + // Normally set in the cutscene + gSaveContext.dayTime = gSaveContext.skyboxTime = 0x4AAA; + + gSaveContext.cutsceneIndex = 0; + *should = false; + } + }); } static RegisterShipInitFunc initFunc(RegisterSkipZeldaFleeingCastle, diff --git a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveJabuJabuElevator.cpp b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveJabuJabuElevator.cpp index 4039f6a19..34e2fdf61 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveJabuJabuElevator.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveJabuJabuElevator.cpp @@ -1,6 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/ShipInit.hpp" extern "C" { #include "src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h" diff --git a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp index 847852186..1e4e77d44 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/MoveMidoInKokiriForest.cpp @@ -1,6 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/ShipInit.hpp" extern "C" { #include "z64save.h" diff --git a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp index 93b10f015..39417d5de 100644 --- a/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp +++ b/soh/soh/Enhancements/TimeSavers/SkipMiscInteractions/SkipChildRutoInteractions.cpp @@ -1,6 +1,5 @@ #include "soh/Enhancements/game-interactor/GameInteractor.h" -#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" -#include "soh/OTRGlobals.h" +#include "soh/ShipInit.hpp" extern "C" { #include "overlays/actors/ovl_En_Ru1/z_en_ru1.h"