From 09c967249f8c49cfae85dbafa5778e2226a9d94a Mon Sep 17 00:00:00 2001 From: Garrett Cox Date: Fri, 23 Feb 2024 14:06:27 -0600 Subject: [PATCH] More 1PC skips --- .../Enhancements/timesaver_hook_handlers.cpp | 29 +++++++++++-------- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h | 3 ++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/soh/soh/Enhancements/timesaver_hook_handlers.cpp b/soh/soh/Enhancements/timesaver_hook_handlers.cpp index 84b619ebe..84d95d7f0 100644 --- a/soh/soh/Enhancements/timesaver_hook_handlers.cpp +++ b/soh/soh/Enhancements/timesaver_hook_handlers.cpp @@ -20,6 +20,7 @@ extern "C" { #include "src/overlays/actors/ovl_En_Tk/z_en_tk.h" #include "src/overlays/actors/ovl_En_Fu/z_en_fu.h" #include "src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.h" +#include "src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h" extern SaveContext gSaveContext; extern PlayState* gPlayState; } @@ -88,7 +89,8 @@ void EnZl4_SkipToGivingZeldasLetter(EnZl4* enZl4, PlayState* play) { static int successChimeCooldown = 0; void RateLimitedSuccessChime() { if (successChimeCooldown == 0) { - func_80078884(NA_SE_SY_CORRECT_CHIME); + // Currently disabled, need to find a better way to do this, while being consistent with vanilla + // func_80078884(NA_SE_SY_CORRECT_CHIME); successChimeCooldown = 120; } } @@ -282,25 +284,31 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void* RateLimitedSuccessChime(); break; } - // case ACTOR_PLAYER: // This might cause issues + case ACTOR_BG_HIDAN_KOUSI: { + BgHidanKousi* switchActor = static_cast(opt); + BgHidanKousi_SetupAction(switchActor, func_80889C18); + *should = false; + RateLimitedSuccessChime(); + break; + } + case ACTOR_BG_HIDAN_FWBIG: { + *should = false; + break; + } case ACTOR_EN_TA: case ACTOR_DOOR_SHUTTER: + case ACTOR_BG_ICE_SHUTTER: + case ACTOR_OBJ_LIGHTSWITCH: case ACTOR_EN_BOX: case ACTOR_OBJ_SYOKUDAI: case ACTOR_OBJ_TIMEBLOCK: case ACTOR_EN_PO_SISTERS: - // Prop case ACTOR_OBJ_ICE_POLY: case ACTOR_BG_YDAN_MARUTA: case ACTOR_BG_SPOT18_SHUTTER: case ACTOR_BG_SPOT05_SOKO: case ACTOR_BG_SPOT18_BASKET: - // BG - // case ACTOR_BG_YDAN_SP: - // case ACTOR_BG_YDAN_HASI: - // case ACTOR_BG_DODOAGO: - // case ACTOR_BG_DDAN_KD: - // case ACTOR_BG_DDAN_JD: + case ACTOR_BG_HIDAN_CURTAIN: *should = false; RateLimitedSuccessChime(); break; @@ -684,14 +692,11 @@ void TimeSaverOnActorInitHandler(void* actorRef) { } if (actor->id == ACTOR_BG_SPOT02_OBJECTS && actor->params == 2) { - SPDLOG_INFO("Registering BG_SPOT02 hook"); bgSpot02UpdateHook = GameInteractor::Instance->RegisterGameHook([](void* innerActorRef) mutable { Actor* innerActor = static_cast(innerActorRef); if (innerActor->id == ACTOR_BG_SPOT02_OBJECTS && innerActor->params == 2 && (CVarGetInteger("gTimeSavers.SkipMiscInteractions", IS_RANDO))) { - SPDLOG_INFO("on update BG_SPOT02 hook"); BgSpot02Objects* bgSpot02 = static_cast(innerActorRef); if (bgSpot02->actionFunc == func_808ACC34) { - SPDLOG_INFO("BGspot02 OVERRIDDEN"); bgSpot02->actionFunc = func_808AC908; GameInteractor::Instance->UnregisterGameHook(bgSpot02UpdateHook); GameInteractor::Instance->UnregisterGameHook(bgSpot02KillHook); diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h b/soh/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h index fff8c4c53..1f3eb4161 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.h @@ -14,4 +14,7 @@ typedef struct BgHidanKousi { /* 0x0168 */ s16 unk_168; } BgHidanKousi; // size = 0x016C +void BgHidanKousi_SetupAction(BgHidanKousi* bgHidanKousi, BgHidanKousiActionFunc actionFunc); +void func_80889C18(BgHidanKousi* bgHidanKousi, PlayState* play); + #endif