From 477c7bc596de042afedae350459a27ea50dc7d06 Mon Sep 17 00:00:00 2001 From: compiling <8335770+compiling@users.noreply.github.com> Date: Thu, 30 Apr 2020 12:10:28 +1000 Subject: [PATCH] Place an extra key in TR instead of breaking 100% locations --- Rules.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Rules.py b/Rules.py index 0fb49f4e..1a8c5372 100644 --- a/Rules.py +++ b/Rules.py @@ -2,6 +2,7 @@ import collections import logging import OWGSets from BaseClasses import CollectionState, RegionType +from Items import ItemFactory def set_rules(world, player): @@ -847,9 +848,6 @@ def set_trock_key_rules(world, player): can_reach_middle = all_state.can_reach(world.get_region('Turtle Rock (Second Section)', player)) if world.can_access_trock_middle[player] is None else world.can_access_trock_middle[player] world.can_access_trock_middle[player] = can_reach_middle - # For some entrance configurations, 100% locations is not achievable - tr_breaks_accessibility = False - # The following represent the common key rules. # No matter what, the key requirement for going from the middle to the bottom should be three keys. @@ -904,10 +902,13 @@ def set_trock_key_rules(world, player): # Must not go in the dungeon - all 3 available chests (Chomps, Big Chest, Crystaroller) must be keys to access laser bridge, and the big key is required first non_big_key_locations += ['Turtle Rock - Chain Chomps', 'Turtle Rock - Compass Chest', 'Turtle Rock - Roller Room - Left', 'Turtle Rock - Roller Room - Right'] else: - # A small key must go in the Big Key Chest to avoid a potential softlock. - tr_breaks_accessibility = True + # A key is required in the Big Key Chest to prevent a possible softlock. Place an extra key to ensure 100% locations still works + world.push_item(world.get_location('Turtle Rock - Big Key Chest', player), ItemFactory('Small Key (Turtle Rock)', player), False) + world.get_location('Turtle Rock - Big Key Chest', player).event = True + big20 = next(i for i in world.itempool if i.name == "Rupees (20)" and i.player == player) + world.itempool.remove(big20) - if world.accessibility[player] != 'locations' or tr_breaks_accessibility: + if world.accessibility[player] != 'locations': set_always_allow(world.get_location('Turtle Rock - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Turtle Rock)' and item.player == player and state.can_reach(world.get_region('Turtle Rock (Second Section)', player))) else: