From e2671e7f2b7c83fd6e54c30e6b1840316cc62b4e Mon Sep 17 00:00:00 2001 From: Demur Rumed Date: Wed, 11 Jun 2025 21:00:44 +0000 Subject: [PATCH] Limit difficulty: torches stop at -3 & shadow temple torch puzzle stops at -4 --- soh/soh/Enhancements/SwitchTimerMultiplier.cpp | 7 +++++++ .../game-interactor/vanilla-behavior/GIVanillaBehavior.h | 3 ++- .../actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 2 +- .../actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c | 2 +- .../overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c | 2 +- .../overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c | 2 +- .../actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c | 2 +- .../actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 2 +- soh/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 4 ++-- soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c | 2 +- soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 2 +- 11 files changed, 19 insertions(+), 11 deletions(-) diff --git a/soh/soh/Enhancements/SwitchTimerMultiplier.cpp b/soh/soh/Enhancements/SwitchTimerMultiplier.cpp index 65b12947b..94982837d 100644 --- a/soh/soh/Enhancements/SwitchTimerMultiplier.cpp +++ b/soh/soh/Enhancements/SwitchTimerMultiplier.cpp @@ -9,6 +9,13 @@ void RegisterSwitchTimerMultiplier() { COND_VB_SHOULD(VB_SWITCH_TIMER_TICK, CVarGetInteger(CVAR_ENHANCEMENT("SwitchTimerMultiplier"), 0) != 0, { int multiplier = CVarGetInteger(CVAR_ENHANCEMENT("SwitchTimerMultiplier"), 0); if (multiplier != 0) { + Actor* actor = va_arg(args, Actor*); + if (multiplier < -3 && actor->id == ACTOR_OBJ_SYOKUDAI) { + multiplier = -3; + } else if (multiplier < -4 && actor->id == ACTOR_BG_GND_DARKMEIRO) { + multiplier = -4; + } + if (multiplier > 0 && gPlayState->gameplayFrames % (multiplier + 1) != 0) { *should = false; } else if (gPlayState->gameplayFrames % (6 + multiplier) == 0) { diff --git a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h index c003e0ce6..db2326948 100644 --- a/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h +++ b/soh/soh/Enhancements/game-interactor/vanilla-behavior/GIVanillaBehavior.h @@ -1997,7 +1997,8 @@ typedef enum { // true // ``` // #### `args` - // - `*s16` + // - `*Actor` + // - `*s16` - timer value VB_SWITCH_TIMER_TICK, // #### `result` 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 0c8a02049..4ade8918c 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 @@ -116,7 +116,7 @@ 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) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer1)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer1)) { this->timer1--; } } else { diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index e40756e90..de1578b24 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -192,7 +192,7 @@ void BgHidanCurtain_TurnOff(BgHidanCurtain* this, PlayState* play) { } void BgHidanCurtain_WaitForTimer(BgHidanCurtain* this, PlayState* play) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) { DECR(this->timer); } diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index be526164d..0cc25131d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -166,7 +166,7 @@ void BgHidanFwbig_Lower(BgHidanFwbig* this, PlayState* play) { } void BgHidanFwbig_WaitForTimer(BgHidanFwbig* this, PlayState* play) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) { if (this->timer != 0) { this->timer--; } diff --git a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 9e2a1a65a..105b01dfb 100644 --- a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -92,7 +92,7 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) { if (!Flags_GetSwitch(play, this->actor.params)) { if (this->framesUntilDisable != -1) { if (this->framesUntilDisable != 0) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->framesUntilDisable)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->framesUntilDisable)) { this->framesUntilDisable -= 1; } } diff --git a/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index 56264878b..19985b2ce 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/soh/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -138,7 +138,7 @@ void BgMizuShutter_Move(BgMizuShutter* this, PlayState* play) { void BgMizuShutter_WaitForTimer(BgMizuShutter* this, PlayState* play) { if (this->timerMax != 0x3F * 20) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) { this->timer--; } func_8002F994(&this->dyna.actor, this->timer); 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 5f842bed8..ca8e040fc 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 @@ -134,7 +134,7 @@ void func_808A90F4(BgRelayObjects* this, PlayState* play) { void func_808A91AC(BgRelayObjects* this, PlayState* play) { if (this->unk_169 != 5) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) { if (this->timer != 0) { this->timer--; } 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 3f449eec4..236ad7fec 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,7 +127,7 @@ void BgYdanHasi_MoveWater(BgYdanHasi* this, PlayState* play) { } void BgYdanHasi_DecWaterTimer(BgYdanHasi* this, PlayState* play) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) { if (this->timer != 0) { this->timer--; } @@ -149,7 +149,7 @@ void BgYdanHasi_SetupThreeBlocks(BgYdanHasi* this, PlayState* play) { } void BgYdanHasi_UpdateThreeBlocks(BgYdanHasi* this, PlayState* play) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) { if (this->timer != 0) { this->timer--; } diff --git a/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index a84e428f9..7587b7a8b 100644 --- a/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/soh/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -189,7 +189,7 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->timer)) { this->timer--; } diff --git a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index b0500c7a8..9d69aa248 100644 --- a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -241,7 +241,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderFlame.base); if (this->litTimer > 0) { - if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->litTimer)) { + if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, this, &this->litTimer)) { this->litTimer--; } if ((this->litTimer == 0) && (torchType != 0)) {