Despawn Kakariko objects only when in Triforce Hunt Mode, clean up GBK event order.

Disabling End Title until that can be sorted.
This commit is contained in:
Caladius 2023-11-04 15:10:07 -04:00
commit 51459c2225
4 changed files with 57 additions and 49 deletions

View file

@ -641,7 +641,6 @@ void RegisterMirrorModeHandler() {
f32 triforcePieceScale;
void RegisterTriforceHunt() {
static int eventTimer = -1;
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnPlayerUpdate>([]() {
Player* player = GET_PLAYER(gPlayState);
uint8_t currentPieces = gSaveContext.triforcePiecesCollected;
@ -652,7 +651,6 @@ void RegisterTriforceHunt() {
// 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<GameInteractor::OnGameFrameUpdate>([]() {
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<GameInteractor::OnPlayerUpdate>([]() {
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;
}
});
}

View file

@ -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;
}

View file

@ -173,6 +173,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) {
f32 floorY;
s16 extraRot;
if (Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT) == 1) {
if (gPlayState->sceneNum == SCENE_KAKARIKO_VILLAGE && this->actor.params <= WOOD_TREE_KAKARIKO_ADULT) {
Actor_Kill(this);
}
@ -182,6 +183,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) {
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
// as the night scene, For the always spawn GS enhancement we apply the needed

View file

@ -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)