also shadow trial, dampe race, deku water

This commit is contained in:
Demur Rumed 2025-06-05 02:06:30 +00:00
commit 9c66e34989
4 changed files with 25 additions and 12 deletions

View file

@ -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;
}

View file

@ -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) {
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) {
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;

View file

@ -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,9 +134,11 @@ 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 (this->timer != 0) {
this->timer--;
}
}
func_8002F994(&this->dyna.actor, this->timer);
}
if ((this->timer == 0) || (this->unk_169 == play->roomCtx.curRoom.num)) {
@ -168,9 +171,11 @@ void BgRelayObjects_DoNothing(BgRelayObjects* this, PlayState* play) {
}
void func_808A932C(BgRelayObjects* this, PlayState* play) {
if (GameInteractor_Should(VB_SWITCH_TIMER_TICK, true, &this->timer)) {
if (this->timer != 0) {
this->timer--;
}
}
if (this->timer == 0) {
if (!Player_InCsMode(play)) {
Sfx_PlaySfxCentered(NA_SE_OC_ABYSS);

View file

@ -127,9 +127,12 @@ 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 (this->timer != 0) {
this->timer--;
}
}
func_8002F994(&this->dyna.actor, this->timer);
if (this->timer == 0) {
this->actionFunc = BgYdanHasi_MoveWater;