From 62607895bbd9dac51d67a8b3163ae729094f111c Mon Sep 17 00:00:00 2001 From: inspectredc Date: Tue, 6 Jun 2023 02:50:43 +0100 Subject: [PATCH 1/2] Jabu as adult --- soh/soh/Enhancements/mods.cpp | 43 +++++++++++++++++++++++++++++++++++ soh/soh/SohMenuBar.cpp | 2 ++ 2 files changed, 45 insertions(+) diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index e9fa86982f6..b76f3ffe999 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -221,6 +221,47 @@ void RegisterOcarinaTimeTravel() { }); } +void CreateSceneTransitionCylinder(s16 entranceIndex, Vec3f* entry, f32 radius, f32 yDiff) { + Player* player = GET_PLAYER(gPlayState); + if ((Math_Vec3f_DistXZ(entry, &player->actor.world.pos) < radius) && + (ABS(player->actor.world.pos.y - entry->y) < yDiff)) { + gPlayState->nextEntranceIndex = entranceIndex; + func_800994A0(gPlayState); + gPlayState->sceneLoadFlag = 0x14; + player->actor.speedXZ = 0.0f; + player->linearVelocity = 0.0f; + if (!func_800C0CB8(gPlayState)) { + Interface_ChangeAlpha(2); + } else { + Camera_ChangeSetting(Play_GetCamera(gPlayState, 0), CAM_SET_SCENE_TRANSITION); + } + } +} + +void RegisterJabuAsAdult() { + GameInteractor::Instance->RegisterGameHook([](int32_t sceneNum) { + if (CVarGetInteger("gJabuAsAdult", 0)) { + if (!gPlayState) return; + if (sceneNum == 89 && LINK_IS_ADULT) { + Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_EN_JJ, -700, -40, 1700, 0, 0x6F1D, 0, -1, false); + } + } + }); +} + +void RegisterJabuTransitionAsAdult() { + GameInteractor::Instance->RegisterGameHook([](void* refActor) { + if (CVarGetInteger("gJabuAsAdult", 0)) { + if (!gPlayState) return; + Actor* actor = static_cast(refActor); + if (actor->id == ACTOR_EN_JJ && LINK_IS_ADULT && gSaveContext.eventChkInf[3] & 0x400) { + static Vec3f adultEntry = {-750.0f, 0.0f, 1800.0f}; + CreateSceneTransitionCylinder(0x28, &adultEntry, 100.0f, 100.0f); + } + } + }); +} + void AutoSave(GetItemEntry itemEntry) { u8 item = itemEntry.itemId; // Don't autosave immediately after buying items from shops to prevent getting them for free! @@ -561,6 +602,8 @@ void InitMods() { RegisterFreezeTime(); RegisterSwitchAge(); RegisterOcarinaTimeTravel(); + RegisterJabuAsAdult(); + RegisterJabuTransitionAsAdult(); RegisterAutoSave(); RegisterDaytimeGoldSkultullas(); RegisterRupeeDash(); diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 18effbe8147..6072034a49c 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1137,6 +1137,8 @@ void DrawCheatsMenu() { UIWidgets::Tooltip("This syncs the ingame time with the real world time"); UIWidgets::PaddedEnhancementCheckbox("No ReDead/Gibdo Freeze", "gNoRedeadFreeze", true, false); UIWidgets::Tooltip("Prevents ReDeads and Gibdos from being able to freeze you with their scream"); + UIWidgets::PaddedEnhancementCheckbox("Jabu Jabu As Adult", "gJabuAsAdult", true, false); + UIWidgets::Tooltip("Jabu Jabu will appear in the back of Zora's Fountain as Adult"); { static int32_t betaQuestEnabled = CVarGetInteger("gEnableBetaQuest", 0); From 1ca87721393b8a5155ad68cecaa09a98dd12caa4 Mon Sep 17 00:00:00 2001 From: inspectredc Date: Sat, 10 Jun 2023 16:14:00 +0100 Subject: [PATCH 2/2] cant activate jabu cutscene as adult --- soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c index b0b56053069..0f0597e5c16 100644 --- a/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c +++ b/soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c @@ -200,7 +200,7 @@ void EnJj_WaitForFish(EnJj* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((Math_Vec3f_DistXZ(&feedingSpot, &player->actor.world.pos) < 300.0f) && - play->isPlayerDroppingFish(play)) { + play->isPlayerDroppingFish(play) && LINK_IS_CHILD) { this->cutsceneCountdownTimer = 100; EnJj_SetupAction(this, EnJj_BeginCutscene); }