From 8e6e8329771d2fe1ea7430f53d63551a9020fffa Mon Sep 17 00:00:00 2001 From: Fenhl Date: Sat, 25 Nov 2023 23:43:51 +0000 Subject: [PATCH] Fix build_world_graphs for per-world settings --- Main.py | 6 +++--- Plandomizer.py | 7 ++++--- version.py | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Main.py b/Main.py index 818eaeee0..bf0afdaba 100644 --- a/Main.py +++ b/Main.py @@ -130,7 +130,7 @@ def build_world_graphs(world_settings: list[Settings]) -> list[World]: logger.info('Creating Overworld') # Load common json rule files (those used regardless of MQ status) - if settings.logic_rules == 'glitched': + if world.settings.logic_rules == 'glitched': path = 'Glitched World' else: path = 'World' @@ -143,7 +143,7 @@ def build_world_graphs(world_settings: list[Settings]) -> list[World]: savewarps_to_connect += world.create_dungeons() world.create_internal_locations() - if settings.shopsanity != 'off': + if world.settings.shopsanity != 'off': world.random_shop_prices() world.set_scrub_prices() @@ -157,7 +157,7 @@ def build_world_graphs(world_settings: list[Settings]) -> list[World]: if world.settings.shuffle_dungeon_rewards in ('vanilla', 'reward'): world.fill_bosses() - if settings.triforce_hunt: + if any(world.settings.triforce_hunt for world in worlds): settings.distribution.configure_triforce_hunt(worlds) logger.info('Setting Entrances.') diff --git a/Plandomizer.py b/Plandomizer.py index 0ecd27652..8c40d16cc 100644 --- a/Plandomizer.py +++ b/Plandomizer.py @@ -1224,9 +1224,10 @@ def configure_triforce_hunt(self, worlds: list[World]) -> None: #TODO add starting pieces from other skipped checks (Links Pocket, pre-completed dungeons) if world.skip_child_zelda and 'Song from Impa' in world.distribution.locations and world.distribution.locations['Song from Impa'].item == triforce_piece: total_starting_count += 1 - total_count += world.triforce_count - if world.settings.triforce_hunt_mode == 'ice_percent': #TODO instead of hardcoding Ice%, scan filled locations - total_count += 1 + if world.settings.triforce_hunt: + total_count += world.triforce_count_per_world + if world.settings.triforce_hunt_mode == 'ice_percent': #TODO instead of hardcoding Ice%, scan filled locations + total_count += 1 if total_starting_count >= world.triforce_goal: raise RuntimeError('Too many Triforce Pieces in starting items. There should be at most %d and there are %d.' % (world.triforce_goal - 1, total_starting_count)) diff --git a/version.py b/version.py index e7ea89ece..a2ecd3cfa 100644 --- a/version.py +++ b/version.py @@ -1,7 +1,7 @@ __version__ = '8.0.2' # This is a supplemental version number for branches based off of main dev. -supplementary_version = 5 +supplementary_version = 6 # Pick a unique identifier byte for your fork if you are intending to have a long-lasting branch. # This will be 0x00 for main releases and 0x01 for main dev.