From a5f59039552d51028e61f701a32cae246787851b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= <159546+serprex@users.noreply.github.com> Date: Tue, 8 Sep 2026 13:38:30 +0000 Subject: [PATCH] water temple: quadruple water level change when skipping cutscene (#7162) prevents falling into water while it descends, reaching 2f cracked wall without tricks --- .../FasterWaterTempleLevelChange.cpp | 20 +++++++++++++++++++ .../vanilla-behavior/GIVanillaBehavior.h | 8 ++++++++ .../ovl_Bg_Mizu_Water/z_bg_mizu_water.c | 5 ++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 soh/soh/Enhancements/TimeSavers/FasterWaterTempleLevelChange.cpp diff --git a/soh/soh/Enhancements/TimeSavers/FasterWaterTempleLevelChange.cpp b/soh/soh/Enhancements/TimeSavers/FasterWaterTempleLevelChange.cpp new file mode 100644 index 0000000000..8ce53239ca --- /dev/null +++ b/soh/soh/Enhancements/TimeSavers/FasterWaterTempleLevelChange.cpp @@ -0,0 +1,20 @@ +#include +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/ShipInit.hpp" +#include "soh/cvar_prefixes.h" + +extern "C" { +#include "z64save.h" +extern SaveContext gSaveContext; +} + +static void RegisterFasterWaterTempleLevelChange() { + COND_VB_SHOULD(VB_MODIFY_WATER_TEMPLE_WATER_LEVEL_SPEED, + IS_RANDO || CVarGetInteger(CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), 0), { + f32* speed = va_arg(args, f32*); + *speed = 20.0f; + }); +} + +static RegisterShipInitFunc initFunc(RegisterFasterWaterTempleLevelChange, + { CVAR_ENHANCEMENT("TimeSavers.SkipCutscene.OnePoint"), "IS_RANDO" }); diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index 239c7520e6..d53d15c5b9 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1784,6 +1784,14 @@ typedef enum { // - `s32` (note append position) VB_MODIFY_LOST_WOODS_OCARINA_GAME_NOTE_SPEED, + // #### `result` + // ```c + // true + // ``` + // #### `args` + // - `f32*` speed + VB_MODIFY_WATER_TEMPLE_WATER_LEVEL_SPEED, + // #### `result` // ```c // this->interactInfo.talkState == NPC_TALK_STATE_ACTION diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/soh/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 1a13b1a0d0..3f1fc6d792 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -6,6 +6,7 @@ #include "z_bg_mizu_water.h" #include "objects/object_mizu_objects/object_mizu_objects.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -233,7 +234,9 @@ void BgMizuWater_ChangeWaterLevel(BgMizuWater* this, PlayState* play) { Flags_UnsetSwitch(play, prevSwitchFlag); } - if (Math_StepToF(&this->actor.world.pos.y, this->targetY, 5.0f)) { + f32 speed = 5.0f; + GameInteractor_Should(VB_MODIFY_WATER_TEMPLE_WATER_LEVEL_SPEED, true, &speed); + if (Math_StepToF(&this->actor.world.pos.y, this->targetY, speed)) { play->roomCtx.unk_74[0] = 0; this->actionFunc = BgMizuWater_WaitForAction; Message_CloseTextbox(play);