Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions soh/soh/Enhancements/mods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GameInteractor::OnTransitionEnd>([](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<GameInteractor::OnActorUpdate>([](void* refActor) {
if (CVarGetInteger("gJabuAsAdult", 0)) {
if (!gPlayState) return;
Actor* actor = static_cast<Actor*>(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!
Expand Down Expand Up @@ -612,6 +653,8 @@ void InitMods() {
RegisterFreezeTime();
RegisterSwitchAge();
RegisterOcarinaTimeTravel();
RegisterJabuAsAdult();
RegisterJabuTransitionAsAdult();
RegisterAutoSave();
RegisterDaytimeGoldSkultullas();
RegisterRupeeDash();
Expand Down
2 changes: 2 additions & 0 deletions soh/soh/SohMenuBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion soh/src/overlays/actors/ovl_En_Jj/z_en_jj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down