diff --git a/soh/soh/Enhancements/accessibility/accessibility.cpp b/soh/soh/Enhancements/accessibility/accessibility.cpp new file mode 100644 index 00000000000..da4455df8e1 --- /dev/null +++ b/soh/soh/Enhancements/accessibility/accessibility.cpp @@ -0,0 +1,36 @@ +#include "accessibility.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/OTRGlobals.h" + +extern "C" { +#include +#include "macros.h" +#include "functions.h" +#include "variables.h" +extern SaveContext gSaveContext; +extern PlayState* gPlayState; +} + +void RegisterLightSensitivityBehavior() { + static uint32_t shouldHookId1 = 0; + GameInteractor::Instance->UnregisterGameHookForID(shouldHookId1); + shouldHookId1 = 0; + + if (!CVarGetInteger(CVAR_SETTING("Lightsensitivity"), 0)) { + return; + } + + shouldHookId1 = REGISTER_VB_SHOULD(VB_ALLOW_FLASHING_LIGHTS, { + if (!gPlayState) { + return; + } + + // Requires Scene Change to update Storm Weather + if (gPlayState->envCtx.lightningMode != 0) { + gPlayState->envCtx.lightningMode = 0; + } + + *should = false; + return; + }); +} diff --git a/soh/soh/Enhancements/accessibility/accessibility.h b/soh/soh/Enhancements/accessibility/accessibility.h new file mode 100644 index 00000000000..cb96ca620b1 --- /dev/null +++ b/soh/soh/Enhancements/accessibility/accessibility.h @@ -0,0 +1,9 @@ +typedef enum { + VISUALSTATE_RED, + VISUALSTATE_DEFAULT, + VISUALSTATE_DEFEATED, + VISUALSTATE_STUNNED = 4, + VISUALSTATE_HIT +}; + +void RegisterLightSensitivityBehavior(); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h index 5e30441db96..ffb7f3b4e3d 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h @@ -479,6 +479,10 @@ typedef enum { // Vanilla condition: Actor is ACTOR_EN_ELF, ACTOR_EN_FISH, ACTOR_EN_ICE_HONO, or ACTOR_EN_INSECT // Opt: *Actor VB_BOTTLE_ACTOR, + + /*** Accessibility ***/ + // Vanilla Condition: true + VB_ALLOW_FLASHING_LIGHTS, } GIVanillaBehavior; #ifdef __cplusplus diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h b/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h index 46f306a3c83..4ee038da2d8 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_HookTable.h @@ -18,6 +18,7 @@ DEFINE_HOOK(OnFlagSet, (int16_t flagType, int16_t flag)); DEFINE_HOOK(OnFlagUnset, (int16_t flagType, int16_t flag)); DEFINE_HOOK(OnSceneSpawnActors, ()); DEFINE_HOOK(OnPlayerUpdate, ()); +DEFINE_HOOK(OnPlayerHealthChange, ()); DEFINE_HOOK(OnOcarinaSongAction, ()); DEFINE_HOOK(OnShopSlotChange, (uint8_t cursorIndex, int16_t price)); DEFINE_HOOK(OnActorInit, (void* actor)); diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp index 24efb40c151..574a1752e59 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.cpp @@ -64,6 +64,10 @@ void GameInteractor_ExecuteOnPlayerUpdate() { GameInteractor::Instance->ExecuteHooks(); } +void GameInteractor_ExecuteOnPlayerHealthChange() { + GameInteractor::Instance->ExecuteHooks(); +} + void GameInteractor_ExecuteOnOcarinaSongAction() { GameInteractor::Instance->ExecuteHooks(); } diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h index dccc9930ae2..fea6258ab1e 100644 --- a/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h +++ b/soh/soh/Enhancements/game-interactor/GameInteractor_Hooks.h @@ -18,6 +18,7 @@ void GameInteractor_ExecuteOnFlagSet(int16_t flagType, int16_t flag); void GameInteractor_ExecuteOnFlagUnset(int16_t flagType, int16_t flag); void GameInteractor_ExecuteOnSceneSpawnActors(); void GameInteractor_ExecuteOnPlayerUpdate(); +void GameInteractor_ExecuteOnPlayerHealthChange(); void GameInteractor_ExecuteOnOcarinaSongAction(); void GameInteractor_ExecuteOnActorInit(void* actor); void GameInteractor_ExecuteOnActorUpdate(void* actor); diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 3bdb1e82604..a36f16d3322 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -37,6 +37,8 @@ #include "objects/object_link_child/object_link_child.h" #include "kaleido.h" +#include "soh/Enhancements/accessibility/accessibility.h" + extern "C" { #include #include "align_asset_macro.h" @@ -1451,4 +1453,7 @@ void InitMods() { RegisterHurtContainerModeHandler(); RegisterPauseMenuHooks(); RandoKaleido_RegisterHooks(); + + // Accessibility Mod Inits + RegisterLightSensitivityBehavior(); } diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index d30626faea5..8ed20d875a0 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -40,6 +40,8 @@ #include "Enhancements/resolution-editor/ResolutionEditor.h" #include "Enhancements/enemyrandomizer.h" +#include "soh/Enhancements/accessibility/accessibility.h"; + // FA icons are kind of wonky, if they worked how I expected them to the "+ 2.0f" wouldn't be needed, but // they don't work how I expect them to so I added that because it looked good when I eyeballed it #define FA_ICON_BUTTON_FRAME_PADDING_X(icon) (((optionsButtonSize.x - ImGui::CalcTextSize(icon).x) / 2) + 2.0f) @@ -549,6 +551,11 @@ void DrawSettingsMenu() { #endif UIWidgets::PaddedEnhancementCheckbox("Disable Idle Camera Re-Centering", CVAR_SETTING("A11yDisableIdleCam")); UIWidgets::Tooltip("Disables the automatic re-centering of the camera when idle."); + + if (UIWidgets::PaddedEnhancementCheckbox("Enable Lightsensitivity Assistance", CVAR_SETTING("Lightsensitivity"))) { + RegisterLightSensitivityBehavior(); + } + UIWidgets::Tooltip("Reduces effects that would cause impact to those sensitive to Light."); ImGui::EndMenu(); } diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 7c3914095cb..2e9b6e86e99 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -3582,7 +3582,9 @@ Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorCategory) { * While the screen flashes, the game freezes. */ void Enemy_StartFinishingBlow(PlayState* play, Actor* actor) { - play->actorCtx.freezeFlashTimer = 5; + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, true)) { + play->actorCtx.freezeFlashTimer = 5; + } SoundSource_PlaySfxAtFixedWorldPos(play, &actor->world.pos, 20, NA_SE_EN_LAST_DAMAGE); } @@ -4171,9 +4173,10 @@ void Actor_SetColorFilter(Actor* actor, s16 colorFlag, s16 colorIntensityMax, s1 if ((colorFlag == 0x8000) && !(colorIntensityMax & 0x8000)) { Audio_PlayActorSound2(actor, NA_SE_EN_LIGHT_ARROW_HIT); } - - actor->colorFilterParams = colorFlag | xluFlag | ((colorIntensityMax & 0xF8) << 5) | duration; - actor->colorFilterTimer = duration; + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, true)) { + actor->colorFilterParams = colorFlag | xluFlag | ((colorIntensityMax & 0xF8) << 5) | duration; + actor->colorFilterTimer = duration; + } } Hilite* func_800342EC(Vec3f* object, PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 59c83fc829e..4ab0994ae4f 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -683,8 +683,8 @@ void BossDodongo_SetupInhale(BossDodongo* this) { void BossDodongo_Damaged(BossDodongo* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - Math_SmoothStepToF(&this->unk_1F8, 1.0f, 0.5f, 0.02f, 0.001f); - Math_SmoothStepToF(&this->unk_208, 0.05f, 1.0f, 0.005f, 0.0f); + //Math_SmoothStepToF(&this->unk_1F8, 1.0f, 0.5f, 0.02f, 0.001f); + //Math_SmoothStepToF(&this->unk_208, 0.05f, 1.0f, 0.005f, 0.0f); if (Animation_OnFrame(&this->skelAnime, Animation_GetLastFrame(&object_kingdodongo_Anim_001074))) { BossDodongo_SetupRoll(this); @@ -1074,18 +1074,20 @@ void BossDodongo_Update(Actor* thisx, PlayState* play2) { } if (this->unk_1BE != 0) { - if (this->unk_1BE >= 1000) { - Math_SmoothStepToF(&this->colorFilterR, 30.0f, 1, 20.0f, 0.0); - Math_SmoothStepToF(&this->colorFilterG, 10.0f, 1, 20.0f, 0.0); - } else { - this->unk_1BE--; - Math_SmoothStepToF(&this->colorFilterR, 255.0f, 1, 20.0f, 0.0); - Math_SmoothStepToF(&this->colorFilterG, 0.0f, 1, 20.0f, 0.0); + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, true)) { + if (this->unk_1BE >= 1000) { + Math_SmoothStepToF(&this->colorFilterR, 30.0f, 1, 20.0f, 0.0); + Math_SmoothStepToF(&this->colorFilterG, 10.0f, 1, 20.0f, 0.0); + } else { + this->unk_1BE--; + Math_SmoothStepToF(&this->colorFilterR, 255.0f, 1, 20.0f, 0.0); + Math_SmoothStepToF(&this->colorFilterG, 0.0f, 1, 20.0f, 0.0); + } + + Math_SmoothStepToF(&this->colorFilterB, 0.0f, 1, 20.0f, 0.0); + Math_SmoothStepToF(&this->colorFilterMin, 900.0f, 1, 10.0f, 0.0); + Math_SmoothStepToF(&this->colorFilterMax, 1099.0f, 1, 10.0f, 0.0); } - - Math_SmoothStepToF(&this->colorFilterB, 0.0f, 1, 20.0f, 0.0); - Math_SmoothStepToF(&this->colorFilterMin, 900.0f, 1, 10.0f, 0.0); - Math_SmoothStepToF(&this->colorFilterMax, 1099.0f, 1, 10.0f, 0.0); } else { Math_SmoothStepToF(&this->colorFilterR, play->lightCtx.fogColor[0], 1, 5.0f, 0.0); Math_SmoothStepToF(&this->colorFilterG, play->lightCtx.fogColor[1], 1.0f, 5.0f, 0.0); diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 0644f73a829..b0718a600c7 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -1878,24 +1878,26 @@ void BossGoma_UpdateMainEnvColor(BossGoma* this) { { 0.0f, 255.0f, 170.0f }, { 0.0f, 0.0f, 255.0f }, { 255.0f, 17.0f, 0.0f }, }; - if (this->visualState == VISUALSTATE_DEFAULT && this->frameCount & 0x10) { - Math_ApproachF(&this->mainEnvColor[0], 50.0f, 0.5f, 20.0f); - Math_ApproachF(&this->mainEnvColor[1], 50.0f, 0.5f, 20.0f); - Math_ApproachF(&this->mainEnvColor[2], 50.0f, 0.5f, 20.0f); - } else if (this->invincibilityFrames != 0) { - if (this->invincibilityFrames & 2) { - this->mainEnvColor[0] = colors2[this->visualState][0]; - this->mainEnvColor[1] = colors2[this->visualState][1]; - this->mainEnvColor[2] = colors2[this->visualState][2]; - } else { - this->mainEnvColor[0] = colors1[this->visualState][0]; - this->mainEnvColor[1] = colors1[this->visualState][1]; - this->mainEnvColor[2] = colors1[this->visualState][2]; + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, true)) { + if (this->visualState == VISUALSTATE_DEFAULT && this->frameCount & 0x10) { + Math_ApproachF(&this->mainEnvColor[0], 50.0f, 0.5f, 20.0f); + Math_ApproachF(&this->mainEnvColor[1], 50.0f, 0.5f, 20.0f); + Math_ApproachF(&this->mainEnvColor[2], 50.0f, 0.5f, 20.0f); + } else if (this->invincibilityFrames != 0) { + if (this->invincibilityFrames & 2) { + this->mainEnvColor[0] = colors2[this->visualState][0]; + this->mainEnvColor[1] = colors2[this->visualState][1]; + this->mainEnvColor[2] = colors2[this->visualState][2]; + } else { + this->mainEnvColor[0] = colors1[this->visualState][0]; + this->mainEnvColor[1] = colors1[this->visualState][1]; + this->mainEnvColor[2] = colors1[this->visualState][2]; + } } } else { - Math_ApproachF(&this->mainEnvColor[0], colors1[this->visualState][0], 0.5f, 20.0f); - Math_ApproachF(&this->mainEnvColor[1], colors1[this->visualState][1], 0.5f, 20.0f); - Math_ApproachF(&this->mainEnvColor[2], colors1[this->visualState][2], 0.5f, 20.0f); + Math_ApproachF(&this->mainEnvColor[0], colors1[this->visualState][0], 0.5f, 20.0f); + Math_ApproachF(&this->mainEnvColor[1], colors1[this->visualState][1], 0.5f, 20.0f); + Math_ApproachF(&this->mainEnvColor[2], colors1[this->visualState][2], 0.5f, 20.0f); } } @@ -1982,8 +1984,10 @@ s32 BossGoma_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f if (this->eyeState == EYESTATE_IRIS_FOLLOW_BONUS_IFRAMES && this->eyeLidBottomRotX < -0xA8C) { *dList = NULL; } else if (this->invincibilityFrames != 0) { - gDPSetEnvColor(POLY_OPA_DISP++, (s16)(Rand_ZeroOne() * 255.0f), (s16)(Rand_ZeroOne() * 255.0f), - (s16)(Rand_ZeroOne() * 255.0f), 63); + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, true)) { + gDPSetEnvColor(POLY_OPA_DISP++, (s16)(Rand_ZeroOne() * 255.0f), (s16)(Rand_ZeroOne() * 255.0f), + (s16)(Rand_ZeroOne() * 255.0f), 63); + } } else { gDPSetEnvColor(POLY_OPA_DISP++, (s16)this->eyeEnvColor[0], (s16)this->eyeEnvColor[1], (s16)this->eyeEnvColor[2], 63); diff --git a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index c13833d6d93..0ed9504357c 100644 --- a/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/soh/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -7,6 +7,8 @@ #include "z_en_arrow.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_gi_nuts/object_gi_nuts.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) @@ -315,7 +317,10 @@ void EnArrow_Fly(EnArrow* this, PlayState* play) { } if (this->actor.params == ARROW_NUT) { - iREG(50) = -1; + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, true)) { + iREG(50) = -1; + } + Actor_Spawn(&play->actorCtx, play, ACTOR_EN_M_FIRE1, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0, true); sfxId = NA_SE_IT_DEKU; diff --git a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c index 434556a5163..faa43ef20cf 100644 --- a/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c +++ b/soh/src/overlays/actors/ovl_En_Bom/z_en_bom.c @@ -8,6 +8,7 @@ #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #include #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED) @@ -320,10 +321,12 @@ void EnBom_Update(Actor* thisx, PlayState* play2) { this->flashSpeedScale >>= 1; } - if ((this->timer < 100) && ((this->timer & (this->flashSpeedScale + 1)) != 0)) { - Math_SmoothStepToF(&this->flashIntensity, 140.0f, 1.0f, 140.0f / this->flashSpeedScale, 0.0f); - } else { - Math_SmoothStepToF(&this->flashIntensity, 0.0f, 1.0f, 140.0f / this->flashSpeedScale, 0.0f); + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, false)) { + if ((this->timer < 100) && ((this->timer & (this->flashSpeedScale + 1)) != 0)) { + Math_SmoothStepToF(&this->flashIntensity, 140.0f, 1.0f, 140.0f / this->flashSpeedScale, 0.0f); + } else { + Math_SmoothStepToF(&this->flashIntensity, 0.0f, 1.0f, 140.0f / this->flashSpeedScale, 0.0f); + } } if (this->timer < 3) { diff --git a/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c b/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c index c265b3eb070..fb84a8894b4 100644 --- a/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c +++ b/soh/src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c @@ -1,6 +1,8 @@ #include "z_en_bom_chu.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED @@ -497,24 +499,25 @@ void EnBomChu_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); func_8002EBCC(&this->actor, play, 0); + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, false)) { + if (this->timer >= 40) { + blinkTime = this->timer % 20; + blinkHalfPeriod = 10; + } else if (this->timer >= 10) { + blinkTime = this->timer % 10; + blinkHalfPeriod = 5; + } else { + blinkTime = this->timer & 1; + blinkHalfPeriod = 1; + } - if (this->timer >= 40) { - blinkTime = this->timer % 20; - blinkHalfPeriod = 10; - } else if (this->timer >= 10) { - blinkTime = this->timer % 10; - blinkHalfPeriod = 5; - } else { - blinkTime = this->timer & 1; - blinkHalfPeriod = 1; - } + if (blinkTime > blinkHalfPeriod) { + blinkTime = 2 * blinkHalfPeriod - blinkTime; + } - if (blinkTime > blinkHalfPeriod) { - blinkTime = 2 * blinkHalfPeriod - blinkTime; + colorIntensity = blinkTime / (f32)blinkHalfPeriod; } - colorIntensity = blinkTime / (f32)blinkHalfPeriod; - if (CVarGetInteger(CVAR_COSMETIC("Equipment.ChuBody.Changed"), 0)) { Color_RGB8 color = CVarGetColor24(CVAR_COSMETIC("Equipment.ChuBody.Value"), (Color_RGB8){ 209.0f, 34.0f, -35.0f }); gDPSetEnvColor(POLY_OPA_DISP++, (colorIntensity * color.r), (colorIntensity * color.g), diff --git a/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c b/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c index 2eecc1fb3f7..eaa02a66fa8 100644 --- a/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c +++ b/soh/src/overlays/actors/ovl_En_Bombf/z_en_bombf.c @@ -7,6 +7,8 @@ #include "z_en_bombf.h" #include "objects/object_bombf/object_bombf.h" #include "overlays/effects/ovl_Effect_Ss_Dead_Sound/z_eff_ss_dead_sound.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UPDATE_WHILE_CULLED) @@ -396,10 +398,12 @@ void EnBombf_Update(Actor* thisx, PlayState* play) { this->flashSpeedScale >>= 1; } - if ((this->timer < 100) && ((this->timer & (this->flashSpeedScale + 1)) != 0)) { - Math_SmoothStepToF(&this->flashIntensity, 150.0f, 1.0f, 150.0f / this->flashSpeedScale, 0.0f); - } else { - Math_SmoothStepToF(&this->flashIntensity, 0.0f, 1.0f, 150.0f / this->flashSpeedScale, 0.0f); + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, false)) { + if ((this->timer < 100) && ((this->timer & (this->flashSpeedScale + 1)) != 0)) { + Math_SmoothStepToF(&this->flashIntensity, 150.0f, 1.0f, 150.0f / this->flashSpeedScale, 0.0f); + } else { + Math_SmoothStepToF(&this->flashIntensity, 0.0f, 1.0f, 150.0f / this->flashSpeedScale, 0.0f); + } } if (this->timer < 3) { diff --git a/soh/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c b/soh/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c index 9daa4f50114..9287630e3c5 100644 --- a/soh/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c +++ b/soh/src/overlays/actors/ovl_En_Okarina_Effect/z_en_okarina_effect.c @@ -6,6 +6,8 @@ #include "z_en_okarina_effect.h" #include "vt.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" #define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_NO_FREEZE_OCARINA) @@ -64,7 +66,9 @@ void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, PlayState* play) { if ((gWeatherMode != 0) || play->envCtx.unk_17 != 0) { play->envCtx.unk_DE = 1; } - play->envCtx.lightningMode = LIGHTNING_MODE_ON; + if (GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, true)) { + play->envCtx.lightningMode = LIGHTNING_MODE_ON; + } Environment_PlayStormNatureAmbience(play); EnOkarinaEffect_SetupAction(this, EnOkarinaEffect_ManageStorm); } diff --git a/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index f8b1cfd10d7..c088b297e0b 100644 --- a/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/soh/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -7,6 +7,9 @@ #include "z_en_weather_tag.h" #include "vt.h" +#include "soh/Enhancements/game-interactor/GameInteractor.h" +#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" + #define FLAGS ACTOR_FLAG_UPDATE_WHILE_CULLED void EnWeatherTag_Init(Actor* thisx, PlayState* play); @@ -324,6 +327,8 @@ void EnWeatherTag_EnabledRainThunder(EnWeatherTag* this, PlayState* play) { void EnWeatherTag_Update(Actor* thisx, PlayState* play) { EnWeatherTag* this = (EnWeatherTag*)thisx; + GameInteractor_Should(VB_ALLOW_FLASHING_LIGHTS, false); + this->actionFunc(this, play); if (BREG(0) != 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,