Skip Kakariko gate cutscenes

This commit is contained in:
JordanLongstaff 2025-04-03 13:10:27 -04:00
commit f6fa9762f7
3 changed files with 49 additions and 20 deletions

View file

@ -1430,6 +1430,14 @@ typedef enum {
// - None
VB_PLAY_GORON_FREE_CS,
// #### `result`
// ```c
// true
// ```
// #### `args`
// - `*EnHeishi2
VB_PLAY_KAKARIKO_GATE_CS,
// #### `result`
// ```c
// true

View file

@ -13,6 +13,7 @@ extern "C" {
#include "src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.h"
#include "src/overlays/actors/ovl_En_Owl/z_en_owl.h"
#include "src/overlays/actors/ovl_En_Go2/z_en_go2.h"
#include "src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.h"
#include "src/overlays/actors/ovl_En_Ko/z_en_ko.h"
#include "src/overlays/actors/ovl_En_Ma1/z_en_ma1.h"
#include "src/overlays/actors/ovl_En_Ru2/z_en_ru2.h"
@ -720,6 +721,20 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
break;
}
case VB_PLAY_KAKARIKO_GATE_CS: {
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) {
EnHeishi2* enHeishi2 = va_arg(args, EnHeishi2*);
enHeishi2->unk_2F2[0] = 0;
if (enHeishi2->cameraId != MAIN_CAM) {
Play_ClearCamera(gPlayState, enHeishi2->cameraId);
Play_ChangeCameraStatus(gPlayState, MAIN_CAM, CAM_STAT_ACTIVE);
}
*should = false;
}
break;
}
case VB_PLAY_RAINBOW_BRIDGE_CS: {
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), IS_RANDO)) {
*should = false;

View file

@ -479,6 +479,7 @@ void func_80A53DF8(EnHeishi2* this, PlayState* play) {
f32 frameCount = Animation_GetLastFrame(&gEnHeishiIdleAnim);
Animation_Change(&this->skelAnime, &gEnHeishiIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f);
if (GameInteractor_Should(VB_PLAY_KAKARIKO_GATE_CS, true, this)) {
this->unk_2F2[0] = 200;
this->cameraId = Play_CreateSubCamera(play);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_WAIT);
@ -496,6 +497,7 @@ void func_80A53DF8(EnHeishi2* this, PlayState* play) {
this->unk_298.z = -1079.0f;
this->unk_28C.z = -1079.0f;
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
}
this->actionFunc = func_80A53F30;
}
@ -503,11 +505,15 @@ void func_80A53F30(EnHeishi2* this, PlayState* play) {
BgGateShutter* gate;
SkelAnime_Update(&this->skelAnime);
if (GameInteractor_Should(VB_PLAY_KAKARIKO_GATE_CS, true, this)) {
Play_CameraSetAtEye(play, this->cameraId, &this->unk_280, &this->unk_28C);
}
gate = (BgGateShutter*)this->gate;
if ((this->unk_2F2[0] == 0) || (gate->openingState == 0)) {
if (GameInteractor_Should(VB_PLAY_KAKARIKO_GATE_CS, true, this)) {
Play_ClearCamera(play, this->cameraId);
Play_ChangeCameraStatus(play, MAIN_CAM, CAM_STAT_ACTIVE);
}
if ((this->unk_30A != 2)) {
if (this->unk_30A == 0) {
this->actor.textId = 0x2015;