diff --git a/Goals.py b/Goals.py index 47371eecd9..b6400235db 100644 --- a/Goals.py +++ b/Goals.py @@ -153,7 +153,7 @@ def replace_goal_names(worlds: list[World]) -> None: location for location in world.get_filled_locations() if location.type == 'Boss' - and (location.name != 'ToT Reward from Rauru' or not world.settings.skip_reward_from_rauru) + and (location.name != 'ToT Reward from Rauru' or world.settings.skip_reward_from_rauru == 'not_free') ] for category in world.goal_categories.values(): for goal in category.goals: diff --git a/ItemPool.py b/ItemPool.py index 052788de57..e76704df1c 100644 --- a/ItemPool.py +++ b/ItemPool.py @@ -7,6 +7,7 @@ from Item import Item, ItemInfo, ItemFactory from Location import DisableType +from LocationList import location_groups if TYPE_CHECKING: from Plandomizer import ItemPoolRecord @@ -549,6 +550,7 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]: # Use the vanilla items in the world's locations when appropriate. vanilla_items_processed = Counter() + rauru_random_location = None for location in world.get_locations(): if location.vanilla_item is None: continue @@ -810,11 +812,25 @@ def get_pool_core(world: World) -> tuple[list[str], dict[str, Item]]: if world.settings.shuffle_dungeon_rewards in ('vanilla', 'reward'): pass # handled in World.fill_bosses else: - shuffle_item = True + if world.settings.skip_reward_from_rauru != 'free_forced': + shuffle_item = True + else: + if world.settings.shuffle_dungeon_rewards in ('any_dungeon', 'overworld', 'anywhere'): + # Rauru is currently considered a "Boss" by location, may need to change this in the future. + boss_locations = location_groups['Boss'] + rauru_random_location: str = random.choice(boss_locations) + item = world.get_location(rauru_random_location).vanilla_item + world.push_item(location, ItemFactory(item, world)) + else: + item = location.vanilla_item + world.push_item(location, ItemFactory(item, world)) elif location.type == 'Boss': if world.settings.shuffle_dungeon_rewards in ('vanilla', 'reward'): pass # handled in World.fill_bosses elif world.settings.shuffle_dungeon_rewards in ('any_dungeon', 'overworld', 'regional', 'anywhere'): + # We swap with the dungeon reward that rauru became if it is a guaranteed dungeon reward then shuffle like usual + if rauru_random_location == location.name: + item = world.get_location('ToT Reward from Rauru').vanilla_item shuffle_item = True else: dungeon = Dungeon.from_vanilla_reward(ItemFactory(location.vanilla_item, world)) diff --git a/Plandomizer.py b/Plandomizer.py index 5b9c2c53a6..10f8755347 100644 --- a/Plandomizer.py +++ b/Plandomizer.py @@ -1090,7 +1090,7 @@ def configure_effective_starting_items(self, worlds: list[World], world: World) for iter_world in worlds: skipped_locations: list[Location] = [] - if iter_world.settings.skip_reward_from_rauru: + if iter_world.settings.skip_reward_from_rauru in ('free', 'free_forced'): skipped_locations.append(iter_world.get_location('ToT Reward from Rauru')) if iter_world.skip_child_zelda: skipped_locations += [iter_world.get_location('HC Zeldas Letter'), iter_world.get_location('Song from Impa')] diff --git a/SaveContext.py b/SaveContext.py index 56f4e0e70c..70b489cf64 100644 --- a/SaveContext.py +++ b/SaveContext.py @@ -1694,7 +1694,7 @@ def write_settings_dependent_save_context_flags(save_context: SaveContext, world save_context.write_permanent_flag(Scenes.DEATH_MOUNTAIN_TRAIL, FlagType.SWITCH, 0x3, 0x40) # Plant Death Mountain Trail bean save_context.write_permanent_flag(Scenes.DEATH_MOUNTAIN_CRATER, FlagType.SWITCH, 0x3, 0x08) # Plant Death Mountain Crater bean - if world.settings.skip_reward_from_rauru: + if world.settings.skip_reward_from_rauru in ('free', 'free_forced'): save_context.write_bits(0x0EDD, 0x20) # "Pulled Master Sword from Pedestal" if world.settings.ruto_already_f1_jabu and not world.dungeon_mq['Jabu Jabus Belly']: diff --git a/SettingsList.py b/SettingsList.py index ae323473da..aa663056bc 100644 --- a/SettingsList.py +++ b/SettingsList.py @@ -3299,12 +3299,30 @@ class SettingInfos: # Other - skip_reward_from_rauru = Checkbutton( + skip_reward_from_rauru = Combobox( gui_text = 'Free Reward from Rauru', + default = 'not_free', + choices = { + 'not_free': 'No', + 'free': 'Yes', + 'free_forced': 'Yes (Forced)', + }, gui_tooltip = '''\ The item given by Rauru beyond the Door of Time (the Light Medallion in the vanilla game) is given as a starting item instead. + + 'No': Rauru gives reward when you go beyond + the Door of Time. + + 'Yes': You begin the game with the reward Rauru + normally gives beyond the Door of Time. If dungeon + rewards are shuffled then this will be as well. + + 'Yes (Forced)': You begin the game with the + reward Rauru normally gives beyond the Door of Time, + if dungeon rewards are shuffled you will still + get a random Spiritual Stone or Medallion. ''', shared = True, ) diff --git a/data/presets_default.json b/data/presets_default.json index cc63f5c0b4..c54d65c805 100644 --- a/data/presets_default.json +++ b/data/presets_default.json @@ -125,7 +125,7 @@ "start_with_consumables": true, "start_with_rupees": true, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -346,7 +346,7 @@ "start_with_consumables": true, "start_with_rupees": false, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -563,7 +563,7 @@ "start_with_consumables": true, "start_with_rupees": false, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -776,7 +776,7 @@ "start_with_consumables": false, "start_with_rupees": false, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -1009,7 +1009,7 @@ "start_with_consumables": true, "start_with_rupees": false, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -1225,7 +1225,7 @@ "start_with_consumables": true, "start_with_rupees": true, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -1451,7 +1451,7 @@ "start_with_consumables": true, "start_with_rupees": false, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -1853,7 +1853,7 @@ "start_with_consumables": false, "start_with_rupees": false, "starting_hearts": 3, - "skip_reward_from_rauru": false, + "skip_reward_from_rauru": "not_free", "no_escape_sequence": false, "no_guard_stealth": false, "no_epona_race": false, @@ -2054,7 +2054,7 @@ "start_with_consumables": false, "start_with_rupees": false, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": false, "no_epona_race": false, @@ -2276,7 +2276,7 @@ "start_with_consumables": true, "start_with_rupees": true, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -2466,7 +2466,7 @@ "start_with_consumables": false, "start_with_rupees": true, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, @@ -2738,7 +2738,7 @@ "start_with_consumables": false, "start_with_rupees": false, "starting_hearts": 3, - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free", "no_escape_sequence": true, "no_guard_stealth": true, "no_epona_race": true, diff --git a/tests/plando/one-hint-per-goal-dungeons.json b/tests/plando/one-hint-per-goal-dungeons.json index 3ba39a55d6..3c3ecd9ac7 100644 --- a/tests/plando/one-hint-per-goal-dungeons.json +++ b/tests/plando/one-hint-per-goal-dungeons.json @@ -19,7 +19,7 @@ "tokensanity": "all", "mq_dungeons_mode": "vanilla", "disabled_locations": [], - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free_forced", "hint_dist_user": { "name": "goal_coverage_unit_test", "gui_name": "Goal Coverage Unit Test", diff --git a/tests/plando/one-hint-per-goal-hearts.json b/tests/plando/one-hint-per-goal-hearts.json index 1e426af284..b9d39d1b41 100644 --- a/tests/plando/one-hint-per-goal-hearts.json +++ b/tests/plando/one-hint-per-goal-hearts.json @@ -19,7 +19,7 @@ "tokensanity": "all", "mq_dungeons_mode": "vanilla", "disabled_locations": [], - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free_forced", "hint_dist_user": { "name": "goal_coverage_unit_test", "gui_name": "Goal Coverage Unit Test", diff --git a/tests/plando/one-hint-per-goal-medallions.json b/tests/plando/one-hint-per-goal-medallions.json index e9a810098d..b013d73e51 100644 --- a/tests/plando/one-hint-per-goal-medallions.json +++ b/tests/plando/one-hint-per-goal-medallions.json @@ -19,7 +19,7 @@ "tokensanity": "all", "mq_dungeons_mode": "vanilla", "disabled_locations": [], - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free_forced", "hint_dist_user": { "name": "goal_coverage_unit_test", "gui_name": "Goal Coverage Unit Test", diff --git a/tests/plando/one-hint-per-goal-skulls.json b/tests/plando/one-hint-per-goal-skulls.json index b5c2219181..84f88c9721 100644 --- a/tests/plando/one-hint-per-goal-skulls.json +++ b/tests/plando/one-hint-per-goal-skulls.json @@ -19,7 +19,7 @@ "tokensanity": "all", "mq_dungeons_mode": "vanilla", "disabled_locations": [], - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free_forced", "hint_dist_user": { "name": "goal_coverage_unit_test", "gui_name": "Goal Coverage Unit Test", diff --git a/tests/plando/one-hint-per-goal-stones.json b/tests/plando/one-hint-per-goal-stones.json index fb28a24ce4..5c1dd02809 100644 --- a/tests/plando/one-hint-per-goal-stones.json +++ b/tests/plando/one-hint-per-goal-stones.json @@ -19,7 +19,7 @@ "tokensanity": "all", "mq_dungeons_mode": "vanilla", "disabled_locations": [], - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free_forced", "hint_dist_user": { "name": "goal_coverage_unit_test", "gui_name": "Goal Coverage Unit Test", diff --git a/tests/plando/one-hint-per-goal-triforce-hunt.json b/tests/plando/one-hint-per-goal-triforce-hunt.json index 3faf503ecb..2c3223e439 100644 --- a/tests/plando/one-hint-per-goal-triforce-hunt.json +++ b/tests/plando/one-hint-per-goal-triforce-hunt.json @@ -20,7 +20,7 @@ "tokensanity": "all", "mq_dungeons_mode": "vanilla", "disabled_locations": [], - "skip_reward_from_rauru": true, + "skip_reward_from_rauru": "free_forced", "hint_dist_user": { "name": "goal_coverage_unit_test", "gui_name": "Goal Coverage Unit Test",