diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp index 07ddbc6ed9..c1d7f603ff 100644 --- a/src/d/d_com_inf_game.cpp +++ b/src/d/d_com_inf_game.cpp @@ -2083,7 +2083,12 @@ BOOL dComIfGs_isStageTbox(int i_stageNo, int i_no) { } void dComIfGs_onStageSwitch(int i_stageNo, int i_no) { +#if TARGET_PC + // Avoid trying to get the save table if stag info is NULL + if (dComIfGp_getStageStagInfo() && i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#else if (i_stageNo == dStage_stagInfo_GetSaveTbl(dComIfGp_getStageStagInfo())) { +#endif dComIfGs_onSwitch(i_no, -1); } diff --git a/src/dusk/randomizer/data/items.yaml b/src/dusk/randomizer/data/items.yaml index ce5a83ad57..24ed0d4a42 100644 --- a/src/dusk/randomizer/data/items.yaml +++ b/src/dusk/randomizer/data/items.yaml @@ -546,6 +546,67 @@ Importance: Minor Id: 0x84 +- Name: Ordon Spring Portal + Importance: Major + Id: 0x14 + +- Name: South Faron Portal + Importance: Major + Id: 0x15 + +- Name: North Faron Portal + Importance: Major + Id: 0x3C + +- Name: Sacred Grove Portal + Importance: Major + Id: 0xBF + +- Name: Kakariko Gorge Portal + Importance: Major + Id: 0x4D + +- Name: Kakariko Village Portal + Importance: Major + Id: 0x4E + +- Name: Death Mountain Portal + Importance: Major + Id: 0x52 + +- Name: Bridge of Eldin Portal + Importance: Major + Id: 0xE8 + +- Name: Castle Town Portal + Importance: Major + Id: 0xB1 + +- Name: Upper Zoras River Portal + Importance: Major + Id: 0xF7 + +- Name: Zoras Domain Portal + Importance: Major + Id: 0x57 + +- Name: Lake Hylia Portal + Importance: Major + Id: 0x8F + +- Name: Gerudo Desert Portal + Importance: Major + Id: 0x3B + +- Name: Mirror Chamber Portal + Importance: Major + Id: 0xAE + +- Name: Snowpeak Portal + Importance: Major + Id: 0xAF + + # Dummy Items that are used to represent other logical states (for now) - Name: Game Beatable diff --git a/src/dusk/randomizer/logic/item_pool.cpp b/src/dusk/randomizer/logic/item_pool.cpp index da1ca96a6a..86460be90f 100644 --- a/src/dusk/randomizer/logic/item_pool.cpp +++ b/src/dusk/randomizer/logic/item_pool.cpp @@ -111,6 +111,22 @@ namespace randomizer::logic::item_pool {"Palace of Twilight Dungeon Map", 1}, {"Hyrule Castle Dungeon Map", 1}, + // Warp Portals + {"Ordon Spring Portal", 1}, + {"South Faron Portal", 1}, + {"North Faron Portal", 1}, + {"Kakariko Gorge Portal", 1}, + {"Kakariko Village Portal", 1}, + {"Death Mountain Portal", 1}, + {"Bridge of Eldin Portal", 1}, + {"Zoras Domain Portal", 1}, + {"Lake Hylia Portal", 1}, + {"Castle Town Portal", 1}, + {"Upper Zoras River Portal", 1}, + {"Snowpeak Portal", 1}, + {"Gerudo Desert Portal", 1}, + {"Mirror Chamber Portal", 1}, + // Junk we should always have {"Purple Rupee Links House", 1}, {"Green Rupee", 2}, @@ -352,6 +368,33 @@ namespace randomizer::logic::item_pool } } + // Handle warp portals + startingItems["Ordon Spring Portal"] = 1; + if (world->Setting("Faron Twilight Cleared") == "On") + { + startingItems["South Faron Portal"] = 1; + startingItems["North Faron Portal"] = 1; + } + + if (world->Setting("Eldin Twilight Cleared") == "On") + { + startingItems["Kakariko Gorge Portal"] = 1; + startingItems["Kakariko Village Portal"] = 1; + startingItems["Death Mountain Portal"] = 1; + } + + if (world->Setting("Lanayru Twilight Cleared") == "On") + { + startingItems["Zoras Domain Portal"] = 1; + startingItems["Lake Hylia Portal"] = 1; + startingItems["Castle Town Portal"] = 1; + } + + if (world->Setting("Snowpeak Does Not Require Reekfish Scent") == "On") + { + startingItems["Snowpeak Portal"] = 1; + } + // Add each item to the world's _startingItemPool and erase it from the regular _itemPool for (const auto& [itemName, count] : startingItems) { @@ -360,7 +403,7 @@ namespace randomizer::logic::item_pool { startingItemPool.push_back(item); } - randomizer::utility::container::Erase(itemPool, item, count); + utility::container::Erase(itemPool, item, count); } }