Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip the Mweep cutscene #4646

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions soh/soh/Enhancements/game-interactor/GameInteractor.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ typedef enum {
// Vanilla condition: !EVENTCHKINF_PULLED_MASTER_SWORD_FROM_PEDESTAL
VB_PLAY_PULL_MASTER_SWORD_CS,
VB_PLAY_DROP_FISH_FOR_JABU_CS,
// Opt: *EnKz
VB_PLAY_MWEEP_CS,
// Vanilla condition: player->getItemId == GI_GAUNTLETS_SILVER
VB_PLAY_NABOORU_CAPTURED_CS,
VB_PLAY_ZELDAS_LULLABY_CS,
Expand Down
8 changes: 8 additions & 0 deletions soh/soh/Enhancements/timesaver_hook_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
}
break;
}
case VB_PLAY_MWEEP_CS: {
if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), 0)) {
*should = false;
Inventory_ReplaceItem(gPlayState, ITEM_LETTER_RUTO, ITEM_BOTTLE);
Flags_SetEventChkInf(EVENTCHKINF_KING_ZORA_MOVED);
}
break;
}
case VB_PLAY_EYEDROP_CREATION_ANIM:
case VB_PLAY_EYEDROPS_CS:
case VB_PLAY_DROP_FISH_FOR_JABU_CS:
Expand Down
30 changes: 20 additions & 10 deletions soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,17 +437,23 @@ void EnKz_SetupMweep(EnKz* this, PlayState* play) {
Vec3f pos;
Vec3f initPos;

this->cutsceneCamera = Play_CreateSubCamera(play);
this->gameplayCamera = play->activeCamera;
Play_ChangeCameraStatus(play, this->gameplayCamera, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->cutsceneCamera, CAM_STAT_ACTIVE);
bool shouldPlayCutscene = GameInteractor_Should(VB_PLAY_MWEEP_CS, true);

if (shouldPlayCutscene) {
this->cutsceneCamera = Play_CreateSubCamera(play);
this->gameplayCamera = play->activeCamera;
Play_ChangeCameraStatus(play, this->gameplayCamera, CAM_STAT_WAIT);
Play_ChangeCameraStatus(play, this->cutsceneCamera, CAM_STAT_ACTIVE);
}
pos = this->actor.world.pos;
initPos = this->actor.home.pos;
pos.y += 60.0f;
initPos.y += -100.0f;
initPos.z += 260.0f;
Play_CameraSetAtEye(play, this->cutsceneCamera, &pos, &initPos);
Player_SetCsActionWithHaltedActors(play, &this->actor, 8);
if (shouldPlayCutscene) {
Play_CameraSetAtEye(play, this->cutsceneCamera, &pos, &initPos);
Player_SetCsActionWithHaltedActors(play, &this->actor, 8);
}
this->actor.speedXZ = 0.1f * CVarGetFloat(CVAR_ENHANCEMENT("MweepSpeed"), 1.0f);
this->actionFunc = EnKz_Mweep;
}
Expand All @@ -462,7 +468,9 @@ void EnKz_Mweep(EnKz* this, PlayState* play) {
pos.y += 60.0f;
initPos.y += -100.0f;
initPos.z += 260.0f;
Play_CameraSetAtEye(play, this->cutsceneCamera, &pos, &initPos);
if (GameInteractor_Should(VB_PLAY_MWEEP_CS, true)) {
Play_CameraSetAtEye(play, this->cutsceneCamera, &pos, &initPos);
}
if ((EnKz_FollowPath(this, play) == 1) && (this->waypoint == 0)) {
Animation_ChangeByInfo(&this->skelanime, sAnimationInfo, ENKZ_ANIM_1);
Inventory_ReplaceItem(play, ITEM_LETTER_RUTO, ITEM_BOTTLE);
Expand All @@ -477,9 +485,11 @@ void EnKz_Mweep(EnKz* this, PlayState* play) {
}

void EnKz_StopMweep(EnKz* this, PlayState* play) {
Play_ChangeCameraStatus(play, this->gameplayCamera, CAM_STAT_ACTIVE);
Play_ClearCamera(play, this->cutsceneCamera);
Player_SetCsActionWithHaltedActors(play, &this->actor, 7);
if (GameInteractor_Should(VB_PLAY_MWEEP_CS, true)) {
Play_ChangeCameraStatus(play, this->gameplayCamera, CAM_STAT_ACTIVE);
Play_ClearCamera(play, this->cutsceneCamera);
Player_SetCsActionWithHaltedActors(play, &this->actor, 7);
}
this->actionFunc = EnKz_Wait;
}

Expand Down