mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 13:17:58 +03:00
avoid otrglobals, fixes
This commit is contained in:
parent
21724f4bfa
commit
03df49004b
11 changed files with 148 additions and 169 deletions
|
@ -1,7 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/ShipInit.hpp"
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/ShipInit.hpp"
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
#include "spdlog/spdlog.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/randomizer/context.h"
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/ShipInit.hpp"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "z64save.h"
|
#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
|
// 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.
|
// the cutscene regardless of the enhancement being on.
|
||||||
bool adultStart = gSaveContext.linkAge == LINK_AGE_ADULT;
|
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) ||
|
if ((CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Intro"), IS_RANDO) ||
|
||||||
(IS_RANDO && (adultStart || shuffleEntrances))) &&
|
(IS_RANDO && (adultStart || shuffleEntrances))) &&
|
||||||
gSaveContext.cutsceneIndex == 0xFFF1) {
|
gSaveContext.cutsceneIndex == 0xFFF1) {
|
||||||
|
@ -46,4 +46,4 @@ void RegisterSkipIntro() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static RegisterShipInitFunc initFunc(RegisterSkipIntro, {});
|
static RegisterShipInitFunc initFunc(RegisterSkipIntro);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.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" {
|
extern "C" {
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
|
@ -14,118 +15,6 @@ extern "C" {
|
||||||
|
|
||||||
static bool sEnteredBlueWarp = false;
|
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
|
// 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() {
|
void RegisterSkipBlueWarp() {
|
||||||
COND_ID_HOOK(OnActorUpdate, ACTOR_EN_KO,
|
COND_ID_HOOK(OnActorUpdate, ACTOR_EN_KO,
|
||||||
CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO),
|
CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO),
|
||||||
SkipBlueWarp_OnActorUpdate);
|
SkipBlueWarp_OnActorUpdate);
|
||||||
COND_ID_HOOK(OnVanillaBehavior, VB_DEKU_JR_CONSIDER_FOREST_TEMPLE_FINISHED,
|
|
||||||
CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO),
|
/**
|
||||||
SkipBlueWarp_ShouldDekuJrConsiderForestTempleFinished);
|
* This will ensure that the Deku Tree Sprout considers the Forest Temple finished when you skip the blue warp
|
||||||
COND_ID_HOOK(OnVanillaBehavior, VB_GIVE_ITEM_FROM_BLUE_WARP,
|
* cutscene. Typically this checks for if you have the medallion, and when skipping the cutscene at this point you
|
||||||
CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO),
|
* don't have it yet.
|
||||||
SkipBlueWarp_ShouldGiveItem);
|
*/
|
||||||
|
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() {
|
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,
|
static RegisterShipInitFunc initFunc(RegisterSkipBlueWarp,
|
||||||
{ CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), "IS_RANDO" });
|
{ CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), "IS_RANDO" });
|
||||||
static RegisterShipInitFunc initFunc2(RegisterShouldPlayBlueWarp, {});
|
static RegisterShipInitFunc initFunc2(RegisterShouldPlayBlueWarp);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/ShipInit.hpp"
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h"
|
#include "src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
#include "soh/OTRGlobals.h"
|
#include "soh/ShipInit.hpp"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/ShipInit.hpp"
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "src/overlays/actors/ovl_En_Zl4/z_en_zl4.h"
|
#include "src/overlays/actors/ovl_En_Zl4/z_en_zl4.h"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/ShipInit.hpp"
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
|
@ -8,16 +7,6 @@ extern "C" {
|
||||||
extern SaveContext gSaveContext;
|
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
|
* 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.
|
* 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,
|
COND_ID_HOOK(OnActorInit, ACTOR_ITEM_OCARINA,
|
||||||
CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO),
|
CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO),
|
||||||
SkipZeldaFleeingCastle_OnActorInit);
|
SkipZeldaFleeingCastle_OnActorInit);
|
||||||
COND_ID_HOOK(OnVanillaBehavior, VB_PLAY_TRANSITION_CS,
|
COND_VB_SHOULD(VB_PLAY_TRANSITION_CS, CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO), {
|
||||||
CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO),
|
if (gSaveContext.entranceIndex == ENTR_HYRULE_FIELD_PAST_BRIDGE_SPAWN && gSaveContext.cutsceneIndex == 0xFFF1) {
|
||||||
SkipZeldaFleeingCastle_ShouldPlayTransitionCS);
|
// Normally set in the cutscene
|
||||||
|
gSaveContext.dayTime = gSaveContext.skyboxTime = 0x4AAA;
|
||||||
|
|
||||||
|
gSaveContext.cutsceneIndex = 0;
|
||||||
|
*should = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static RegisterShipInitFunc initFunc(RegisterSkipZeldaFleeingCastle,
|
static RegisterShipInitFunc initFunc(RegisterSkipZeldaFleeingCastle,
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/ShipInit.hpp"
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h"
|
#include "src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/ShipInit.hpp"
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "z64save.h"
|
#include "z64save.h"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
#include "soh/ShipInit.hpp"
|
||||||
#include "soh/OTRGlobals.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "overlays/actors/ovl_En_Ru1/z_en_ru1.h"
|
#include "overlays/actors/ovl_En_Ru1/z_en_ru1.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue