From 2e71a826b21c08d3e69b240a3f676689d17fa584 Mon Sep 17 00:00:00 2001 From: Jordan Longstaff Date: Thu, 12 Dec 2024 10:25:07 -0500 Subject: [PATCH] Skip walking away cutscene when freeing Gorons (#4639) * Skip walking away cutscene when freeing Gorons * Revert a change too far * Restore Goron walking out animation --- .../Enhancements/game-interactor/GameInteractor.h | 2 ++ soh/soh/Enhancements/timesaver_hook_handlers.cpp | 7 +++++++ soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c | 14 ++++++++++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index f91e3491e..26443741d 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -324,6 +324,8 @@ typedef enum { VB_PLAY_BOLERO_OF_FIRE_CS, VB_PLAY_SERENADE_OF_WATER_CS, VB_PLAY_EYEDROPS_CS, + // Opt: *EnGo2 + VB_PLAY_GORON_FREE_CS, // Opt: *EnOkarinaTag VB_PLAY_DRAIN_WELL_CS, // Opt: *EnOkarinaTag diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 74a2f2138..4df932b73 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -12,6 +12,7 @@ extern "C" { #include "src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h" #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_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" @@ -519,6 +520,12 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li } break; } + case VB_PLAY_GORON_FREE_CS: { + if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.Story"), 0)) { + *should = false; + } + break; + } case VB_PLAY_DOOR_OF_TIME_CS: { if (CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipMiscInteractions"), IS_RANDO)) { *should = false; diff --git a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c index a483de7d5..b1bc319f5 100644 --- a/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/soh/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -1919,7 +1919,9 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) { switch (this->goronState) { case 0: // Wake up if (Message_GetState(&play->msgCtx) == TEXT_STATE_CLOSING) { - EnGo2_GoronFireCamera(this, play); + if (GameInteractor_Should(VB_PLAY_GORON_FREE_CS, true)) { + EnGo2_GoronFireCamera(this, play); + } play->msgCtx.msgMode = MSGMODE_PAUSED; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_2); this->waypoint = 1; @@ -1939,7 +1941,9 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) { (f32)((Math_SinS(this->actor.world.rot.y) * -30.0f) + this->actor.world.pos.x); player->actor.world.pos.z = (f32)((Math_CosS(this->actor.world.rot.y) * -30.0f) + this->actor.world.pos.z); - Player_SetCsActionWithHaltedActors(play, &this->actor, 8); + if (GameInteractor_Should(VB_PLAY_GORON_FREE_CS, true)) { + Player_SetCsActionWithHaltedActors(play, &this->actor, 8); + } Audio_PlayFanfare(NA_BGM_APPEAR); } break; @@ -1975,8 +1979,10 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) { } case 4: // Finalize walking away Message_CloseTextbox(play); - EnGo2_GoronFireClearCamera(this, play); - Player_SetCsActionWithHaltedActors(play, &this->actor, 7); + if (GameInteractor_Should(VB_PLAY_GORON_FREE_CS, true)) { + EnGo2_GoronFireClearCamera(this, play); + Player_SetCsActionWithHaltedActors(play, &this->actor, 7); + } Actor_Kill(&this->actor); break; case 1: