From 1014130f27310dc078064b86f628cdd329798a4c Mon Sep 17 00:00:00 2001 From: Caladius Date: Thu, 6 Jun 2024 13:59:32 -0400 Subject: [PATCH] Spawns a torch for Link to get into the Bottom of the Well as an adult. --- soh/soh/Enhancements/mods.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 9a3988e39a5..bb3719f26fb 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -27,6 +27,8 @@ #include "objects/object_link_boy/object_link_boy.h" #include "objects/object_link_child/object_link_child.h" +#include "overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.h" + extern "C" { #include #include "align_asset_macro.h" @@ -1394,6 +1396,31 @@ void RegisterPauseMenuHooks() { }); } +void RegisterAdultBotW() { + static int spawnTimer = -1; + GameInteractor::Instance->RegisterGameHook([](int16_t sceneNum) { + if (gPlayState == NULL) { + return; + } + if (gPlayState->sceneNum == SCENE_BOTTOM_OF_THE_WELL) { + spawnTimer = 60; + } + }); + GameInteractor::Instance->RegisterGameHook([]() { + if (gPlayState == NULL) { + return; + } + if (spawnTimer == 0) { + //GameInteractor::RawAction::SpawnActor(ACTOR_OBJ_SYOKUDAI, 666); + Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_OBJ_SYOKUDAI, 58.345, 240, 1158.064, 0, 0, 0, 0, false); + spawnTimer = -1; + } else if (spawnTimer > 0) { + spawnTimer--; + } + }); + +} + void InitMods() { RegisterTTS(); RegisterInfiniteMoney(); @@ -1433,4 +1460,5 @@ void InitMods() { RegisterPatchHandHandler(); RegisterHurtContainerModeHandler(); RegisterPauseMenuHooks(); + RegisterAdultBotW(); }