From 7f4bd3e98c4c2093e7c45d1a39ef3c054c10bbf8 Mon Sep 17 00:00:00 2001 From: Pepper0ni <93387759+Pepper0ni@users.noreply.github.com> Date: Sat, 26 Oct 2024 01:51:50 +0100 Subject: [PATCH] Fix any dungeon location pool and fire boss door logic (#4480) * fix any dungeon location pool and fire boss door logic * Make GetDungeonLocations consistent * add All to name --- .../Enhancements/randomizer/3drando/fill.cpp | 3 +-- .../location_access/locacc_fire_temple.cpp | 4 ++-- soh/soh/Enhancements/randomizer/context.cpp | 4 +--- .../Enhancements/randomizer/location_list.cpp | 19 ++++++++----------- soh/soh/Enhancements/randomizer/static_data.h | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/3drando/fill.cpp b/soh/soh/Enhancements/randomizer/3drando/fill.cpp index 01e6cffee..5bfa5aea1 100644 --- a/soh/soh/Enhancements/randomizer/3drando/fill.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/fill.cpp @@ -1041,8 +1041,7 @@ static void RandomizeDungeonItems() { auto ctx = Rando::Context::GetInstance(); //Get Any Dungeon and Overworld group locations - std::vector anyDungeonLocations = Rando::StaticData::GetDungeonLocations(); - //Rando::StaticData::GetOverworldLocations() defined in item_location.cpp + std::vector anyDungeonLocations = Rando::StaticData::GetAllDungeonLocations(); //Create Any Dungeon and Overworld item pools std::vector anyDungeonItems; diff --git a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_fire_temple.cpp b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_fire_temple.cpp index 07aad486c..b0ece5e7b 100644 --- a/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_fire_temple.cpp +++ b/soh/soh/Enhancements/randomizer/3drando/location_access/locacc_fire_temple.cpp @@ -404,9 +404,9 @@ void RegionTable_Init_FireTemple() { //Exits Entrance(RR_FIRE_TEMPLE_MQ_FIRST_ROOM_UPPER, {[]{return true;}}), Entrance(RR_FIRE_TEMPLE_BOSS_ENTRYWAY, {[]{return logic->HasItem(RG_FIRE_TEMPLE_BOSS_KEY) && logic->FireTimer() >= 15 && - (logic->IsAdult && (ctx->GetTrickOption(RT_FIRE_BOSS_DOOR_JUMP) || logic->CanUse(RG_HOVER_BOOTS))) || + ((logic->IsAdult && (ctx->GetTrickOption(RT_FIRE_BOSS_DOOR_JUMP) || logic->CanUse(RG_HOVER_BOOTS))) || (logic->IsAdult && logic->HitFireTemplePlatform) || - (logic->HitFireTemplePlatform && logic->CanUse(RG_HOVER_BOOTS)) + (logic->HitFireTemplePlatform && logic->CanUse(RG_HOVER_BOOTS))) ;}}), }); diff --git a/soh/soh/Enhancements/randomizer/context.cpp b/soh/soh/Enhancements/randomizer/context.cpp index 04d4271ce..e0c269057 100644 --- a/soh/soh/Enhancements/randomizer/context.cpp +++ b/soh/soh/Enhancements/randomizer/context.cpp @@ -136,9 +136,7 @@ void Context::GenerateLocationPool() { AddLocations(mFishsanity->GetFishsanityLocations().first); } - for (const auto dungeon : mDungeons->GetDungeonList()) { - AddLocations(dungeon->GetDungeonLocations()); - } + AddLocations(StaticData::GetAllDungeonLocations()); } void Context::AddExcludedOptions() { diff --git a/soh/soh/Enhancements/randomizer/location_list.cpp b/soh/soh/Enhancements/randomizer/location_list.cpp index bc7eb2702..cdfd88680 100644 --- a/soh/soh/Enhancements/randomizer/location_list.cpp +++ b/soh/soh/Enhancements/randomizer/location_list.cpp @@ -1,6 +1,7 @@ #include "static_data.h" #include "z64save.h" #include "context.h" +#include "dungeon.h" #define TWO_ACTOR_PARAMS(a, b) (abs(a) << 16) | abs(b) @@ -117,18 +118,14 @@ std::vector Rando::StaticData::GetOverworldLocations() { return overworldLocations; } -std::vector Rando::StaticData::GetDungeonLocations() { - std::vector overworldLocations = {}; - for (Location& location : locationTable) { - if ( - location.IsDungeon() && - location.GetRCType() != RCTYPE_STATIC_HINT && - location.GetRCType() != RCTYPE_GOSSIP_STONE //don't put items on hints - ) { - overworldLocations.push_back(location.GetRandomizerCheck()); - } +std::vector Rando::StaticData::GetAllDungeonLocations() { + auto ctx = Rando::Context::GetInstance(); + std::vector dungeonLocations; + for (const auto dungeon : ctx->GetDungeons()->GetDungeonList()) { + std::vector dungeonLoc = dungeon->GetDungeonLocations(); + dungeonLocations.insert(dungeonLocations.end(), dungeonLoc.begin(), dungeonLoc.end()); } - return overworldLocations; + return dungeonLocations; } void Rando::StaticData::InitLocationTable() { // Randomizer Check Quest Type Area Actor ID Scene ID Params Flags Short Name Hint Text Key Vanilla Item Spoiler Collection Check Vanilla Progression Price diff --git a/soh/soh/Enhancements/randomizer/static_data.h b/soh/soh/Enhancements/randomizer/static_data.h index 78ec5e118..5ff0f1d26 100644 --- a/soh/soh/Enhancements/randomizer/static_data.h +++ b/soh/soh/Enhancements/randomizer/static_data.h @@ -36,7 +36,7 @@ class StaticData { static std::unordered_map PopulateTranslationMap(std::unordered_map input); static std::multimap, RandomizerCheck> CheckFromActorMultimap; static std::vector GetOverworldLocations(); - static std::vector GetDungeonLocations(); + static std::vector GetAllDungeonLocations(); static std::vector dungeonRewardLocations; static std::vector GetShopLocations(); static std::vector GetScrubLocations();