diff --git a/BaseClasses.py b/BaseClasses.py index a1864047..796db592 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -126,7 +126,6 @@ class MultiWorld(): set_player_attr('beemizer_total_chance', 0) set_player_attr('beemizer_trap_chance', 0) set_player_attr('escape_assist', []) - set_player_attr('open_pyramid', False) set_player_attr('treasure_hunt_icon', 'Triforce Piece') set_player_attr('treasure_hunt_count', 0) set_player_attr('clock_mode', False) @@ -1431,8 +1430,6 @@ class Spoiler(): outfile.write('Entrance Shuffle: %s\n' % self.world.shuffle[player]) if self.world.shuffle[player] != "vanilla": outfile.write('Entrance Shuffle Seed %s\n' % self.world.worlds[player].er_seed) - outfile.write('Pyramid hole pre-opened: %s\n' % ( - 'Yes' if self.world.open_pyramid[player] else 'No')) outfile.write('Shop inventory shuffle: %s\n' % bool_to_text("i" in self.world.shop_shuffle[player])) outfile.write('Shop price shuffle: %s\n' % diff --git a/Generate.py b/Generate.py index b46c730c..125fab41 100644 --- a/Generate.py +++ b/Generate.py @@ -583,9 +583,6 @@ def roll_alttp_settings(ret: argparse.Namespace, weights, plando_options): ret.goal = goals[goal] - # TODO consider moving open_pyramid to an automatic variable in the core roller, set to True when - # fast ganon + ganon at hole - ret.open_pyramid = get_choice_legacy('open_pyramid', weights, 'goal') extra_pieces = get_choice_legacy('triforce_pieces_mode', weights, 'available') diff --git a/Main.py b/Main.py index acbb4ad5..6daa16d9 100644 --- a/Main.py +++ b/Main.py @@ -47,7 +47,6 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No world.item_functionality = args.item_functionality.copy() world.timer = args.timer.copy() world.goal = args.goal.copy() - world.open_pyramid = args.open_pyramid.copy() world.boss_shuffle = args.shufflebosses.copy() world.enemy_health = args.enemy_health.copy() world.enemy_damage = args.enemy_damage.copy() diff --git a/worlds/alttp/Options.py b/worlds/alttp/Options.py index d7f9becb..b42a5eb3 100644 --- a/worlds/alttp/Options.py +++ b/worlds/alttp/Options.py @@ -1,5 +1,6 @@ import typing +from BaseClasses import MultiWorld from Options import Choice, Range, Option, Toggle, DefaultOnToggle, DeathLink @@ -27,6 +28,35 @@ class Goal(Choice): option_hand_in = 2 +class OpenPyramid(Choice): + """Determines whether the hole at the top of pyramid is open. + Goal will open the pyramid if the goal requires you to kill Ganon, without needing to kill Agahnim 2. + Auto is the same as goal except if Ganon's dropdown is in another location, the hole will be closed.""" + display_name = "Open Pyramid Hole" + option_closed = 0 + option_open = 1 + option_goal = 2 + option_auto = 3 + default = option_goal + + alias_true = option_open + alias_false = option_closed + alias_yes = option_open + alias_no = option_closed + + def to_bool(self, world: MultiWorld, player: int) -> bool: + if self.value == self.option_goal: + return world.goal[player] in {'crystals', 'ganontriforcehunt', 'localganontriforcehunt', 'ganonpedestal'} + elif self.value == self.option_auto: + return world.goal[player] in {'crystals', 'ganontriforcehunt', 'localganontriforcehunt', 'ganonpedestal'} \ + and (world.shuffle[player] in {'vanilla', 'dungeonssimple', 'dungeonsfull', 'dungeonscrossed'} or not + world.shuffle_ganon) + elif self.value == self.option_open: + return True + else: + return False + + class DungeonItem(Choice): value: int option_original_dungeon = 0 @@ -331,6 +361,7 @@ class AllowCollect(Toggle): alttp_options: typing.Dict[str, type(Option)] = { "crystals_needed_for_gt": CrystalsTower, "crystals_needed_for_ganon": CrystalsGanon, + "open_pyramid": OpenPyramid, "bigkey_shuffle": bigkey_shuffle, "smallkey_shuffle": smallkey_shuffle, "compass_shuffle": compass_shuffle, diff --git a/worlds/alttp/Rom.py b/worlds/alttp/Rom.py index 72cd1cea..c16bbf53 100644 --- a/worlds/alttp/Rom.py +++ b/worlds/alttp/Rom.py @@ -1247,7 +1247,7 @@ def patch_rom(world, rom, player, enemized): rom.write_bytes(0x50563, [0x3F, 0x14]) # disable below ganon chest rom.write_byte(0x50599, 0x00) # disable below ganon chest rom.write_bytes(0xE9A5, [0x7E, 0x00, 0x24]) # disable below ganon chest - rom.write_byte(0x18008B, 0x01 if world.open_pyramid[player] else 0x00) # pre-open Pyramid Hole + rom.write_byte(0x18008B, 0x01 if world.open_pyramid[player].to_bool(world, player) else 0x00) # pre-open Pyramid Hole rom.write_byte(0x18008C, 0x01 if world.crystals_needed_for_gt[ player] == 0 else 0x00) # GT pre-opened if crystal requirement is 0 rom.write_byte(0xF5D73, 0xF0) # bees are catchable diff --git a/worlds/alttp/__init__.py b/worlds/alttp/__init__.py index 8e4ec1c1..871c4468 100644 --- a/worlds/alttp/__init__.py +++ b/worlds/alttp/__init__.py @@ -176,17 +176,6 @@ class ALTTPWorld(World): def create_regions(self): player = self.player world = self.world - if world.open_pyramid[player] == 'goal': - world.open_pyramid[player] = world.goal[player] in {'crystals', 'ganontriforcehunt', - 'localganontriforcehunt', 'ganonpedestal'} - elif world.open_pyramid[player] == 'auto': - world.open_pyramid[player] = world.goal[player] in {'crystals', 'ganontriforcehunt', - 'localganontriforcehunt', 'ganonpedestal'} and \ - (world.shuffle[player] in {'vanilla', 'dungeonssimple', 'dungeonsfull', - 'dungeonscrossed'} or not world.shuffle_ganon) - else: - world.open_pyramid[player] = {'on': True, 'off': False, 'yes': True, 'no': False}.get( - world.open_pyramid[player], 'auto') world.triforce_pieces_available[player] = max(world.triforce_pieces_available[player], world.triforce_pieces_required[player])