diff --git a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp index 46d039f9b..a2d2dbfe6 100644 --- a/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/item_pool.cpp @@ -670,7 +670,7 @@ void GenerateItemPool() { if (ctx->GetOption(RSK_TRIFORCE_HUNT)) { ctx->possibleIceTrapModels.push_back(RG_TRIFORCE_PIECE); - AddItemToMainPool(RG_TRIFORCE_PIECE, ctx->GetOption(RSK_TRIFORCE_HUNT_PIECES_TOTAL).Value()); + AddItemToMainPool(RG_TRIFORCE_PIECE, (ctx->GetOption(RSK_TRIFORCE_HUNT_PIECES_TOTAL).Value() + 1)); ctx->PlaceItemInLocation(RC_TRIFORCE_COMPLETED, RG_TRIFORCE); // Win condition ctx->PlaceItemInLocation(RC_GANON, GetJunkItem(), false, true); } else { @@ -685,14 +685,18 @@ void GenerateItemPool() { AddItemToMainPool(RG_KOKIRI_SWORD); ctx->possibleIceTrapModels.push_back(RG_KOKIRI_SWORD); } else { - ctx->PlaceItemInLocation(RC_KF_KOKIRI_SWORD_CHEST, RG_KOKIRI_SWORD, false, true); + if (!ctx->GetOption(RSK_STARTING_KOKIRI_SWORD)) { + ctx->PlaceItemInLocation(RC_KF_KOKIRI_SWORD_CHEST, RG_KOKIRI_SWORD, false, true); + } } if (ctx->GetOption(RSK_SHUFFLE_MASTER_SWORD)) { AddItemToMainPool(RG_MASTER_SWORD); ctx->possibleIceTrapModels.push_back(RG_MASTER_SWORD); //Master Sword without the GI enum } else { - ctx->PlaceItemInLocation(RC_TOT_MASTER_SWORD, RG_MASTER_SWORD, false, true); + if (!ctx->GetOption(RSK_STARTING_MASTER_SWORD)) { + ctx->PlaceItemInLocation(RC_TOT_MASTER_SWORD, RG_MASTER_SWORD, false, true); + } } if (ctx->GetOption(RSK_SHUFFLE_WEIRD_EGG)) { @@ -709,8 +713,14 @@ void GenerateItemPool() { } ctx->possibleIceTrapModels.push_back(RG_PROGRESSIVE_OCARINA); //Progressive ocarina } else { - ctx->PlaceItemInLocation(RC_LW_GIFT_FROM_SARIA, RG_PROGRESSIVE_OCARINA, false, true); - ctx->PlaceItemInLocation(RC_HF_OCARINA_OF_TIME_ITEM, RG_PROGRESSIVE_OCARINA, false, true); + if (ctx->GetOption(RSK_STARTING_OCARINA).Is(RO_STARTING_OCARINA_OFF)) { + ctx->PlaceItemInLocation(RC_LW_GIFT_FROM_SARIA, RG_PROGRESSIVE_OCARINA, false, true); + ctx->PlaceItemInLocation(RC_HF_OCARINA_OF_TIME_ITEM, RG_PROGRESSIVE_OCARINA, false, true); + } else { + if (ctx->GetOption(RSK_STARTING_OCARINA).IsNot(RO_STARTING_OCARINA_TIME)) { + ctx->PlaceItemInLocation(RC_HF_OCARINA_OF_TIME_ITEM, RG_PROGRESSIVE_OCARINA, false, true); + } + } } if (ctx->GetOption(RSK_SHUFFLE_COWS)) { diff --git a/soh/soh/Enhancements/randomizer/3drando/logic.cpp b/soh/soh/Enhancements/randomizer/3drando/logic.cpp index 709f49cc4..99eb71da3 100644 --- a/soh/soh/Enhancements/randomizer/3drando/logic.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/logic.cpp @@ -668,7 +668,7 @@ namespace Logic { (ctx->GetSettings()->LACSCondition() == RO_LACS_REWARDS && StoneCount + MedallionCount + (Greg && GregInLacsLogic ? 1 : 0) >= ctx->GetOption(RSK_LACS_REWARD_COUNT).Value()) || (ctx->GetSettings()->LACSCondition() == RO_LACS_DUNGEONS && DungeonCount + (Greg && GregInLacsLogic ? 1 : 0) >= ctx->GetOption(RSK_LACS_DUNGEON_COUNT).Value()) || (ctx->GetSettings()->LACSCondition() == RO_LACS_TOKENS && GoldSkulltulaTokens >= ctx->GetOption(RSK_LACS_TOKEN_COUNT).Value()); - CanCompleteTriforce = TriforcePieces >= ctx->GetOption(RSK_TRIFORCE_HUNT_PIECES_REQUIRED).Value(); + CanCompleteTriforce = TriforcePieces >= ctx->GetOption(RSK_TRIFORCE_HUNT_PIECES_REQUIRED).Value() + 1; } bool SmallKeys(RandomizerRegion dungeon, uint8_t requiredAmount) { diff --git a/soh/soh/Enhancements/randomizer/draw.cpp b/soh/soh/Enhancements/randomizer/draw.cpp index 5c3b32585..43f7129ab 100644 --- a/soh/soh/Enhancements/randomizer/draw.cpp +++ b/soh/soh/Enhancements/randomizer/draw.cpp @@ -240,7 +240,7 @@ extern "C" void Randomizer_DrawTriforcePieceGI(PlayState* play, GetItemEntry get Gfx_SetupDL_25Xlu(play->state.gfxCtx); uint8_t current = gSaveContext.triforcePiecesCollected; - uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); + uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) + 1; Matrix_Scale(triforcePieceScale, triforcePieceScale, triforcePieceScale, MTXMODE_APPLY); diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index 2d843be29..3de001e15 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -2722,7 +2722,7 @@ void CreateTriforcePieceMessages() { CustomMessage Randomizer::GetTriforcePieceMessage() { // Item is only given after the textbox, so reflect that inside the textbox. uint8_t current = gSaveContext.triforcePiecesCollected + 1; - uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); + uint8_t required = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) + 1; uint8_t remaining = required - current; float percentageCollected = (float)current / (float)required; uint8_t messageIndex; diff --git a/soh/soh/Enhancements/randomizer/randomizerTypes.h b/soh/soh/Enhancements/randomizer/randomizerTypes.h index b73430369..14954fe11 100644 --- a/soh/soh/Enhancements/randomizer/randomizerTypes.h +++ b/soh/soh/Enhancements/randomizer/randomizerTypes.h @@ -3749,6 +3749,7 @@ typedef enum { typedef enum { RO_STARTING_OCARINA_OFF, RO_STARTING_OCARINA_FAIRY, + RO_STARTING_OCARINA_TIME, } RandoOptionStartingOcarina; //Item Pool Settings diff --git a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp index e5e633e74..535e9b4ad 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer_item_tracker.cpp @@ -528,8 +528,8 @@ void DrawItemCount(ItemTrackerItem item) { std::string currentString = ""; std::string requiredString = ""; std::string maxString = ""; - uint8_t piecesRequired = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED); - uint8_t piecesTotal = OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_TOTAL); + uint8_t piecesRequired = (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) + 1); + uint8_t piecesTotal = (OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(RSK_TRIFORCE_HUNT_PIECES_TOTAL) + 1); ImU32 currentColor = gSaveContext.triforcePiecesCollected >= piecesRequired ? IM_COL_GREEN : IM_COL_WHITE; ImU32 maxColor = IM_COL_GREEN; int32_t trackerTriforcePieceNumberDisplayMode = CVarGetInteger("gItemTrackerTriforcePieceTrack", TRIFORCE_PIECE_COLLECTED_REQUIRED_MAX); diff --git a/soh/soh/Enhancements/randomizer/savefile.cpp b/soh/soh/Enhancements/randomizer/savefile.cpp index f535a0a20..b82c7a0d1 100644 --- a/soh/soh/Enhancements/randomizer/savefile.cpp +++ b/soh/soh/Enhancements/randomizer/savefile.cpp @@ -357,7 +357,7 @@ extern "C" void Randomizer_InitSaveFile() { Flags_SetRandomizerInf(RAND_INF_TOT_MASTER_SWORD); } - HIGH_SCORE(HS_POE_POINTS) = 1000 - (100 * Randomizer_GetSettingValue(RSK_BIG_POE_COUNT)); + HIGH_SCORE(HS_POE_POINTS) = 1000 - (100 * (Randomizer_GetSettingValue(RSK_BIG_POE_COUNT) + 1)); if (Randomizer_GetSettingValue(RSK_SKIP_EPONA_RACE)) { Flags_SetEventChkInf(EVENTCHKINF_EPONA_OBTAINED); diff --git a/soh/soh/Enhancements/randomizer/settings.cpp b/soh/soh/Enhancements/randomizer/settings.cpp index 118f86709..bcda40dcc 100644 --- a/soh/soh/Enhancements/randomizer/settings.cpp +++ b/soh/soh/Enhancements/randomizer/settings.cpp @@ -1406,24 +1406,6 @@ void Settings::UpdateOptionProperties() { mOptions[RSK_MIX_INTERIOR_ENTRANCES].Hide(); mOptions[RSK_MIX_GROTTO_ENTRANCES].Hide(); } - // Shuffle Kokiri Sword - Disabled when Start with Kokiri Sword is active - if (CVarGetInteger("gRandomizeStartingKokiriSword", RO_GENERIC_OFF)) { - mOptions[RSK_SHUFFLE_KOKIRI_SWORD].Disable("This option is disabled because \"Start with Kokiri Sword\" is enabled."); - } else { - mOptions[RSK_SHUFFLE_KOKIRI_SWORD].Enable(); - } - // Shuffle Master Sword - Disabled when Start with Master Sword is active - if (CVarGetInteger("gRandomizeStartingMasterSword", RO_GENERIC_OFF)) { - mOptions[RSK_SHUFFLE_MASTER_SWORD].Disable("This option is disabled because \"Start with Master Sword\" is enabled"); - } else { - mOptions[RSK_SHUFFLE_MASTER_SWORD].Enable(); - } - // Shuffle Ocarinas - Disabled when Start with Ocarina is active - if (CVarGetInteger("gRandomizeStartingOcarina", RO_STARTING_OCARINA_OFF)) { - mOptions[RSK_SHUFFLE_OCARINA].Disable("This option is disabled because \"Start with Fairy Ocarina\" is enabled."); - } else { - mOptions[RSK_SHUFFLE_OCARINA].Enable(); - } // Shuffle Weird Egg - Disabled when Skip Child Zelda is active if (CVarGetInteger("gRandomizeSkipChildZelda", RO_GENERIC_DONT_SKIP)) { mOptions[RSK_SHUFFLE_WEIRD_EGG].Disable("This option is disabled because \"Skip Child Zelda\" is enabled."); @@ -1497,7 +1479,7 @@ void Settings::UpdateOptionProperties() { mOptions[RSK_KEYRINGS_GERUDO_FORTRESS].Enable(); } if (CVarGetInteger("gRandomizeTriforceHunt", RO_GENERIC_OFF)) { - mOptions[RSK_GANONS_BOSS_KEY].Disable("This option is disabled because Triforcce Hunt is enabled." + mOptions[RSK_GANONS_BOSS_KEY].Disable("This option is disabled because Triforce Hunt is enabled." "Ganon's Boss key\nwill instead be given to you after Triforce Hunt completion."); } else { mOptions[RSK_GANONS_BOSS_KEY].Enable(); @@ -1678,21 +1660,6 @@ void Settings::FinalizeSettings(const std::set& excludedLocatio mOptions[RSK_MQ_DUNGEON_SET].SetSelectedIndex(RO_GENERIC_OFF); } - // TODO: Historically we have forced the shuffle settings off when we have the corresponding start - // with setting on, but 3drando doesn't seem to actually do that. It seems like you can both shuffle - // them in the pool and start with them. - if (mOptions[RSK_STARTING_KOKIRI_SWORD]) { - mOptions[RSK_SHUFFLE_KOKIRI_SWORD].SetSelectedIndex(RO_GENERIC_OFF); - } - - if (mOptions[RSK_STARTING_MASTER_SWORD]) { - mOptions[RSK_SHUFFLE_MASTER_SWORD].SetSelectedIndex(RO_GENERIC_OFF); - } - - if (mOptions[RSK_STARTING_OCARINA].IsNot(RO_STARTING_OCARINA_OFF)) { - mOptions[RSK_SHUFFLE_OCARINA].SetSelectedIndex(RO_GENERIC_OFF); - } - // If any of the individual shuffle settings are on, turn on the main Shuffle Entrances option if (mOptions[RSK_SHUFFLE_DUNGEON_ENTRANCES].IsNot(RO_DUNGEON_ENTRANCE_SHUFFLE_OFF) || mOptions[RSK_SHUFFLE_BOSS_ENTRANCES].IsNot(RO_BOSS_ROOM_ENTRANCE_SHUFFLE_OFF) @@ -1719,6 +1686,24 @@ void Settings::FinalizeSettings(const std::set& excludedLocatio for (const auto randomizerTrick : enabledTricks) { mTrickOptions[randomizerTrick].SetSelectedIndex(1); } + if (!mOptions[RSK_SHUFFLE_KOKIRI_SWORD]) { + if (mOptions[RSK_STARTING_KOKIRI_SWORD]) { + ctx->GetItemLocation(RC_KF_KOKIRI_SWORD_CHEST)->GetExcludedOption()->SetSelectedIndex(1); + } + } + if (!mOptions[RSK_SHUFFLE_MASTER_SWORD]) { + if (mOptions[RSK_STARTING_MASTER_SWORD]) { + ctx->GetItemLocation(RC_MASTER_SWORD_PEDESTAL)->GetExcludedOption()->SetSelectedIndex(1); + } + } + if (!mOptions[RSK_SHUFFLE_OCARINA]) { + if (mOptions[RSK_STARTING_OCARINA].IsNot(RO_STARTING_OCARINA_OFF)) { + ctx->GetItemLocation(RC_LW_GIFT_FROM_SARIA)->GetExcludedOption()->SetSelectedIndex(1); + if (mOptions[RSK_STARTING_OCARINA].Is(RO_STARTING_OCARINA_TIME)) { + ctx->GetItemLocation(RC_HF_OCARINA_OF_TIME_ITEM)->GetExcludedOption()->SetSelectedIndex(1); + } + } + } } // RANDOTODO implement chest shuffle with keysanity diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 67405d226..e9626c068 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2612,7 +2612,7 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { GameInteractor_SetTriforceHuntPieceGiven(true); // Teleport to credits when goal is reached. - if (gSaveContext.triforcePiecesCollected == Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED)) { + if (gSaveContext.triforcePiecesCollected == (Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) + 1)) { gSaveContext.sohStats.itemTimestamp[TIMESTAMP_TRIFORCE_COMPLETED] = GAMEPLAYSTAT_TOTAL_TIME; gSaveContext.sohStats.gameComplete = 1; Flags_SetRandomizerInf(RAND_INF_GRANT_GANONS_BOSSKEY); diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index d6c84e355..f9b3e7cf4 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -2362,7 +2362,7 @@ void Play_PerformSave(PlayState* play) { uint8_t triforceHuntCompleted = IS_RANDO && - gSaveContext.triforcePiecesCollected == Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) && + gSaveContext.triforcePiecesCollected == (Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT_PIECES_REQUIRED) + 1) && Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT); if (CVarGetInteger("gAutosave", AUTOSAVE_OFF) != AUTOSAVE_OFF || triforceHuntCompleted) { Overlay_DisplayText(3.0f, "Game Saved");