From 8721310cf748501b8e309837112b98e7d9c65ee1 Mon Sep 17 00:00:00 2001 From: Bonta-kun <40473493+Bonta0@users.noreply.github.com> Date: Wed, 18 Dec 2019 20:45:51 +0100 Subject: [PATCH] World: include can_access_trock_eyebridge can_access_trock_front can_access_trock_big_chest can_access_trock_middle and fix_fake_world in the player specific attributes --- BaseClasses.py | 10 +++++----- EntranceShuffle.py | 2 +- Main.py | 10 +++++----- Rom.py | 2 +- Rules.py | 16 ++++++++-------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 9416210c..71ee44f6 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -45,10 +45,6 @@ class World(object): self.accessibility = accessibility.copy() self.shuffle_ganon = shuffle_ganon self.fix_gtower_exit = self.shuffle_ganon - self.can_access_trock_eyebridge = None - self.can_access_trock_front = None - self.can_access_trock_big_chest = None - self.can_access_trock_middle = None self.quickswap = quickswap self.fastmenu = fastmenu self.disable_music = disable_music @@ -56,7 +52,6 @@ class World(object): self.custom = custom self.customitemarray = customitemarray self.can_take_damage = True - self.fix_fake_world = True self.hints = hints.copy() self.dynamic_regions = [] self.dynamic_locations = [] @@ -77,6 +72,11 @@ class World(object): set_player_attr('fix_skullwoods_exit', self.shuffle[player] not in ['vanilla', 'simple', 'restricted', 'dungeonssimple']) set_player_attr('fix_palaceofdarkness_exit', self.shuffle[player] not in ['vanilla', 'simple', 'restricted', 'dungeonssimple']) set_player_attr('fix_trock_exit', self.shuffle[player] not in ['vanilla', 'simple', 'restricted', 'dungeonssimple']) + set_player_attr('can_access_trock_eyebridge', None) + set_player_attr('can_access_trock_front', None) + set_player_attr('can_access_trock_big_chest', None) + set_player_attr('can_access_trock_middle', None) + set_player_attr('fix_fake_world', True) set_player_attr('mapshuffle', False) set_player_attr('compassshuffle', False) set_player_attr('keyshuffle', False) diff --git a/EntranceShuffle.py b/EntranceShuffle.py index dc315b8b..92442654 100644 --- a/EntranceShuffle.py +++ b/EntranceShuffle.py @@ -903,7 +903,7 @@ def link_entrances(world, player): # place remaining doors connect_doors(world, doors, door_targets, player) elif world.shuffle[player] == 'insanity_legacy': - world.fix_fake_world = False + world.fix_fake_world[player] = False # beware ye who enter here entrances = LW_Entrances + LW_Dungeon_Entrances + DW_Entrances + DW_Dungeon_Entrances + Old_Man_Entrances + ['Skull Woods Second Section Door (East)', 'Skull Woods First Section Door', 'Kakariko Well Cave', 'Bat Cave Cave', 'North Fairy Cave', 'Sanctuary', 'Lost Woods Hideout Stump', 'Lumberjack Tree Cave'] diff --git a/Main.py b/Main.py index 1177973b..20645b08 100644 --- a/Main.py +++ b/Main.py @@ -234,13 +234,13 @@ def copy_world(world): ret.light_world_light_cone = world.light_world_light_cone ret.dark_world_light_cone = world.dark_world_light_cone ret.seed = world.seed - ret.can_access_trock_eyebridge = world.can_access_trock_eyebridge - ret.can_access_trock_front = world.can_access_trock_front - ret.can_access_trock_big_chest = world.can_access_trock_big_chest - ret.can_access_trock_middle = world.can_access_trock_middle + ret.can_access_trock_eyebridge = world.can_access_trock_eyebridge.copy() + ret.can_access_trock_front = world.can_access_trock_front.copy() + ret.can_access_trock_big_chest = world.can_access_trock_big_chest.copy() + ret.can_access_trock_middle = world.can_access_trock_middle.copy() ret.can_take_damage = world.can_take_damage ret.difficulty_requirements = world.difficulty_requirements.copy() - ret.fix_fake_world = world.fix_fake_world + ret.fix_fake_world = world.fix_fake_world.copy() ret.lamps_needed_for_dark_rooms = world.lamps_needed_for_dark_rooms ret.mapshuffle = world.mapshuffle.copy() ret.compassshuffle = world.compassshuffle.copy() diff --git a/Rom.py b/Rom.py index 5b911a18..8a3c648a 100644 --- a/Rom.py +++ b/Rom.py @@ -909,7 +909,7 @@ def patch_rom(world, player, rom, enemized): rom.write_byte(0x180086, 0x00 if world.aga_randomness else 0x01) # set blue ball and ganon warp randomness rom.write_byte(0x1800A0, 0x01) # return to light world on s+q without mirror rom.write_byte(0x1800A1, 0x01) # enable overworld screen transition draining for water level inside swamp - rom.write_byte(0x180174, 0x01 if world.fix_fake_world else 0x00) + rom.write_byte(0x180174, 0x01 if world.fix_fake_world[player] else 0x00) rom.write_byte(0x18017E, 0x01) # Fairy fountains only trade in bottles rom.write_byte(0x180034, 0x0A) # starting max bombs rom.write_byte(0x180035, 30) # starting max arrows diff --git a/Rules.py b/Rules.py index 0950f393..5ef01fc9 100644 --- a/Rules.py +++ b/Rules.py @@ -736,14 +736,14 @@ def set_trock_key_rules(world, player): all_state = world.get_all_state(True) # Check if each of the four main regions of the dungoen can be reached. The previous code section prevents key-costing moves within the dungeon. - can_reach_back = all_state.can_reach(world.get_region('Turtle Rock (Eye Bridge)', player)) if world.can_access_trock_eyebridge is None else world.can_access_trock_eyebridge - world.can_access_trock_eyebridge = can_reach_back - can_reach_front = all_state.can_reach(world.get_region('Turtle Rock (Entrance)', player)) if world.can_access_trock_front is None else world.can_access_trock_front - world.can_access_trock_front = can_reach_front - can_reach_big_chest = all_state.can_reach(world.get_region('Turtle Rock (Big Chest)', player)) if world.can_access_trock_big_chest is None else world.can_access_trock_big_chest - world.can_access_trock_big_chest = can_reach_big_chest - can_reach_middle = all_state.can_reach(world.get_region('Turtle Rock (Second Section)', player)) if world.can_access_trock_middle is None else world.can_access_trock_middle - world.can_access_trock_middle = can_reach_middle + can_reach_back = all_state.can_reach(world.get_region('Turtle Rock (Eye Bridge)', player)) if world.can_access_trock_eyebridge[player] is None else world.can_access_trock_eyebridge[player] + world.can_access_trock_eyebridge[player] = can_reach_back + can_reach_front = all_state.can_reach(world.get_region('Turtle Rock (Entrance)', player)) if world.can_access_trock_front[player] is None else world.can_access_trock_front[player] + world.can_access_trock_front[player] = can_reach_front + can_reach_big_chest = all_state.can_reach(world.get_region('Turtle Rock (Big Chest)', player)) if world.can_access_trock_big_chest[player] is None else world.can_access_trock_big_chest[player] + world.can_access_trock_big_chest[player] = can_reach_big_chest + 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 # No matter what, the key requirement for going from the middle to the bottom should be three keys. set_rule(world.get_entrance('Turtle Rock Dark Room Staircase', player), lambda state: state.has_key('Small Key (Turtle Rock)', player, 3))