From 4a16ba74e8dfc4c821109aa78363816ac197400a Mon Sep 17 00:00:00 2001 From: Bonta-kun <40473493+Bonta0@users.noreply.github.com> Date: Sat, 21 Dec 2019 10:42:59 +0100 Subject: [PATCH] Fix triforce hunt icon showing for every player --- BaseClasses.py | 4 ++-- ItemList.py | 6 +++--- Main.py | 4 ++-- Rom.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 71ee44f6..217ac5d8 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -35,8 +35,6 @@ class World(object): self.shuffle_bonk_prizes = False self.light_world_light_cone = False self.dark_world_light_cone = False - self.treasure_hunt_count = 0 - self.treasure_hunt_icon = 'Triforce Piece' self.clock_mode = 'off' self.rupoor_cost = 10 self.aga_randomness = True @@ -90,6 +88,8 @@ class World(object): set_player_attr('crystals_needed_for_ganon', 7) set_player_attr('crystals_needed_for_gt', 7) set_player_attr('open_pyramid', False) + set_player_attr('treasure_hunt_icon', 'Triforce Piece') + set_player_attr('treasure_hunt_count', 0) def initialize_regions(self, regions=None): for region in regions if regions else self.regions: diff --git a/ItemList.py b/ItemList.py index 991588b4..18035e12 100644 --- a/ItemList.py +++ b/ItemList.py @@ -141,7 +141,7 @@ def generate_itempool(world, player): region = world.get_region('Light World',player) loc = Location(player, "Murahdahla", parent=region) - loc.access_rule = lambda state: state.item_count('Triforce Piece', player) + state.item_count('Power Star', player) > state.world.treasure_hunt_count + loc.access_rule = lambda state: state.item_count('Triforce Piece', player) + state.item_count('Power Star', player) > state.world.treasure_hunt_count[player] region.locations.append(loc) world.dynamic_locations.append(loc) @@ -214,9 +214,9 @@ def generate_itempool(world, player): world.clock_mode = clock_mode if treasure_hunt_count is not None: - world.treasure_hunt_count = treasure_hunt_count + world.treasure_hunt_count[player] = treasure_hunt_count if treasure_hunt_icon is not None: - world.treasure_hunt_icon = treasure_hunt_icon + world.treasure_hunt_icon[player] = treasure_hunt_icon world.itempool.extend([item for item in get_dungeon_item_pool(world) if item.player == player and ((item.smallkey and world.keyshuffle[player]) diff --git a/Main.py b/Main.py index b761e6e3..03b17a40 100644 --- a/Main.py +++ b/Main.py @@ -228,8 +228,8 @@ def copy_world(world): ret.ganon_at_pyramid = world.ganon_at_pyramid.copy() ret.powder_patch_required = world.powder_patch_required.copy() ret.ganonstower_vanilla = world.ganonstower_vanilla.copy() - ret.treasure_hunt_count = world.treasure_hunt_count - ret.treasure_hunt_icon = world.treasure_hunt_icon + ret.treasure_hunt_count = world.treasure_hunt_count.copy() + ret.treasure_hunt_icon = world.treasure_hunt_icon.copy() ret.sewer_light_cone = world.sewer_light_cone.copy() ret.light_world_light_cone = world.light_world_light_cone ret.dark_world_light_cone = world.dark_world_light_cone diff --git a/Rom.py b/Rom.py index 98e6682e..8a56f7e9 100644 --- a/Rom.py +++ b/Rom.py @@ -876,8 +876,8 @@ def patch_rom(world, player, rom, enemized): write_int32(rom, 0x18020C, (40 + ERtimeincrease) * 60 * 60) # starting time (in frames, sint32) # set up goals for treasure hunt - rom.write_bytes(0x180165, [0x0E, 0x28] if world.treasure_hunt_icon == 'Triforce Piece' else [0x0D, 0x28]) - rom.write_byte(0x180167, world.treasure_hunt_count % 256) + rom.write_bytes(0x180165, [0x0E, 0x28] if world.treasure_hunt_icon[player] == 'Triforce Piece' else [0x0D, 0x28]) + rom.write_byte(0x180167, world.treasure_hunt_count[player] % 256) rom.write_byte(0x180194, 1) # Must turn in triforced pieces (instant win not enabled) rom.write_bytes(0x180213, [0x00, 0x01]) # Not a Tournament Seed @@ -1567,7 +1567,7 @@ def write_strings(rom, world, player): tt['ganon_fall_in_alt'] = 'Why are you even here?\n You can\'t even hurt me! Get the Triforce Pieces.' tt['ganon_phase_3_alt'] = 'Seriously? Go Away, I will not Die.' tt['sign_ganon'] = 'Go find the Triforce pieces... Ganon is invincible!' - tt['murahdahla'] = "Hello @. I\nam Murahdahla, brother of\nSahasrahla and Aginah. Behold the power of\ninvisibility.\n\n\n\n… … …\n\nWait! you can see me? I knew I should have\nhidden in a hollow tree. If you bring\n%d triforce pieces, I can reassemble it." % world.treasure_hunt_count + tt['murahdahla'] = "Hello @. I\nam Murahdahla, brother of\nSahasrahla and Aginah. Behold the power of\ninvisibility.\n\n\n\n… … …\n\nWait! you can see me? I knew I should have\nhidden in a hollow tree. If you bring\n%d triforce pieces, I can reassemble it." % world.treasure_hunt_count[player] elif world.goal[player] in ['pedestal']: tt['ganon_fall_in_alt'] = 'Why are you even here?\n You can\'t even hurt me! Your goal is at the pedestal.' tt['ganon_phase_3_alt'] = 'Seriously? Go Away, I will not Die.'