diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 09704e867..ed3c6182e 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -3251,7 +3251,10 @@ void GenerateRandomizerImgui() { cvarSettings[RSK_CUCCO_COUNT] = CVar_GetS32("gRandomizeCuccosToReturn", 7); cvarSettings[RSK_BIG_POE_COUNT] = CVar_GetS32("gRandomizeBigPoeTargetCount", 10); - cvarSettings[RSK_SKIP_CHILD_STEALTH] = CVar_GetS32("gRandomizeSkipChildStealth", 0); + // If we skip child zelda, skip child stealth is pointless, so this needs to be reflected in the spoiler log + cvarSettings[RSK_SKIP_CHILD_STEALTH] = + !CVar_GetS32("gRandomizeSkipChildZelda", 0) && CVar_GetS32("gRandomizeSkipChildStealth", 0); + cvarSettings[RSK_SKIP_EPONA_RACE] = CVar_GetS32("gRandomizeSkipEponaRace", 0); cvarSettings[RSK_SKIP_TOWER_ESCAPE] = CVar_GetS32("gRandomizeSkipTowerEscape", 0); diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index a42fb2f78..ae8791bd4 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -273,11 +273,15 @@ void Gameplay_Init(GameState* thisx) { u8 tempSetupIndex; s32 pad[2]; - if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH)) { + // Skip Child Stealth when option is enabled, Zelda's Letter isn't obtained and Impa's reward hasn't been received + // eventChkInf[4] & 1 = Got Zelda's Letter + // eventChkInf[5] & 0x200 = Got Impa's reward + // entranceIndex 0x7A, Castle Courtyard - Day from crawlspace + // entranceIndex 0x400, Zelda's Courtyard + if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SKIP_CHILD_STEALTH) && + !(gSaveContext.eventChkInf[4] & 1) && !(gSaveContext.eventChkInf[5] & 0x200)) { if (gSaveContext.entranceIndex == 0x7A) { gSaveContext.entranceIndex = 0x400; - } else if (gSaveContext.entranceIndex == 0x296) { - gSaveContext.entranceIndex = 0x23D; } } diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 7670762c5..caf250a4a 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -790,12 +790,12 @@ void Sram_InitSave(FileChooseContext* fileChooseCtx) { gSaveContext.eventChkInf[1] |= (1 << 3); gSaveContext.eventChkInf[1] |= (1 << 4); + // Set "Got Zelda's Letter" flag. Also ensures Saria is back at SFM. TODO: Is this flag used for anything else? + gSaveContext.eventChkInf[4] |= 1; + // Got item from impa gSaveContext.eventChkInf[5] |= 0x200; - // make sure saria is at SFM - gSaveContext.eventChkInf[4] |= (1 << 0); - // set this at the end to ensure we always start with the letter // this is for the off chance we got the weird egg from impa (which should never happen) INV_CONTENT(ITEM_LETTER_ZELDA) = ITEM_LETTER_ZELDA; diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index d2d9fac4b..5a313a07f 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -112,14 +112,23 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) { } } + // eventChkInf[4] & 1 = Got Zelda's Letter + // eventChkInf[5] & 0x200 = Got item from impa + // eventChkInf[8] & 1 = Ocarina thrown in moat + bool metZelda = (gSaveContext.eventChkInf[4] & 1) && (gSaveContext.eventChkInf[5] & 0x200); + if (this->type != 5) { - if (((gSaveContext.dayTime < 0xB888) || IS_DAY) && (gSaveContext.n64ddFlag || !(gSaveContext.eventChkInf[8] & 1))) { + if ((gSaveContext.dayTime < 0xB888 || IS_DAY) && + ((!gSaveContext.n64ddFlag && !(gSaveContext.eventChkInf[8] & 1)) || + (gSaveContext.n64ddFlag && !metZelda))) { this->actionFunc = EnHeishi1_SetupWalk; } else { Actor_Kill(&this->actor); } } else { - if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || (!gSaveContext.n64ddFlag && (gSaveContext.eventChkInf[8] & 1))) { + if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || + (!gSaveContext.n64ddFlag && gSaveContext.eventChkInf[8] & 1) || + (gSaveContext.n64ddFlag && metZelda)) { this->actionFunc = EnHeishi1_SetupWaitNight; } else { Actor_Kill(&this->actor);