Skip to content

Commit

Permalink
Randomizer: Skip Cutscenes (HarbourMasters#846)
Browse files Browse the repository at this point in the history
* Skip Jabu Jabu's fishy feeding time if rando is enabled Issue HarbourMasters#757

Also skip the ganon tower fall cutscene if you died to ganon during the ganon fight for issue HarbourMasters#773

* Immediately give control back to player when talon running cutscene starts.

* Fix case of not skipping Gannon
  • Loading branch information
Dog authored Aug 8, 2022
1 parent cf639b1 commit 1f5d323
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
16 changes: 10 additions & 6 deletions soh/src/code/z_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,10 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt
s32 temp = 0;

// Automatically skip certain cutscenes when in rando
// cmd->base == 33: Zelda escaping with impa cutscene
// cmd->base == 8: Traveling back/forward in time cutscene
bool randoCsSkip = (gSaveContext.n64ddFlag && (cmd->base == 33 || cmd->base == 8));
// cmd->base == 24: Dropping a fish for Jabu Jabu
// cmd->base == 33: Zelda escaping with impa cutscene
bool randoCsSkip = (gSaveContext.n64ddFlag && (cmd->base == 8 || cmd->base == 24 || cmd->base == 33));
bool debugCsSkip = (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_START) &&
(gSaveContext.fileNum != 0xFEDC) && CVar_GetS32("gDebugEnabled", 0));

Expand Down Expand Up @@ -2090,6 +2091,8 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) {
osSyncPrintf("\ngame_info.mode=[%d] restart_flag", ((void)0, gSaveContext.respawnFlag));

if ((gSaveContext.gameMode == 0) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
const bool bShouldTowerRandoSkip =
(gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE));
if ((gSaveContext.entranceIndex == 0x01E1) && !Flags_GetEventChkInf(0xAC)) {
if (!gSaveContext.n64ddFlag) {
Flags_SetEventChkInf(0xAC);
Expand Down Expand Up @@ -2118,14 +2121,15 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) {
gSaveContext.entranceIndex = 0x0053;
gSaveContext.cutsceneIndex = 0xFFF8;
}
} else if (!Flags_GetEventChkInf(0xC7) &&
(gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO)) {
} else if ((!Flags_GetEventChkInf(0xC7) &&
gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_DEMO) ||
(bShouldTowerRandoSkip &&
gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_GANON_FINAL)) {
Flags_SetEventChkInf(0xC7);
gSaveContext.entranceIndex = 0x0517;

// If we are rando and tower escape skip is on, then set the flag to say we saw the towers fall
// and exit.
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_TOWER_ESCAPE)) {
if (bShouldTowerRandoSkip) {
return;
}
gSaveContext.cutsceneIndex = 0xFFF0;
Expand Down
5 changes: 4 additions & 1 deletion soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,13 @@ void func_80B14AF4(EnTa* this, GlobalContext* globalCtx) {

void func_80B14B6C(EnTa* this, GlobalContext* globalCtx) {
if (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT) {
OnePointCutscene_Init(globalCtx, 4175, -99, &this->actor, MAIN_CAM);
s16 csCamIdx = OnePointCutscene_Init(globalCtx, 4175, -99, &this->actor, MAIN_CAM);
func_80B13AA0(this, func_80B14AF4, func_80B167C0);
this->unk_2CC = 5;
gSaveContext.eventChkInf[1] |= 0x10;
if (gSaveContext.n64ddFlag) {
OnePointCutscene_EndCutscene(globalCtx, csCamIdx);
}
Animation_PlayOnce(&this->skelAnime, &gTalonRunTransitionAnim);
this->currentAnimation = &gTalonRunAnim;
}
Expand Down

0 comments on commit 1f5d323

Please sign in to comment.