diff --git a/soh/soh/Enhancements/mods.cpp b/soh/soh/Enhancements/mods.cpp index f4b62363d4b..9590c44e4d7 100644 --- a/soh/soh/Enhancements/mods.cpp +++ b/soh/soh/Enhancements/mods.cpp @@ -641,18 +641,16 @@ void RegisterMirrorModeHandler() { f32 triforcePieceScale; void RegisterTriforceHunt() { - static int eventTimer = -1; GameInteractor::Instance->RegisterGameHook([]() { Player* player = GET_PLAYER(gPlayState); uint8_t currentPieces = gSaveContext.triforcePiecesCollected; uint8_t requiredPieces = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); - + if (!GameInteractor::IsGameplayPaused() && OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT)) { // Warp to credits if (GameInteractor::State::TriforceHuntCreditsWarpActive) { - eventTimer = 1; GameInteractor::State::TriforceHuntCreditsWarpActive = 0; } @@ -666,52 +664,58 @@ void RegisterTriforceHunt() { GameInteractor::State::TriforceHuntPieceGiven = 0; } } - - if (currentPieces >= requiredPieces && eventTimer >= 1 && eventTimer <= 30) { - eventTimer++; - } else if (eventTimer > 30 && eventTimer <= 31) { - gPlayState->nextEntranceIndex = 0xDB; - gSaveContext.nextCutsceneIndex = 0x8000; - gPlayState->sceneLoadFlag = 0x14; - gPlayState->fadeTransition = 3; - eventTimer = 32; - } - - if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE && eventTimer == 32) { - player->actor.world.pos.x = -1441.043; - player->actor.world.pos.y = 55.037; - player->actor.world.pos.z = 578.224; - player->actor.shape.rot.x = 0; - player->actor.shape.rot.y = 17681; - player->actor.shape.rot.z = 0; - - GameInteractor::State::NoUIActive = 1; - Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_END_TITLE, 0, 0, 0, 0, 0, 0, 2, false); - eventTimer = 33; - } - }); - GameInteractor::Instance->RegisterGameHook([]() { - if (!gPlayState) { - return; - } - Player* player = GET_PLAYER(gPlayState); - if (eventTimer == 33) { - player->actor.freezeTimer = 60; - } - - }); + } void RegisterGrantGanonsBossKey() { + static uint16_t eventTimer = -1; GameInteractor::Instance->RegisterGameHook([]() { + Player* player = GET_PLAYER(gPlayState); + Actor* aplayer = &GET_PLAYER(gPlayState)->actor; // Triforce Hunt needs the check if the player isn't being teleported to the credits scene. if (!GameInteractor::IsGameplayPaused() && Flags_GetRandomizerInf(RAND_INF_GRANT_GANONS_BOSSKEY) && gPlayState->sceneLoadFlag != 0x14 && (1 << 0 & gSaveContext.inventory.dungeonItems[SCENE_GANONS_TOWER]) == 0) { GetItemEntry getItemEntry = ItemTableManager::Instance->RetrieveItemEntry(MOD_RANDOMIZER, RG_GANONS_CASTLE_BOSS_KEY); GiveItemEntryWithoutActor(gPlayState, getItemEntry); + if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE) { + eventTimer = 0; + } else { + eventTimer = 1; + } + } + + if (!GameInteractor::IsGameplayPaused() && gSaveContext.inventory.dungeonItems[SCENE_GANONS_TOWER] > 0 + && eventTimer == 0) { + eventTimer = 1; + } + if (eventTimer >= 1 && eventTimer <= 3) { + eventTimer++; + } + if (eventTimer == 4) { + if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE) { + player->actor.world.pos.x = -929.336; + player->actor.world.pos.y = 0; + player->actor.world.pos.z = 446.178; + player->actor.shape.rot.x = 0; + player->actor.shape.rot.y = 17537; + player->actor.shape.rot.z = 0; + GameInteractor::State::NoUIActive = 1; + + if (!Actor_FindNearby(gPlayState, aplayer, ACTOR_END_TITLE, ACTORCAT_ITEMACTION, 1000)) { + //Actor_Spawn(&gPlayState->actorCtx, gPlayState, ACTOR_END_TITLE, 0, 0, 0, 0, 0, 0, 2, false); + } + + player->stateFlags1 = PLAYER_STATE1_INPUT_DISABLED; + } else { + eventTimer = 5; + } + } + if (eventTimer == 5) { + eventTimer = -1; + GameInteractor::State::NoUIActive = 0; } }); } diff --git a/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c b/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c index 9d9f65190b0..3e2bb53c6b9 100644 --- a/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c +++ b/soh/src/overlays/actors/ovl_En_ChristmasTree/z_en_christmastree.c @@ -50,6 +50,8 @@ void EnChristmasTree_Init(Actor* thisx, PlayState* play) { this->actor.targetMode = 1; this->actor.textId = 0x406B; // Hijacking bean seller text ID so I'm sure it doesn't clash + this->actor.shape.rot.y = -14784; + this->actionFunc = EnChristmasTree_Wait; } diff --git a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index e257a184d8b..13c1b3edf56 100644 --- a/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/soh/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -173,14 +173,16 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { f32 floorY; s16 extraRot; - if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE && this->actor.params <= WOOD_TREE_KAKARIKO_ADULT) { - Actor_Kill(this); - } + if (Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT) == 1) { + if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE && this->actor.params <= WOOD_TREE_KAKARIKO_ADULT) { + Actor_Kill(this); + } - if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE && this->actor.params >= 0) { - this->actor.world.pos.x = 754.051; - this->actor.world.pos.y = 80.0; - this->actor.world.pos.z = 1429.908; + if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE && this->actor.params >= 0) { + this->actor.world.pos.x = 754.051; + this->actor.world.pos.y = 80.0; + this->actor.world.pos.z = 1429.908; + } } // The tree in Kakariko's day scene does not have the same params to spawn the GS diff --git a/soh/src/overlays/actors/ovl_End_Title/z_end_title.c b/soh/src/overlays/actors/ovl_End_Title/z_end_title.c index 1e21dad90cd..f497b7af960 100644 --- a/soh/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/soh/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -107,12 +107,12 @@ void EndTitle_DrawFull(Actor* thisx, PlayState* play) { gDPLoadTextureTile(OVERLAY_DISP++, sOcarinaOfTimeTex, G_IM_FMT_IA, G_IM_SIZ_8b, 112, 16, 0, 0, 112 - 1, 16 - 1, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); gSPTextureRectangle(OVERLAY_DISP++, 104 << 2, 177 << 2, 216 << 2, 192 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - D_801614B0.a = 255; - D_801614B0.r = 205; - D_801614B0.g = 168; - D_801614B0.b = 130; + D_801614B0.a = 0; + //D_801614B0.r = 205; + //D_801614B0.g = 168; + //D_801614B0.b = 130; - gSPGrayscale(OVERLAY_DISP++, true); + //gSPGrayscale(OVERLAY_DISP++, true); } else { if (D_801614B0.a > 0)