diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index 2048ead3168..31d2cffd065 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -226,6 +226,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! @@ -612,6 +653,8 @@ void InitMods() { RegisterFreezeTime(); RegisterSwitchAge(); RegisterOcarinaTimeTravel(); + RegisterJabuAsAdult(); + RegisterJabuTransitionAsAdult(); RegisterAutoSave(); RegisterDaytimeGoldSkultullas(); RegisterRupeeDash(); diff --git a/soh/soh/SohMenuBar.cpp b/soh/soh/SohMenuBar.cpp index 337a848e0ab..29cbe75facc 100644 --- a/soh/soh/SohMenuBar.cpp +++ b/soh/soh/SohMenuBar.cpp @@ -1190,6 +1190,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); 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 2bd4db7eb77..f851d4b46ac 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); }