From 9c66e34989c898e25ddd931e2b71f7654f4c4cfd Mon Sep 17 00:00:00 2001 From: Demur Rumed Date: Thu, 5 Jun 2025 02:06:30 +0000 Subject: [PATCH] also shadow trial, dampe race, deku water --- soh/soh/Enhancements/SwitchTimerMultiplier.cpp | 8 ++++---- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 9 +++++++-- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 13 +++++++++---- .../actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 7 +++++-- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/soh/soh/Enhancements/SwitchTimerMultiplier.cpp b/soh/soh/Enhancements/SwitchTimerMultiplier.cpp index 6bf798f6f..3b679cf1a 100644 --- a/soh/soh/Enhancements/SwitchTimerMultiplier.cpp +++ b/soh/soh/Enhancements/SwitchTimerMultiplier.cpp @@ -7,11 +7,11 @@ extern PlayState* gPlayState; void RegisterSwitchTimerMultiplier() { COND_VB_SHOULD(VB_SWITCH_TIMER_TICK, CVarGetInteger(CVAR_ENHANCEMENT("SwitchTimerMultiplier"), 0) != 0, { - int factor = CVarGetInteger(CVAR_ENHANCEMENT("SwitchTimerMultiplier"), 0); - if (factor != 0) { - if (factor > 0 && gPlayState->gameplayFrames % (factor + 1) != 0) { + int multiplier = CVarGetInteger(CVAR_ENHANCEMENT("SwitchTimerMultiplier"), 0); + if (multiplier != 0) { + if (multiplier > 0 && gPlayState->gameplayFrames % (multiplier + 1) != 0) { *should = false; - } else if (gPlayState->gameplayFrames % (6 + factor) == 0) { + } else if (gPlayState->gameplayFrames % (6 + multiplier) == 0) { s16* timer = va_arg(args, s16*); *timer -= *timer > 0; } diff --git a/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index 620bf18ab..0c8a02049 100644 --- a/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/soh/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -6,6 +6,7 @@ #include "z_bg_gnd_darkmeiro.h" #include "objects/object_demo_kekkai/object_demo_kekkai.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) @@ -115,7 +116,9 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 1)) { if (this->actionFlags & 4) { if (this->timer1 > 0) { - this->timer1--; + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer1)) { + this->timer1--; + } } else { Flags_UnsetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 1); this->actionFlags &= ~4; @@ -131,7 +134,9 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 2)) { if (this->actionFlags & 8) { if (this->timer2 > 0) { - this->timer2--; + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer2)) { + this->timer2--; + } } else { Flags_UnsetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 2); this->actionFlags &= ~8; diff --git a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index f7b663cf9..5f842bed8 100644 --- a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -6,6 +6,7 @@ #include "z_bg_relay_objects.h" #include "objects/object_relay_objects/object_relay_objects.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED @@ -133,8 +134,10 @@ void func_808A90F4(BgRelayObjects* this, PlayState* play) { void func_808A91AC(BgRelayObjects* this, PlayState* play) { if (this->unk_169 != 5) { - if (this->timer != 0) { - this->timer--; + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (this->timer != 0) { + this->timer--; + } } func_8002F994(&this->dyna.actor, this->timer); } @@ -168,8 +171,10 @@ void BgRelayObjects_DoNothing(BgRelayObjects* this, PlayState* play) { } void func_808A932C(BgRelayObjects* this, PlayState* play) { - if (this->timer != 0) { - this->timer--; + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (this->timer != 0) { + this->timer--; + } } if (this->timer == 0) { if (!Player_InCsMode(play)) { diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 77a948717..3f449eec4 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -127,9 +127,12 @@ void BgYdanHasi_MoveWater(BgYdanHasi* this, PlayState* play) { } void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, PlayState* play) { - if (this->timer != 0) { - this->timer--; + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (this->timer != 0) { + this->timer--; + } } + func_8002F994(&this->dyna.actor, this->timer); if (this->timer == 0) { this->actionFunc = BgYdanHasi_MoveWater;