From e57c952deb93542aef21dee7d55fc6ee30430b38 Mon Sep 17 00:00:00 2001 From: gymnast86 Date: Sun, 21 Jun 2026 16:18:07 -0700 Subject: [PATCH] print required dungeons to spoiler log --- .../generator/logic/spoiler_log.cpp | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/dusk/randomizer/generator/logic/spoiler_log.cpp b/src/dusk/randomizer/generator/logic/spoiler_log.cpp index b5b470358a..651b21752a 100644 --- a/src/dusk/randomizer/generator/logic/spoiler_log.cpp +++ b/src/dusk/randomizer/generator/logic/spoiler_log.cpp @@ -65,19 +65,19 @@ namespace randomizer::logic::spoiler_log LogBasicInfo(spoilerLog, randomizer); // Gather worlds with starting inventories - std::list worldswithStartingInventories = {}; + std::list worldsWithStartingInventories = {}; for (const auto& world : worlds) { if (!world->GetStartingItemPool().empty()) { - worldswithStartingInventories.push_back(world.get()); + worldsWithStartingInventories.push_back(world.get()); } } // Print starting inventories if there are any - if (!worldswithStartingInventories.empty()) + if (!worldsWithStartingInventories.empty()) { spoilerLog << std::endl << "All Starting Items:" << std::endl; - for (const auto& world : worldswithStartingInventories) + for (const auto& world : worldsWithStartingInventories) { spoilerLog << " World " << world->GetID() << ":" << std::endl; for (const auto& item : world->GetStartingItemPool()) @@ -87,7 +87,31 @@ namespace randomizer::logic::spoiler_log } } - // TODO: Print required dungeons + // Gather worlds with required dungeons + std::list worldsWithRequiredDungeons = {}; + for (const auto& world : worlds) + { + for (const auto& [dungeonName, dungeon] : world->GetDungeonTable()) { + if (dungeon->IsRequired()) { + worldsWithRequiredDungeons.push_back(world.get()); + break; + } + } + } + // Print required dungeons if there are any + if (!worldsWithRequiredDungeons.empty()) + { + spoilerLog << std::endl << "Required Dungeons:" << std::endl; + for (const auto& world : worldsWithRequiredDungeons) + { + spoilerLog << " World " << world->GetID() << ":" << std::endl; + for (const auto& [dungeonName, dungeon] : world->GetDungeonTable()) { + if (dungeon->IsRequired()) { + spoilerLog << " - " << dungeonName << std::endl; + } + } + } + } // Get name lengths for pretty formatting size_t longestNameLength = 0;