fix mido blocking pathway when link has kokiri emerald (#2653)

This commit is contained in:
Adam Bird 2023-03-31 23:13:24 -04:00 committed by GitHub
parent 545bc21fbe
commit 0c43fe7e48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View File

@ -369,7 +369,7 @@ typedef enum {
#define EVENTCHKINF_16 0x16 #define EVENTCHKINF_16 0x16
#define EVENTCHKINF_EPONA_OBTAINED 0x18 #define EVENTCHKINF_EPONA_OBTAINED 0x18
#define EVENTCHKINF_1B 0x1B #define EVENTCHKINF_1B 0x1B
#define EVENTCHKINF_1C 0x1C #define EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH 0x1C
#define EVENTCHKINF_1D 0x1D #define EVENTCHKINF_1D 0x1D
#define EVENTCHKINF_1E 0x1E #define EVENTCHKINF_1E 0x1E
#define EVENTCHKINF_20 0x20 #define EVENTCHKINF_20 0x20

View File

@ -568,6 +568,8 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) {
if (gSaveContext.n64ddFlag) { if (gSaveContext.n64ddFlag) {
play->nextEntranceIndex = 0x0457; play->nextEntranceIndex = 0x0457;
gSaveContext.nextCutsceneIndex = 0; gSaveContext.nextCutsceneIndex = 0;
// Skip Mido complaining about dead Deku tree
Flags_SetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH);
} else { } else {
Item_Give(play, ITEM_KOKIRI_EMERALD); Item_Give(play, ITEM_KOKIRI_EMERALD);
play->nextEntranceIndex = 0xEE; play->nextEntranceIndex = 0xEE;

View File

@ -372,8 +372,11 @@ u16 EnMd_GetTextKokiriForest(PlayState* play, EnMd* this) {
this->unk_208 = 0; this->unk_208 = 0;
this->unk_209 = TEXT_STATE_NONE; this->unk_209 = TEXT_STATE_NONE;
// In rando, skip talking about the tree being dead so we can have the prompt sword and shield instead // In rando, skip talking about the tree being dead so we can have the prompt for sword and shield instead
if (!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) ||
(gSaveContext.n64ddFlag && Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) &&
Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) &&
!Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH))) {
return 0x1045; return 0x1045;
} }
@ -492,6 +495,7 @@ u8 EnMd_ShouldSpawn(EnMd* this, PlayState* play) {
} }
if (Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) && if (Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD) &&
Flags_GetEventChkInf(EVENTCHKINF_SPOKE_TO_MIDO_AFTER_DEKU_TREES_DEATH) &&
(Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) || (Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_ZELDAS_LETTER) ||
Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD))) { Flags_GetEventChkInf(EVENTCHKINF_OBTAINED_KOKIRI_EMERALD_DEKU_TREE_DEAD))) {
return play->sceneNum == SCENE_KOKIRI_HOME4 && !LINK_IS_ADULT; return play->sceneNum == SCENE_KOKIRI_HOME4 && !LINK_IS_ADULT;
@ -677,7 +681,8 @@ void EnMd_Init(Actor* thisx, PlayState* play) {
if (((play->sceneNum == SCENE_SPOT04) && !(gSaveContext.eventChkInf[0] & 0x10)) || if (((play->sceneNum == SCENE_SPOT04) && !(gSaveContext.eventChkInf[0] & 0x10)) ||
((play->sceneNum == SCENE_SPOT04) && (gSaveContext.eventChkInf[0] & 0x10) && ((play->sceneNum == SCENE_SPOT04) && (gSaveContext.eventChkInf[0] & 0x10) &&
CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) || ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) ||
(gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE)))) ||
((play->sceneNum == SCENE_SPOT10) && !(gSaveContext.eventChkInf[0] & 0x400))) { ((play->sceneNum == SCENE_SPOT10) && !(gSaveContext.eventChkInf[0] & 0x400))) {
this->actor.home.pos = this->actor.world.pos; this->actor.home.pos = this->actor.world.pos;
this->actionFunc = func_80AAB948; this->actionFunc = func_80AAB948;
@ -738,7 +743,9 @@ void func_80AAB948(EnMd* this, PlayState* play) {
} }
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) { if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) && if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) ||
gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) &&
Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
(play->sceneNum == SCENE_SPOT04)) { (play->sceneNum == SCENE_SPOT04)) {
play->msgCtx.msgMode = MSGMODE_PAUSED; play->msgCtx.msgMode = MSGMODE_PAUSED;
} }
@ -805,7 +812,9 @@ void func_80AABD0C(EnMd* this, PlayState* play) {
return; return;
} }
if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && !(gSaveContext.eventChkInf[1] & 0x1000) && if ((!gSaveContext.n64ddFlag && CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) ||
gSaveContext.n64ddFlag && Flags_GetRandomizerInf(RAND_INF_DUNGEONS_DONE_DEKU_TREE) &&
Flags_GetEventChkInf(EVENTCHKINF_SHOWED_MIDO_SWORD_SHIELD)) && !(gSaveContext.eventChkInf[1] & 0x1000) &&
(play->sceneNum == SCENE_SPOT04)) { (play->sceneNum == SCENE_SPOT04)) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
gSaveContext.eventChkInf[1] |= 0x1000; gSaveContext.eventChkInf[1] |= 0x1000;