diff --git a/BaseClasses.py b/BaseClasses.py index 34e5c898..f03d47a2 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -110,6 +110,7 @@ class World(object): set_player_attr('owwhirlpools', []) set_player_attr('remote_items', False) set_player_attr('required_medallions', ['Ether', 'Quake']) + set_player_attr('bottle_refills', ['Bottle (Green Potion)', 'Bottle (Green Potion)']) set_player_attr('swamp_patch_required', False) set_player_attr('powder_patch_required', False) set_player_attr('ganon_at_pyramid', True) @@ -954,7 +955,7 @@ class CollectionState(object): # try to resolve a name if resolution_hint == 'Location': spot = self.world.get_location(spot, player) - elif resolution_hint in ['Entrance', 'OWEdge']: + elif resolution_hint in ['Entrance', 'OWEdge', 'OWTerrain', 'Ledge', 'Portal', 'Whirlpool', 'Mirror', 'Flute']: spot = self.world.get_entrance(spot, player) else: # default to Region @@ -1699,15 +1700,71 @@ class Entrance(object): self.player = player self.door = None self.hide_path = False + self.temp_path = [] def can_reach(self, state): - if self.parent_region.can_reach(state) and self.access_rule(state): - if not self.hide_path and not self in state.path: - state.path[self] = (self.name, state.path.get(self.parent_region, (self.parent_region.name, None))) - return True + # Destination Pickup OW Only No Ledges Can S&Q + multi_step_locations = { 'Pyramid Crack': ('Big Bomb', True, True, False), + 'Missing Smith': ('Frog', True, False, True), + 'Middle Aged Man': ('Dark Blacksmith Ruins', True, False, True) } + + if self.name in multi_step_locations: + if self not in state.path: + world = self.parent_region.world if self.parent_region else None + step_location = world.get_location(multi_step_locations[self.name][0], self.player) + if step_location.can_reach(state) and self.can_reach_thru(state, step_location.parent_region, multi_step_locations[self.name][1], multi_step_locations[self.name][2], multi_step_locations[self.name][3]) and self.access_rule(state): + if not self in state.path: + path = state.path.get(step_location.parent_region, (step_location.parent_region.name, None)) + item_name = step_location.item.name if step_location.item else 'Pick Up Item' + path = (f'{step_location.parent_region.name} Exit', (item_name, path)) + while len(self.temp_path): + exit = self.temp_path.pop(0) + path = (exit.name, (exit.parent_region.name, path)) + item_name = self.connected_region.locations[0].item.name if self.connected_region.locations[0].item else 'Deliver Item' + path = (item_name, (self.parent_region.name, path)) + state.path[self] = (self.name, path) + return True + else: + return True + else: + if self.parent_region.can_reach(state) and self.access_rule(state): + if not self.hide_path and not self in state.path: + state.path[self] = (self.name, state.path.get(self.parent_region, (self.parent_region.name, None))) + return True return False + def can_reach_thru(self, state, start_region, ignore_underworld=False, ignore_ledges=False, allow_save_quit=False): + def explore_region(region, path = []): + nonlocal found + if region not in explored_regions or len(explored_regions[region]) > len(path): + explored_regions[region] = path + for exit in region.exits: + if exit.connected_region and (not ignore_ledges or exit.spot_type != 'Ledge') \ + and exit.connected_region.name not in ['Dig Game Area'] \ + and exit.access_rule(state): + if exit.connected_region == self.parent_region: + found = True + explored_regions[self.parent_region] = path + [exit] + elif not ignore_underworld or region.type == exit.connected_region.type or exit.connected_region.type not in [RegionType.Cave, RegionType.Dungeon]: + explore_region(exit.connected_region, path + [exit]) + + found = False + explored_regions = {} + explore_region(start_region.entrances[0].parent_region) + if found: + self.temp_path = explored_regions[self.parent_region] + elif allow_save_quit: + world = self.parent_region.world if self.parent_region else None + exit = world.get_entrance('Links House S&Q', self.player) + explore_region(exit.connected_region, [exit]) + if found: + self.temp_path = explored_regions[self.parent_region] + + #TODO: Implement residual mirror portal placing for the previous leg, to be used for the final destination + + return found + def connect(self, region, addresses=None, target=None, vanilla=None): self.connected_region = region self.target = target @@ -2680,6 +2737,7 @@ class Spoiler(object): self.doorTypes = {} self.lobbies = {} self.medallions = {} + self.bottles = {} self.playthrough = {} self.unreachables = [] self.startinventory = [] @@ -2780,6 +2838,15 @@ class Spoiler(object): self.medallions[f'Misery Mire ({self.world.get_player_names(player)})'] = self.world.required_medallions[player][0] self.medallions[f'Turtle Rock ({self.world.get_player_names(player)})'] = self.world.required_medallions[player][1] + self.bottles = OrderedDict() + if self.world.players == 1: + self.bottles['Waterfall Bottle'] = self.world.bottle_refills[1][0] + self.bottles['Pyramid Bottle'] = self.world.bottle_refills[1][1] + else: + for player in range(1, self.world.players + 1): + self.bottles[f'Waterfall Bottle ({self.world.get_player_names(player)})'] = self.world.bottle_refills[player][0] + self.bottles[f'Pyramid Bottle ({self.world.get_player_names(player)})'] = self.world.bottle_refills[player][1] + self.locations = OrderedDict() listed_locations = set() @@ -2862,6 +2929,7 @@ class Spoiler(object): out.update(self.locations) out['Starting Inventory'] = self.startinventory out['Special'] = self.medallions + out['Bottles'] = self.bottles if self.hashes: out['Hashes'] = {f"{self.world.player_names[player][team]} (Team {team+1})": hash for (player, team), hash in self.hashes.items()} if self.shops: @@ -2911,12 +2979,14 @@ class Spoiler(object): outfile.write('Whirlpool Shuffle:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['ow_whirlpool'][player] else 'No')) outfile.write('Flute Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['ow_fluteshuffle'][player]) outfile.write('Entrance Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['shuffle'][player]) - outfile.write('Shuffle GT/Ganon:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['shuffleganon'][player] else 'No')) - outfile.write('Shuffle Links:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['shufflelinks'][player] else 'No')) + if self.metadata['shuffle'][player] != 'vanilla': + outfile.write('Shuffle GT/Ganon:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['shuffleganon'][player] else 'No')) + outfile.write('Shuffle Links:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['shufflelinks'][player] else 'No')) outfile.write('Pyramid Hole Pre-opened:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['open_pyramid'][player] else 'No')) outfile.write('Door Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['door_shuffle'][player]) - outfile.write('Intensity:'.ljust(line_width) + '%s\n' % self.metadata['intensity'][player]) - outfile.write('Experimental:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['experimental'][player] else 'No')) + if self.metadata['door_shuffle'][player] != 'vanilla': + outfile.write('Intensity:'.ljust(line_width) + '%s\n' % self.metadata['intensity'][player]) + outfile.write('Experimental:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['experimental'][player] else 'No')) outfile.write('Pot Shuffle:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['potshuffle'][player] else 'No')) outfile.write('Key Drop Shuffle:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['keydropshuffle'][player] else 'No')) outfile.write('Map Shuffle:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['mapshuffle'][player] else 'No')) @@ -2931,7 +3001,7 @@ class Spoiler(object): if self.startinventory: outfile.write('Starting Inventory:'.ljust(line_width)) - outfile.write('\n'.ljust(line_width+1).join(self.startinventory)) + outfile.write('\n'.ljust(line_width+1).join(self.startinventory) + '\n') def to_file(self, filename): self.parse_data() @@ -2945,6 +3015,7 @@ class Spoiler(object): if len(self.hashes) > 0: for team in range(self.world.teams): outfile.write('%s%s\n' % (f"Hash - {self.world.player_names[player][team]} (Team {team+1}): " if self.world.teams > 1 else 'Hash: ', self.hashes[player, team])) + outfile.write('\n\nRequirements:\n\n') for dungeon, medallion in self.medallions.items(): outfile.write(f'{dungeon}:'.ljust(line_width) + '%s Medallion\n' % medallion) @@ -2955,6 +3026,10 @@ class Spoiler(object): if self.world.crystals_ganon_orig[player] == 'random': outfile.write(str('Crystals Required for Ganon' + player_name + ':').ljust(line_width) + '%s\n' % (str(self.metadata['ganon_crystals'][player]))) + outfile.write('\n\nBottle Refills:\n\n') + for fairy, bottle in self.bottles.items(): + outfile.write(f'{fairy}: {bottle}\n') + if self.overworlds: # overworlds: overworld transitions; outfile.write('\n\nOverworld:\n\n') @@ -3133,7 +3208,7 @@ access_mode = {"items": 0, "locations": 1, "none": 2} boss_mode = {"none": 0, "simple": 1, "full": 2, "random": 3, "chaos": 3} enemy_mode = {"none": 0, "shuffled": 1, "random": 2, "chaos": 2, "legacy": 3} -# byte 7: HHHD DPR? (enemy_health, enemy_dmg, potshuffle, retro, ?) +# byte 7: HHHD DPBS (enemy_health, enemy_dmg, potshuffle, bomb logic, shuffle links) e_health = {"default": 0, "easy": 1, "normal": 2, "hard": 3, "expert": 4} e_dmg = {"default": 0, "shuffled": 1, "random": 2} @@ -3163,7 +3238,8 @@ class Settings(object): | (0x20 if w.mapshuffle[p] else 0) | (0x10 if w.compassshuffle[p] else 0) | (boss_mode[w.boss_shuffle[p]] << 2) | (enemy_mode[w.enemy_shuffle[p]]), - (e_health[w.enemy_health[p]] << 5) | (e_dmg[w.enemy_damage[p]] << 3) | (0x4 if w.potshuffle[p] else 0) | (0x2 if w.retro[p] else 0)]) + (e_health[w.enemy_health[p]] << 5) | (e_dmg[w.enemy_damage[p]] << 3) | (0x4 if w.potshuffle[p] else 0) + | (0x2 if w.bombbag[p] else 0) | (1 if w.shufflelinks[p] else 0)]) return base64.b64encode(code, "+-".encode()).decode() @staticmethod @@ -3208,6 +3284,8 @@ class Settings(object): args.enemy_health[p] = r(e_health)[(settings[7] & 0xE0) >> 5] args.enemy_damage[p] = r(e_dmg)[(settings[7] & 0x18) >> 3] args.shufflepots[p] = True if settings[7] & 0x4 else False + args.bombbag[p] = True if settings[7] & 0x2 else False + args.shufflelinks[p] = True if settings[7] & 0x1 else False class KeyRuleType(FastEnum): diff --git a/CHANGELOG.md b/CHANGELOG.md index f5d855fc..62d13649 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +### 0.2.2.0 +- Delivering Big Red Bomb is now in logic +- Smith/Purple Chest have proper dynamic pathing to fix logical issues +- Fixed issue with bomb walls in OW not requiring moon pearl in DW + +### 0.2.1.3 +- New fake flipper handling to allow S+Q rather than insta-kill +- Fixed whirlpools in Crossed OW +- Spoiler fixes, incl. missing Starting Inventory in Spoiler +- Fixed music track change to Sanc music when Standard mode is delivering Zelda +- Fixed SP flooding issue +- Fixed issue with Shuffle Ganon in CLI/GUI +- ~~Merged DR v0.5.1.5 - Mystery subweights~~ + ### 0.2.1.2 - Fixed issue with whirlpools not changing world when in Crossed OW diff --git a/DoorShuffle.py b/DoorShuffle.py index 0c2a9992..6e80d19d 100644 --- a/DoorShuffle.py +++ b/DoorShuffle.py @@ -91,8 +91,9 @@ def link_doors_main(world, player): world.get_portal('Desert East', player).destination = True if (world.mode[player] == 'inverted') != (0x30 in world.owswaps[player][0] and world.owMixed[player]): world.get_portal('Desert West', player).destination = True - else: + if (world.mode[player] == 'inverted') == (0x00 in world.owswaps[player][0] and world.owMixed[player]): world.get_portal('Skull 2 West', player).destination = True + if (world.mode[player] == 'inverted') == (0x05 in world.owswaps[player][0] and world.owMixed[player]): world.get_portal('Turtle Rock Lazy Eyes', player).destination = True world.get_portal('Turtle Rock Eye Bridge', player).destination = True else: diff --git a/EntranceShuffle.py b/EntranceShuffle.py index e845587f..34733fc2 100644 --- a/EntranceShuffle.py +++ b/EntranceShuffle.py @@ -284,6 +284,8 @@ def link_entrances(world, player): dw_entrances = list() caves = list(Cave_Exits + Cave_Three_Exits + Old_Man_House) for e in entrance_pool: + if world.mode[player] == 'standard' and e == 'Bonk Fairy (Light)': + continue region = world.get_entrance(e, player).parent_region if region.type == RegionType.LightWorld: lw_entrances.append(e) @@ -338,6 +340,8 @@ def link_entrances(world, player): lw_entrances = list() dw_entrances = list() for e in entrance_pool: + if world.mode[player] == 'standard' and e == 'Bonk Fairy (Light)': + continue if e not in list(zip(*drop_connections + dropexit_connections))[0]: region = world.get_entrance(e, player).parent_region if region.type == RegionType.LightWorld: @@ -539,10 +543,14 @@ def link_entrances(world, player): place_blacksmith(world, links_house, player) # place connectors in inaccessible regions - connect_inaccessible_regions(world, list(entrance_pool), [], caves, player) + pool = list(entrance_pool) + if world.mode[player] == 'standard' and 'Bonk Fairy (Light)' in pool: + pool.remove('Bonk Fairy (Light)') + connect_inaccessible_regions(world, pool, [], caves, player) # place old man, has limited options - place_old_man(world, list(entrance_pool), player) + pool = [e for e in pool if e in entrance_pool] + place_old_man(world, pool, player) # place bomb shop, has limited options bomb_shop_doors = list(entrance_pool) @@ -552,7 +560,8 @@ def link_entrances(world, player): connect_entrance(world, bomb_shop, 'Big Bomb Shop', player) # shuffle connectors - connect_caves(world, list(entrance_pool), [], caves, player) + pool = [e for e in pool if e in entrance_pool] + connect_caves(world, pool, [], caves, player) # place remaining doors connect_doors(world, list(entrance_pool), list(exit_pool), player) @@ -616,10 +625,14 @@ def link_entrances(world, player): place_blacksmith(world, links_house, player) # place connectors in inaccessible regions - connect_inaccessible_regions(world, list(entrance_pool), [], caves, player) + pool = list(entrance_pool) + if world.mode[player] == 'standard' and 'Bonk Fairy (Light)' in pool: + pool.remove('Bonk Fairy (Light)') + connect_inaccessible_regions(world, pool, [], caves, player) # place old man, has limited options - place_old_man(world, list(entrance_pool), player) + pool = [e for e in pool if e in entrance_pool] + place_old_man(world, pool, player) caves.append('Old Man Cave Exit (West)') # place bomb shop, has limited options @@ -628,10 +641,13 @@ def link_entrances(world, player): bomb_shop_doors = [e for e in entrance_pool if e not in ['Pyramid Fairy']] random.shuffle(bomb_shop_doors) bomb_shop = bomb_shop_doors.pop() + pool.remove(bomb_shop) connect_entrance(world, bomb_shop, 'Big Bomb Shop', player) # shuffle connectors doors = list(entrance_pool) + if world.mode[player] == 'standard' and 'Bonk Fairy (Light)' in doors: + doors.remove('Bonk Fairy (Light)') exit_doors = [e for e in entrance_pool if e not in entrance_exits] random.shuffle(doors) random.shuffle(exit_doors) @@ -658,7 +674,7 @@ def link_entrances(world, player): ignore_pool = True # check for swamp palace fix - if not (world.get_entrance('Dam', player).connected_region.name in ['Dam', 'Swamp Portal'] and world.get_entrance('Swamp Palace', player).connected_region.name == ['Dam', 'Swamp Portal']): + if not (world.get_entrance('Dam', player).connected_region.name in ['Dam', 'Swamp Portal'] and world.get_entrance('Swamp Palace', player).connected_region.name in ['Dam', 'Swamp Portal']): world.swamp_patch_required[player] = True # check for potion shop location @@ -2168,6 +2184,7 @@ mandatory_connections = [('Links House S&Q', 'Links House'), ('Fairy Ascension Cave Climb', 'Fairy Ascension Cave (Top)'), ('Fairy Ascension Cave Pots', 'Fairy Ascension Cave (Bottom)'), ('Fairy Ascension Cave Drop', 'Fairy Ascension Cave (Drop)'), + ('Missing Smith', 'Missing Smith'), ('Superbunny Cave Climb', 'Superbunny Cave (Top)'), ('Hookshot Cave Front to Middle', 'Hookshot Cave (Middle)'), ('Hookshot Cave Middle to Front', 'Hookshot Cave (Front)'), diff --git a/ItemList.py b/ItemList.py index 25c75fb1..3301dc6b 100644 --- a/ItemList.py +++ b/ItemList.py @@ -217,6 +217,9 @@ def generate_itempool(world, player): world.push_item(world.get_location('Dark Blacksmith Ruins', player), ItemFactory('Pick Up Purple Chest', player), False) world.get_location('Dark Blacksmith Ruins', player).event = True world.get_location('Dark Blacksmith Ruins', player).locked = True + world.push_item(world.get_location('Middle Aged Man', player), ItemFactory('Deliver Purple Chest', player), False) + world.get_location('Middle Aged Man', player).event = True + world.get_location('Middle Aged Man', player).locked = True world.push_item(world.get_location('Frog', player), ItemFactory('Get Frog', player), False) world.get_location('Frog', player).event = True world.get_location('Frog', player).locked = True @@ -226,6 +229,12 @@ def generate_itempool(world, player): world.push_item(world.get_location('Floodgate', player), ItemFactory('Open Floodgate', player), False) world.get_location('Floodgate', player).event = True world.get_location('Floodgate', player).locked = True + world.push_item(world.get_location('Big Bomb', player), ItemFactory('Pick Up Big Bomb', player), False) + world.get_location('Big Bomb', player).event = True + world.get_location('Big Bomb', player).locked = True + world.push_item(world.get_location('Pyramid Crack', player), ItemFactory('Detonate Big Bomb', player), False) + world.get_location('Pyramid Crack', player).event = True + world.get_location('Pyramid Crack', player).locked = True world.push_item(world.get_location('Trench 1 Switch', player), ItemFactory('Trench 1 Filled', player), False) world.get_location('Trench 1 Switch', player).event = True world.get_location('Trench 1 Switch', player).locked = True @@ -385,6 +394,15 @@ def generate_itempool(world, player): tr_medallion = ['Ether', 'Quake', 'Bombos'][random.randint(0, 2)] world.required_medallions[player] = (mm_medallion, tr_medallion) + # shuffle bottle refills + if world.difficulty[player] in ['hard', 'expert']: + waterfall_bottle = hardbottles[random.randint(0, 5)] + pyramid_bottle = hardbottles[random.randint(0, 5)] + else: + waterfall_bottle = normalbottles[random.randint(0, 6)] + pyramid_bottle = normalbottles[random.randint(0, 6)] + world.bottle_refills[player] = (waterfall_bottle, pyramid_bottle) + set_up_shops(world, player) if world.retro[player]: diff --git a/Items.py b/Items.py index 53a62ee4..9f732523 100644 --- a/Items.py +++ b/Items.py @@ -182,7 +182,10 @@ item_table = {'Bow': (True, False, None, 0x0B, 200, 'You have\nchosen the\narche 'Get Frog': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Return Smith': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Pick Up Purple Chest': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), + 'Deliver Purple Chest': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Open Floodgate': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), + 'Pick Up Big Bomb': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), + 'Detonate Big Bomb': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Trench 1 Filled': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Trench 2 Filled': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), 'Drained Swamp': (True, False, 'Event', 999, None, None, None, None, None, None, None, None), diff --git a/Main.py b/Main.py index c00a7151..88b97105 100644 --- a/Main.py +++ b/Main.py @@ -30,7 +30,7 @@ from Fill import sell_potions, sell_keys, balance_multiworld_progression, balanc from ItemList import generate_itempool, difficulties, fill_prizes, customize_shops from Utils import output_path, parse_player_names -__version__ = '0.5.1.4-u' +__version__ = '0.5.1.5-u' from source.classes.BabelFish import BabelFish @@ -163,10 +163,6 @@ def main(args, seed=None, fish=None): else: outfilebase = f'DR_{args.outputname if args.outputname else world.seed}' - if args.create_spoiler and not args.jsonout: - logger.info(world.fish.translate("cli","cli","patching.spoiler")) - world.spoiler.meta_to_file(output_path('%s_Spoiler.txt' % outfilebase)) - for player in range(1, world.players + 1): world.difficulty_requirements[player] = difficulties[world.difficulty[player]] @@ -178,7 +174,12 @@ def main(args, seed=None, fish=None): item = ItemFactory(tok.strip(), player) if item: world.push_precollected(item) + + if args.create_spoiler and not args.jsonout: + logger.info(world.fish.translate("cli","cli","patching.spoiler")) + world.spoiler.meta_to_file(output_path('%s_Spoiler.txt' % outfilebase)) + for player in range(1, world.players + 1): create_regions(world, player) create_dungeon_regions(world, player) create_owedges(world, player) @@ -414,6 +415,7 @@ def copy_world(world): ret.player_names = copy.deepcopy(world.player_names) ret.remote_items = world.remote_items.copy() ret.required_medallions = world.required_medallions.copy() + ret.bottle_refills = world.bottle_refills.copy() ret.swamp_patch_required = world.swamp_patch_required.copy() ret.ganon_at_pyramid = world.ganon_at_pyramid.copy() ret.powder_patch_required = world.powder_patch_required.copy() @@ -594,7 +596,7 @@ def create_playthrough(world): # get locations containing progress items prog_locations = [location for location in world.get_filled_locations() if location.item.advancement] - optional_locations = ['Trench 1 Switch', 'Trench 2 Switch', 'Ice Block Drop'] + optional_locations = ['Trench 1 Switch', 'Trench 2 Switch', 'Ice Block Drop', 'Big Bomb'] state_cache = [None] collection_spheres = [] state = CollectionState(world) diff --git a/Mystery.py b/Mystery.py index 6adb7426..5a8594c4 100644 --- a/Mystery.py +++ b/Mystery.py @@ -105,7 +105,8 @@ def get_weights(path): raise Exception(f'Failed to read weights file: {e}') def roll_settings(weights): - def get_choice(option, root=weights): + def get_choice(option, root=None): + root = weights if root is None else root if option not in root: return None if type(root[option]) is not dict: @@ -120,13 +121,24 @@ def roll_settings(weights): return default return choice + while True: + subweights = weights.get('subweights', {}) + if len(subweights) == 0: + break + chances = ({k: int(v['chance']) for (k, v) in subweights.items()}) + subweight_name = random.choices(list(chances.keys()), weights=list(chances.values()))[0] + subweights = weights.get('subweights', {}).get(subweight_name, {}).get('weights', {}) + subweights['subweights'] = subweights.get('subweights', {}) + weights = {**weights, **subweights} + ret = argparse.Namespace() glitches_required = get_choice('glitches_required') - if glitches_required not in ['none', 'no_logic']: - print("Only NMG and No Logic supported") - glitches_required = 'none' - ret.logic = {'none': 'noglitches', 'owg': 'owglitches', 'no_logic': 'nologic'}[glitches_required] + if glitches_required is not None: + if glitches_required not in ['none', 'owg', 'no_logic']: + print("Only NMG, OWG, and No Logic supported") + glitches_required = 'none' + ret.logic = {'none': 'noglitches', 'owg': 'owglitches', 'no_logic': 'nologic'}[glitches_required] item_placement = get_choice('item_placement') # not supported in ER @@ -166,12 +178,13 @@ def roll_settings(weights): ret.standardize_palettes = get_choice('standardize_palettes') if 'standardize_palettes' in weights else 'standardize' goal = get_choice('goals') - ret.goal = {'ganon': 'ganon', - 'fast_ganon': 'crystals', - 'dungeons': 'dungeons', - 'pedestal': 'pedestal', - 'triforce-hunt': 'triforcehunt' - }[goal] + if goal is not None: + ret.goal = {'ganon': 'ganon', + 'fast_ganon': 'crystals', + 'dungeons': 'dungeons', + 'pedestal': 'pedestal', + 'triforce-hunt': 'triforcehunt' + }[goal] ret.openpyramid = goal == 'fast_ganon' if ret.shuffle in ['vanilla', 'dungeonsfull', 'dungeonssimple'] else False ret.shuffleganon = get_choice('shuffleganon') == 'on' @@ -183,14 +196,14 @@ def roll_settings(weights): ganon_item = get_choice('ganon_item') ret.ganon_item = ganon_item if ganon_item != 'none' else 'default' - if ret.goal == 'triforcehunt': - goal_min = get_choice_default('triforce_goal_min', default=20) - goal_max = get_choice_default('triforce_goal_max', default=20) - pool_min = get_choice_default('triforce_pool_min', default=30) - pool_max = get_choice_default('triforce_pool_max', default=30) - ret.triforce_goal = random.randint(int(goal_min), int(goal_max)) - min_diff = get_choice_default('triforce_min_difference', default=10) - ret.triforce_pool = random.randint(max(int(pool_min), ret.triforce_goal + int(min_diff)), int(pool_max)) + goal_min = get_choice_default('triforce_goal_min', default=20) + goal_max = get_choice_default('triforce_goal_max', default=20) + pool_min = get_choice_default('triforce_pool_min', default=30) + pool_max = get_choice_default('triforce_pool_max', default=30) + ret.triforce_goal = random.randint(int(goal_min), int(goal_max)) + min_diff = get_choice_default('triforce_min_difference', default=10) + ret.triforce_pool = random.randint(max(int(pool_min), ret.triforce_goal + int(min_diff)), int(pool_max)) + ret.mode = get_choice('world_state') if ret.mode == 'retro': ret.mode = 'open' @@ -201,14 +214,16 @@ def roll_settings(weights): ret.hints = get_choice('hints') == 'on' - ret.swords = {'randomized': 'random', - 'assured': 'assured', - 'vanilla': 'vanilla', - 'swordless': 'swordless', - 'pseudo': 'pseudo', - 'assured_pseudo': 'assured_pseudo', - 'bombs': 'bombs' - }[get_choice('weapons')] + swords = get_choice('weapons') + if sowrds is not None: + ret.swords = {'randomized': 'random', + 'assured': 'assured', + 'vanilla': 'vanilla', + 'swordless': 'swordless', + 'pseudo': 'pseudo', + 'assured_pseudo': 'assured_pseudo', + 'bombs': 'bombs' + }[swords] ret.difficulty = get_choice('item_pool') diff --git a/OWEdges.py b/OWEdges.py index b9064281..14849137 100644 --- a/OWEdges.py +++ b/OWEdges.py @@ -820,6 +820,7 @@ OWTileRegions = bidict({ 'Ice Cave Area': 0x37, 'Desert Pass Area': 0x3a, + 'Middle Aged Man': 0x3a, 'Desert Pass Southeast': 0x3a, 'Desert Pass Ledge': 0x3a, @@ -891,6 +892,7 @@ OWTileRegions = bidict({ 'Shield Shop Fence': 0x5a, 'Pyramid Area': 0x5b, + 'Pyramid Crack': 0x5b, 'Pyramid Exit Ledge': 0x5b, 'Pyramid Pass': 0x5b, @@ -1403,8 +1405,6 @@ OWExitTypes = { 'Zora Waterfall Water Drop', 'Bonk Rock Ledge Drop', 'Graveyard Ledge Drop', - 'River Bend Water Drop', - 'River Bend East Water Drop', 'Potion Shop Water Drop', 'Potion Shop Northeast Water Drop', 'Zora Approach Bottom Ledge Drop', @@ -1444,13 +1444,9 @@ OWExitTypes = { 'Dam Cliff Ledge Drop', 'Bombos Tablet Drop', 'Cave 45 Ledge Drop', - 'Lake Hylia Water Drop', 'Lake Hylia South Water Drop', - 'Lake Hylia Northeast Water Drop', - 'Lake Hylia Central Water Drop', 'Lake Hylia Island Water Drop', 'Desert Pass Ledge Drop', - 'Octoballoon Water Drop', 'Octoballoon Waterfall Water Drop', 'Dark Death Mountain Drop (West)', 'Dark Death Mountain Drop (East)', @@ -1460,7 +1456,6 @@ OWExitTypes = { 'Bumper Cave Ledge Drop', 'Bumper Cave Entrance Drop', 'Qirn Jump Water Drop', - 'Qirn Jump East Water Drop', 'Dark Witch Water Drop', 'Dark Witch Northeast Water Drop', 'Catfish Approach Bottom Ledge Drop', @@ -1483,6 +1478,8 @@ OWExitTypes = { 'Dark Bonk Rocks Cliff Ledge Drop', 'Bomb Shop Cliff Ledge Drop', 'Hammer Bridge South Cliff Ledge Drop', + 'Ice Lake Northeast Pier Hop', + 'Ice Lake Moat Bomb Jump', 'Ice Lake Area Cliff Ledge Drop', 'Ice Palace Island FAWT Ledge Drop', 'Hammer Bridge EC Cliff Water Drop', @@ -1499,10 +1496,8 @@ OWExitTypes = { 'Swamp Nook Cliff Ledge Drop', 'Swamp Cliff Ledge Drop', 'Ice Lake Water Drop', - 'Ice Lake Northeast Water Drop', 'Ice Lake Southwest Water Drop', 'Ice Lake Southeast Water Drop', - 'Bomber Corner Water Drop', 'Bomber Corner Waterfall Water Drop' ], 'OWTerrain': ['Lost Woods Bush (West)', @@ -1528,7 +1523,9 @@ OWExitTypes = { 'Graveyard Ladder (Bottom)', 'Graveyard Ladder (Top)', 'Kings Grave Inner Rocks', + 'River Bend Water Drop', 'River Bend West Pier', + 'River Bend East Water Drop', 'River Bend East Pier', 'Potion Shop Rock (South)', 'Potion Shop Rock (North)', @@ -1566,14 +1563,19 @@ OWExitTypes = { 'C Whirlpool Rock (Top)', 'Statues Water Entry', 'Statues Landing', + 'Lake Hylia Central Water Drop', 'Lake Hylia Central Island Pier', 'Lake Hylia Island Pier', + 'Lake Hylia Water Drop', 'Lake Hylia West Pier', + 'Lake Hylia Northeast Water Drop', 'Lake Hylia East Pier', 'Desert Pass Ladder (South)', 'Desert Pass Rocks (North)', 'Desert Pass Rocks (South)', 'Desert Pass Ladder (North)', + 'Middle Aged Man', + 'Octoballoon Water Drop', 'Octoballoon Pier', 'Skull Woods Bush Rock (East)', 'Skull Woods Bush Rock (West)', @@ -1590,6 +1592,7 @@ OWExitTypes = { 'Skull Woods Pass Rock (Bottom)', 'Dark Graveyard Bush (South)', 'Dark Graveyard Bush (North)', + 'Qirn Jump East Water Drop', 'Qirn Jump Pier', 'Dark Witch Rock (South)', 'Dark Witch Rock (North)', @@ -1597,6 +1600,7 @@ OWExitTypes = { 'Catfish Approach Rocks (East)', 'Village of Outcasts Pegs', 'Grassy Lawn Pegs', + 'Pyramid Crack', 'Broken Bridge Hammer Rock (South)', 'Broken Bridge Hammer Rock (North)', 'Broken Bridge Hookshot Gap', @@ -1617,11 +1621,12 @@ OWExitTypes = { 'Dark C Whirlpool Rock (Top)', 'Hype Cave Water Entry', 'Hype Cave Landing', + 'Ice Lake Northeast Water Drop', 'Ice Lake Northeast Pier', 'Ice Lake Moat Water Entry', - 'Ice Lake Northeast Pier Bomb Jump', 'Ice Palace Approach', 'Ice Palace Leave', + 'Bomber Corner Water Drop', 'Bomber Corner Pier' ], 'Portal': ['West Death Mountain Teleporter', diff --git a/OverworldShuffle.py b/OverworldShuffle.py index 8207d66b..cad95825 100644 --- a/OverworldShuffle.py +++ b/OverworldShuffle.py @@ -3,7 +3,7 @@ from BaseClasses import OWEdge, WorldType, RegionType, Direction, Terrain, PolSl from Regions import mark_dark_world_regions, mark_light_world_regions from OWEdges import OWTileRegions, OWTileGroups, OWEdgeGroups, OWExitTypes, OpenStd, parallel_links, IsParallel -__version__ = '0.2.1.2-u' +__version__ = '0.2.2.0-u' def link_overworld(world, player): # setup mandatory connections @@ -902,6 +902,7 @@ mandatory_connections = [# Intra-tile OW Connections ('Desert Pass Ledge Drop', 'Desert Pass Area'), ('Desert Pass Rocks (North)', 'Desert Pass Southeast'), #glove ('Desert Pass Rocks (South)', 'Desert Pass Area'), #glove + ('Middle Aged Man', 'Middle Aged Man'), ('Octoballoon Water Drop', 'Octoballoon Water'), #flippers ('Octoballoon Waterfall Water Drop', 'Octoballoon Water'), #flippers ('Octoballoon Pier', 'Octoballoon Area'), @@ -942,6 +943,7 @@ mandatory_connections = [# Intra-tile OW Connections ('Shield Shop Fence (Outer) Ledge Drop', 'Shield Shop Fence'), ('Shield Shop Fence (Inner) Ledge Drop', 'Shield Shop Area'), ('Pyramid Exit Ledge Drop', 'Pyramid Area'), + ('Pyramid Crack', 'Pyramid Crack'), ('Broken Bridge Hammer Rock (South)', 'Broken Bridge Northeast'), #hammer/glove ('Broken Bridge Hammer Rock (North)', 'Broken Bridge Area'), #hammer/glove ('Broken Bridge Hookshot Gap', 'Broken Bridge West'), #hookshot @@ -1023,7 +1025,8 @@ mandatory_connections = [# Intra-tile OW Connections ('Dark Bonk Rocks Cliff Ledge Drop', 'Dark Bonk Rocks Area'), ('Hammer Bridge South Cliff Ledge Drop', 'Hammer Bridge South Area'), ('Ice Lake Area Cliff Ledge Drop', 'Ice Lake Area'), - ('Ice Lake Northeast Pier Bomb Jump', 'Ice Lake Northeast Bank'), + ('Ice Lake Northeast Pier Hop', 'Ice Lake Northeast Bank'), + ('Ice Lake Moat Bomb Jump', 'Ice Lake Moat'), ('Dark C Whirlpool Cliff Ledge Drop', 'Dark C Whirlpool Area'), ('Dark C Whirlpool Outer Cliff Ledge Drop', 'Dark C Whirlpool Outer Area'), ('Hype Cliff Ledge Drop', 'Hype Cave Area'), diff --git a/Plando.py b/Plando.py index fa9fa848..77e1d77c 100755 --- a/Plando.py +++ b/Plando.py @@ -58,7 +58,7 @@ def main(args): fill_world(world, args.plando) - if world.get_entrance('Dam', 1).connected_region.name != 'Dam' or world.get_entrance('Swamp Palace', 1).connected_region.name != 'Swamp Palace (Entrance)': + if not (world.get_entrance('Dam', 1).connected_region.name in ['Dam', 'Swamp Portal'] and world.get_entrance('Swamp Palace', 1).connected_region.name in ['Swamp Portal', 'Dam']): world.swamp_patch_required[1] = True logger.info('Calculating playthrough.') diff --git a/README.md b/README.md index e09e2069..79a04f66 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,11 @@ This is a very new mode of LTTPR so the tools and info is very limited. - There is an [OW OWG Reference Sheet](https://zelda.codemann8.com/images/shared/ow-owg-reference-sheet.png) that shows all the in-logic places where boots/mirror clips and fake flippers are expected from the player. # Known Issues -(Updated 2021-08-26) +(Updated 2021-11-06) ### If you want to playtest this, know these things: -- Big Red Bomb may require bomb duping as ledge drops may be in the way of your path to the Pyramid Fairy crack -- If you fake flipper, beware of transitioning south. You could end up at the top of the waterfall in the southeast of either world. If you mistakenly drop down, it is important to NOT make any other movements and S+Q immediately when the game allows you to (might take several seconds, the game has to scroll back to the original point of water entry) or there will be a hardlock. Falling from the waterfall is avoidable but it is super easy to do as it is super close to the transition. -- In Crossed OW, there are some interesting bunny swimming situations that can occur, these are meant to be out-of-logic but beware of logic bugs around this area. But also, hardlocks can occur; if you take damage, be sure to S+Q immediately before moving in any direction, or you may get an infinite screen wrap glitch. +- If you fake flipper, beware of transitioning south. You could end up at the top of the waterfall in the southeast of either world. If you mistakenly drop down, it is important to know that altho the game may appear as frozen for a bit of time, the game is simply scrolling Link back to the original point of water entry. Upon "landing", you'll be able to S+Q properly. Falling from the waterfall is avoidable but it is super easy to do as it is super close to the transition. +- In Crossed OW, there are some interesting bunny swimming situations that can occur, these ARE in logic currently, just be careful and avoid taking a hit from an enemy. ### Known bugs: - Screens that loop on itself and also have free-standing items, the sprites are duplicated and can cause item duplication diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7098107e..c1a7a62c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -15,6 +15,17 @@ CLI: ```--bombbag``` # Bug Fixes and Notes. +* 0.5.1.5 + * Fix for hard pool capacity upgrades missing + * Bonk Fairy (Light) is no longer in logic for ER Standard and is forbidden to be a connector, so rain state isn't exitable + * Bug fix for retro + enemizer and arrows appearing under pots + * Added bombbag and shufflelinks to settings code + * Catobat fixes: + * Fairy refills in spoiler + * Subweights support in mystery + * More defaults for mystery weights + * Less camera jank for straight stair transitions + * Bug with Straight stairs with vanilla doors where Link's walking animation stopped early is fixed * 0.5.1.4 * Revert quadrant glitch fix for baserom * Fix for inverted diff --git a/Regions.py b/Regions.py index 26b3aeb7..a5d3309d 100644 --- a/Regions.py +++ b/Regions.py @@ -111,7 +111,8 @@ def create_regions(world, player): create_lw_region(player, 'Lake Hylia Island', ['Lake Hylia Island'], ['Lake Hylia Island Water Drop']), create_lw_region(player, 'Lake Hylia Water', None, ['Lake Hylia Central Island Pier', 'Lake Hylia Island Pier', 'Lake Hylia West Pier', 'Lake Hylia East Pier', 'Lake Hylia NC', 'Lake Hylia EC', 'Lake Hylia Whirlpool'], Terrain.Water), create_lw_region(player, 'Ice Cave Area', None, ['Ice Rod Cave', 'Good Bee Cave', '20 Rupee Cave', 'Shopping Mall Mirror Spot', 'Ice Cave SE', 'Ice Cave SW']), - create_lw_region(player, 'Desert Pass Area', ['Purple Chest'], ['Desert Pass Ladder (South)', 'Desert Fairy', '50 Rupee Cave', 'Swamp Nook Mirror Spot', 'Desert Pass WS', 'Desert Pass EC', 'Desert Pass Rocks (North)']), + create_lw_region(player, 'Desert Pass Area', ['Middle Aged Man'], ['Desert Pass Ladder (South)', 'Middle Aged Man', 'Desert Fairy', '50 Rupee Cave', 'Swamp Nook Mirror Spot', 'Desert Pass WS', 'Desert Pass EC', 'Desert Pass Rocks (North)']), + create_lw_region(player, 'Middle Aged Man', ['Purple Chest'], None), create_lw_region(player, 'Desert Pass Southeast', None, ['Desert Pass Rocks (South)', 'Swamp Nook Southeast Mirror Spot', 'Desert Pass ES']), create_lw_region(player, 'Desert Pass Ledge', None, ['Desert Pass Ladder (North)', 'Desert Pass Ledge Drop', 'Swamp Nook Pegs Mirror Spot', 'Desert Pass WC']), create_lw_region(player, 'Dam Area', ['Sunken Treasure'], ['Dam', 'Swamp Mirror Spot', 'Dam WC', 'Dam WS', 'Dam NC', 'Dam EC']), @@ -163,7 +164,8 @@ def create_regions(world, player): create_dw_region(player, 'Dark Grassy Lawn', None, ['Grassy Lawn Pegs', 'Dark World Shop', 'Kakariko Grass Mirror Spot']), create_dw_region(player, 'Shield Shop Area', None, ['Shield Shop Fence (Outer) Ledge Drop', 'Forgotton Forest Mirror Spot', 'Shield Shop NW', 'Shield Shop NE']), create_dw_region(player, 'Shield Shop Fence', None, ['Shield Shop Fence (Inner) Ledge Drop', 'Red Shield Shop', 'Forgotton Forest Fence Mirror Spot']), - create_dw_region(player, 'Pyramid Area', ['Pyramid'], ['Pyramid Fairy', 'Pyramid Hole', 'HC Ledge Mirror Spot', 'HC Courtyard Mirror Spot', 'HC Area Mirror Spot', 'HC East Entry Mirror Spot', 'Pyramid ES']), + create_dw_region(player, 'Pyramid Area', ['Pyramid'], ['Pyramid Fairy', 'Pyramid Crack', 'Pyramid Hole', 'HC Ledge Mirror Spot', 'HC Courtyard Mirror Spot', 'HC Area Mirror Spot', 'HC East Entry Mirror Spot', 'Pyramid ES']), + create_dw_region(player, 'Pyramid Crack', ['Pyramid Crack'], None), create_dw_region(player, 'Pyramid Exit Ledge', None, ['Pyramid Exit Ledge Drop', 'HC Courtyard Left Mirror Spot', 'Pyramid Entrance']), create_dw_region(player, 'Pyramid Pass', None, ['Post Aga Inverted Teleporter', 'HC Area South Mirror Spot', 'Pyramid SW', 'Pyramid SE']), create_dw_region(player, 'Broken Bridge Area', None, ['Broken Bridge Hammer Rock (South)', 'Broken Bridge Water Drop', 'Wooden Bridge Mirror Spot', 'Broken Bridge SW']), @@ -206,8 +208,8 @@ def create_regions(world, player): create_dw_region(player, 'Ice Lake Northeast Bank', None, ['Ice Lake Northeast Water Drop', 'Lake Hylia Northeast Mirror Spot', 'Ice Lake NE']), create_dw_region(player, 'Ice Lake Ledge (West)', None, ['Ice Lake Southwest Water Drop', 'South Shore Mirror Spot', 'Ice Lake WS']), create_dw_region(player, 'Ice Lake Ledge (East)', None, ['Ice Lake Southeast Water Drop', 'South Shore East Mirror Spot', 'Ice Lake ES']), - create_dw_region(player, 'Ice Lake Water', None, ['Ice Lake Northeast Pier', 'Lake Hylia Island Mirror Spot', 'Ice Lake NC', 'Ice Lake EC'], Terrain.Water), - create_dw_region(player, 'Ice Lake Moat', None, ['Ice Lake Moat Water Entry', 'Ice Lake Northeast Pier Bomb Jump', 'Ice Palace Approach', 'Lake Hylia Water Mirror Spot']), + create_dw_region(player, 'Ice Lake Water', None, ['Ice Lake Northeast Pier', 'Ice Lake Moat Bomb Jump', 'Lake Hylia Island Mirror Spot', 'Ice Lake NC', 'Ice Lake EC'], Terrain.Water), + create_dw_region(player, 'Ice Lake Moat', None, ['Ice Lake Moat Water Entry', 'Ice Lake Northeast Pier Hop', 'Ice Palace Approach', 'Lake Hylia Water Mirror Spot']), create_dw_region(player, 'Ice Palace Area', None, ['Ice Palace Leave', 'Ice Palace', 'Ice Palace Teleporter', 'Lake Hylia Central Island Mirror Spot']), create_dw_region(player, 'Shopping Mall Area', None, ['Dark Lake Hylia Ledge Fairy', 'Dark Lake Hylia Ledge Hint', 'Dark Lake Hylia Ledge Spike Cave', 'Ice Cave Mirror Spot', 'Shopping Mall SW', 'Shopping Mall SE']), create_dw_region(player, 'Swamp Nook Area', None, ['Desert Pass Ledge Mirror Spot', 'Desert Pass Mirror Spot', 'Swamp Nook EC', 'Swamp Nook ES']), @@ -268,7 +270,8 @@ def create_regions(world, player): create_cave_region(player, 'Tavern (Front)', 'the tavern'), create_cave_region(player, 'Hyrule Castle Secret Entrance', 'a drop\'s exit', ['Link\'s Uncle', 'Secret Passage'], ['Hyrule Castle Secret Entrance Exit']), create_cave_region(player, 'Sahasrahlas Hut', 'Sahasrahla', ['Sahasrahla\'s Hut - Left', 'Sahasrahla\'s Hut - Middle', 'Sahasrahla\'s Hut - Right', 'Sahasrahla']), - create_cave_region(player, 'Blacksmiths Hut', 'the smith', ['Blacksmith', 'Missing Smith']), + create_cave_region(player, 'Blacksmiths Hut', 'the smith', ['Blacksmith'], ['Missing Smith']), + create_cave_region(player, 'Missing Smith', None, ['Missing Smith']), create_cave_region(player, 'Bat Cave (right)', 'a drop\'s exit', ['Magic Bat'], ['Bat Cave Door']), create_cave_region(player, 'Bat Cave (left)', 'a drop\'s exit', None, ['Bat Cave Exit']), create_cave_region(player, 'Two Brothers House', 'a connector', None, ['Two Brothers House Exit (East)', 'Two Brothers House Exit (West)']), @@ -321,7 +324,7 @@ def create_regions(world, player): create_cave_region(player, 'Dark World Hammer Peg Cave', 'a cave with an item', ['Peg Cave']), create_cave_region(player, 'Archery Game', 'a game of skill'), create_cave_region(player, 'Bonk Fairy (Dark)', 'a fairy fountain'), - create_cave_region(player, 'Big Bomb Shop', 'the bomb shop'), + create_cave_region(player, 'Big Bomb Shop', 'the bomb shop', ['Big Bomb']), create_cave_region(player, 'Dark Lake Hylia Healer Fairy', 'a fairy fountain'), create_cave_region(player, 'East Dark World Hint', 'a storyteller'), create_cave_region(player, 'Hype Cave', 'a bounty of five items', ['Hype Cave - Top', 'Hype Cave - Middle Right', 'Hype Cave - Middle Left', @@ -1488,6 +1491,9 @@ location_table = {'Mushroom': (0x180013, 0x186338, False, 'in the woods'), 'Frog': (None, None, False, None), 'Missing Smith': (None, None, False, None), 'Dark Blacksmith Ruins': (None, None, False, None), + 'Big Bomb': (None, None, False, None), + 'Pyramid Crack': (None, None, False, None), + 'Middle Aged Man': (None, None, False, None), 'Trench 1 Switch': (None, None, False, None), 'Trench 2 Switch': (None, None, False, None), 'Swamp Drain': (None, None, False, None), diff --git a/Rom.py b/Rom.py index 212618bf..574d920b 100644 --- a/Rom.py +++ b/Rom.py @@ -33,7 +33,7 @@ from source.classes.SFX import randomize_sfx JAP10HASH = '03a63945398191337e896e5771f77173' -RANDOMIZERBASEHASH = '098cf0c6f15e162eeeb5e1740cc76792' +RANDOMIZERBASEHASH = 'ad69dddbfd546f665e730c2ee9ed3674' class JsonRom(object): @@ -1184,12 +1184,8 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False): ]) # set Fountain bottle exchange items - if world.difficulty[player] in ['hard', 'expert']: - rom.write_byte(0x348FF, [0x16, 0x2B, 0x2C, 0x2D, 0x3C, 0x48][random.randint(0, 5)]) - rom.write_byte(0x3493B, [0x16, 0x2B, 0x2C, 0x2D, 0x3C, 0x48][random.randint(0, 5)]) - else: - rom.write_byte(0x348FF, [0x16, 0x2B, 0x2C, 0x2D, 0x3C, 0x3D, 0x48][random.randint(0, 6)]) - rom.write_byte(0x3493B, [0x16, 0x2B, 0x2C, 0x2D, 0x3C, 0x3D, 0x48][random.randint(0, 6)]) + rom.write_byte(0x348FF, ItemFactory(world.bottle_refills[player][0], player).code) + rom.write_byte(0x3493B, ItemFactory(world.bottle_refills[player][1], player).code) #enable Fat Fairy Chests rom.write_bytes(0x1FC16, [0xB1, 0xC6, 0xF9, 0xC9, 0xC6, 0xF9]) @@ -1653,6 +1649,8 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False): rom.write_byte(0x180176, 0x0A if world.retro[player] else 0x00) # wood arrow cost rom.write_byte(0x180178, 0x32 if world.retro[player] else 0x00) # silver arrow cost rom.write_byte(0x301FC, 0xDA if world.retro[player] else 0xE1) # rupees replace arrows under pots + if enemized: + rom.write_byte(0x1B152e, 0xDA if world.retro[player] else 0xE1) rom.write_byte(0x30052, 0xDB if world.retro[player] else 0xE2) # replace arrows in fish prize from bottle merchant rom.write_bytes(0xECB4E, [0xA9, 0x00, 0xEA, 0xEA] if world.retro[player] else [0xAF, 0x77, 0xF3, 0x7E]) # Thief steals rupees instead of arrows rom.write_bytes(0xF0D96, [0xA9, 0x00, 0xEA, 0xEA] if world.retro[player] else [0xAF, 0x77, 0xF3, 0x7E]) # Pikit steals rupees instead of arrows @@ -1818,13 +1816,16 @@ def write_custom_shops(rom, world, player): loc_item = ItemFactory(item['item'], player) if (not world.shopsanity[player] and shop.region.name == 'Capacity Upgrade' and world.difficulty[player] != 'normal'): - continue # skip cap upgrades except in normal/shopsanity - item_id = loc_item.code - price = int16_as_bytes(item['price']) - replace = ItemFactory(item['replacement'], player).code if item['replacement'] else 0xFF - replace_price = int16_as_bytes(item['replacement_price']) + # really should be 5A instead of B0 -- surprise!!! + item_id, price, replace, replace_price, item_max = 0xB0, [0, 0], 0xFF, [0, 0], 1 + else: + item_id = loc_item.code + price = int16_as_bytes(item['price']) + replace = ItemFactory(item['replacement'], player).code if item['replacement'] else 0xFF + replace_price = int16_as_bytes(item['replacement_price']) + item_max = item['max'] item_player = 0 if item['player'] == player else item['player'] - item_data = [shop_id, item_id] + price + [item['max'], replace] + replace_price + [item_player] + item_data = [shop_id, item_id] + price + [item_max, replace] + replace_price + [item_player] items_data.extend(item_data) rom.write_bytes(0x184800, shop_data) diff --git a/Rules.py b/Rules.py index 86eff18f..6423e909 100644 --- a/Rules.py +++ b/Rules.py @@ -58,15 +58,6 @@ def set_rules(world, player): elif world.goal[player] == 'triforcehunt': add_rule(world.get_location('Murahdahla', player), lambda state: state.item_count('Triforce Piece', player) + state.item_count('Power Star', player) >= int(state.world.treasure_hunt_count[player])) - if world.mode[player] != 'inverted': - set_big_bomb_rules(world, player) - if world.logic[player] == 'owglitches' and world.shuffle[player] not in ('insanity', 'insanity_legacy'): - path_to_hc = mirrorless_path_to_location(world, 'West Death Mountain (Bottom)', 'Hyrule Castle Area', player) - path_to_courtyard = mirrorless_path_to_castle_courtyard(world, player) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.world.get_entrance('Dark Death Mountain Offset Mirror', player).can_reach(state) and all(rule(state) for rule in path_to_courtyard) and all(rule(state) for rule in path_to_hc), 'or') - else: - set_inverted_big_bomb_rules(world, player) - # if swamp and dam have not been moved we require mirror for swamp palace if not world.swamp_patch_required[player]: add_rule(world.get_entrance('Swamp Lobby Moat', player), lambda state: state.has_Mirror(player)) @@ -192,11 +183,14 @@ def global_rules(world, player): set_rule(world.get_location('Sunken Treasure', player), lambda state: state.has('Open Floodgate', player)) set_rule(world.get_location('Dark Blacksmith Ruins', player), lambda state: state.has('Return Smith', player)) - set_rule(world.get_location('Purple Chest', player), lambda state: state.has('Pick Up Purple Chest', player)) # Can S&Q with chest - set_rule(world.get_location('Ether Tablet', player), lambda state: state.has('Book of Mudora', player) and state.has_sword(player, 2)) + set_rule(world.get_location('Middle Aged Man', player), lambda state: state.has('Pick Up Purple Chest', player)) # Can S&Q with chest + set_rule(world.get_location('Purple Chest', player), lambda state: state.has('Deliver Purple Chest', player)) # Can S&Q with chest + set_rule(world.get_location('Big Bomb', player), lambda state: state.has('Crystal 5', player) and state.has('Crystal 6', player)) + set_rule(world.get_location('Pyramid Crack', player), lambda state: state.has('Pick Up Big Bomb', player)) + set_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has('Detonate Big Bomb', player)) set_rule(world.get_location('Master Sword Pedestal', player), lambda state: state.has('Red Pendant', player) and state.has('Blue Pendant', player) and state.has('Green Pendant', player)) - set_rule(world.get_location('Missing Smith', player), lambda state: state.has('Get Frog', player) and state.can_reach('Blacksmiths Hut', 'Region', player)) # Can't S&Q with smith + set_rule(world.get_location('Missing Smith', player), lambda state: state.has('Get Frog', player)) set_rule(world.get_location('Blacksmith', player), lambda state: state.has('Return Smith', player)) set_rule(world.get_location('Magic Bat', player), lambda state: state.has('Magic Powder', player)) set_rule(world.get_location('Sick Kid', player), lambda state: state.has_bottle(player)) @@ -619,27 +613,34 @@ def bomb_rules(world, player): 'Dark Lake Hylia Ledge Fairy', 'Hype Cave', 'Brewery'] for entrance in bonkable_doors: add_rule(world.get_entrance(entrance, player), lambda state: state.can_use_bombs(player) or state.has_Boots(player)) + add_bunny_rule(world.get_entrance(entrance, player), player) for entrance in bombable_doors: add_rule(world.get_entrance(entrance, player), lambda state: state.can_use_bombs(player)) + add_bunny_rule(world.get_entrance(entrance, player), player) bonkable_items = ['Sahasrahla\'s Hut - Left', 'Sahasrahla\'s Hut - Middle', 'Sahasrahla\'s Hut - Right'] bombable_items = ['Blind\'s Hideout - Top', 'Kakariko Well - Top', 'Chicken House', 'Aginah\'s Cave', 'Graveyard Cave', 'Paradox Cave Upper - Left', 'Paradox Cave Upper - Right', 'Hype Cave - Top', 'Hype Cave - Middle Right', 'Hype Cave - Middle Left', 'Hype Cave - Bottom'] for location in bonkable_items: - add_rule(world.get_location(location, player), lambda state: state.can_use_bombs(player) or state.has_Boots(player)) + add_rule(world.get_location(location, player), lambda state: state.can_use_bombs(player) or state.has_Boots(player)) + add_bunny_rule(world.get_location(location, player), player) for location in bombable_items: - add_rule(world.get_location(location, player), lambda state: state.can_use_bombs(player)) + add_rule(world.get_location(location, player), lambda state: state.can_use_bombs(player)) + add_bunny_rule(world.get_location(location, player), player) cave_kill_locations = ['Mini Moldorm Cave - Far Left', 'Mini Moldorm Cave - Far Right', 'Mini Moldorm Cave - Left', 'Mini Moldorm Cave - Right', 'Mini Moldorm Cave - Generous Guy', 'Spiral Cave'] for location in cave_kill_locations: add_rule(world.get_location(location, player), lambda state: state.can_kill_most_things(player) or state.can_use_bombs(player)) + add_bunny_rule(world.get_location(location, player), player) add_rule(world.get_entrance('Spiral Cave (top to bottom)', player), lambda state: state.can_kill_most_things(player) or state.can_use_bombs(player)) + add_bunny_rule(world.get_entrance('Spiral Cave (top to bottom)', player), player) paradox_switch_chests = ['Paradox Cave Lower - Far Left', 'Paradox Cave Lower - Left', 'Paradox Cave Lower - Right', 'Paradox Cave Lower - Far Right', 'Paradox Cave Lower - Middle'] for location in paradox_switch_chests: add_rule(world.get_location(location, player), lambda state: state.can_hit_crystal_through_barrier(player)) - + add_bunny_rule(world.get_location(location, player), player) + # Dungeon bomb logic easy_kill_rooms = [ # Door, bool-bombable ('Hyrule Dungeon Armory S', True), # One green guard @@ -696,7 +697,7 @@ def bomb_rules(world, player): if world.doorShuffle[player] == 'vanilla': add_rule(world.get_entrance('TR Lazy Eyes SE', player), lambda state: state.can_use_bombs(player)) # ToDo: Add always true for inverted, cross-entrance, and door-variants and so on. add_rule(world.get_entrance('Turtle Rock Ledge Exit (West)', player), lambda state: state.can_use_bombs(player)) # Is this the same as above? - + dungeon_bonkable = ['Sewers Rat Path WS', 'Sewers Rat Path WN', 'PoD Warp Hint SE', 'PoD Jelly Hall NW', 'PoD Jelly Hall NE', 'PoD Mimics 1 SW', 'Thieves Ambush E', 'Thieves Rail Ledge W', @@ -737,6 +738,7 @@ def default_rules(world, player): set_rule(world.get_location('Zora\'s Ledge', player), lambda state: state.has('Flippers', player)) set_rule(world.get_location('Potion Shop', player), lambda state: state.has('Mushroom', player)) set_rule(world.get_location('Flute Spot', player), lambda state: state.has('Shovel', player)) + set_rule(world.get_location('Ether Tablet', player), lambda state: state.has('Book of Mudora', player) and state.has_sword(player, 2)) set_rule(world.get_location('Bombos Tablet', player), lambda state: state.has('Book of Mudora', player) and state.has_sword(player, 2)) # Entrance Access @@ -1371,7 +1373,7 @@ def no_glitches_rules(world, player): def fake_flipper_rules(world, player): - set_rule(world.get_entrance('Waterfall of Wishing Cave Entry', player), lambda state: state.has('Flippers', player) or (state.has_Pearl(player) and state.can_reach('Lake Hylia Water', player))) + set_rule(world.get_entrance('Waterfall of Wishing Cave Entry', player), lambda state: True) # warning, assumes FF possible on other end of whirlpool or local ancilla splash delete set_rule(world.get_entrance('River Bend Water Drop', player), lambda state: True) set_rule(world.get_entrance('River Bend East Water Drop', player), lambda state: True) set_rule(world.get_entrance('Potion Shop Water Drop', player), lambda state: True) @@ -1642,6 +1644,7 @@ def standard_rules(world, player): add_rule(world.get_entrance('Hyrule Castle Main Gate (South)', player), lambda state: state.has('Zelda Delivered', player)) add_rule(world.get_entrance('Hyrule Castle Main Gate (North)', player), lambda state: state.has('Zelda Delivered', player)) add_rule(world.get_entrance('Hyrule Castle Ledge Drop', player), lambda state: state.has('Zelda Delivered', player)) + add_rule(world.get_entrance('Bonk Fairy (Light)', player), lambda state: state.has('Zelda Delivered', player)) # don't allow bombs to get past here before zelda is rescued set_rule(world.get_entrance('GT Hookshot South Entry to Ranged Crystal', player), lambda state: (state.can_use_bombs(player) and state.has('Zelda Delivered', player)) or state.has('Blue Boomerang', player) or state.has('Red Boomerang', player)) # or state.has('Cane of Somaria', player)) @@ -1673,440 +1676,6 @@ def find_rules_for_zelda_delivery(world, player): raise Exception('No path to Sanctuary found') -def set_big_bomb_rules(world, player): - # this is a mess - if len(world.get_region('Big Bomb Shop', player).entrances) > 0: - bombshop_entrance = world.get_region('Big Bomb Shop', player).entrances[0] - Normal_LW_entrances = ['Blinds Hideout', - 'Bonk Fairy (Light)', - 'Lake Hylia Fairy', - 'Light Hype Fairy', - 'Desert Fairy', - 'Chicken House', - 'Aginahs Cave', - 'Sahasrahlas Hut', - 'Cave Shop (Lake Hylia)', - 'Blacksmiths Hut', - 'Sick Kids House', - 'Lost Woods Gamble', - 'Fortune Teller (Light)', - 'Snitch Lady (East)', - 'Snitch Lady (West)', - 'Bush Covered House', - 'Tavern (Front)', - 'Light World Bomb Hut', - 'Kakariko Shop', - 'Mini Moldorm Cave', - 'Long Fairy Cave', - 'Good Bee Cave', - '20 Rupee Cave', - '50 Rupee Cave', - 'Ice Rod Cave', - 'Bonk Rock Cave', - 'Library', - 'Potion Shop', - 'Dam', - 'Lumberjack House', - 'Lake Hylia Fortune Teller', - 'Eastern Palace', - 'Kakariko Gamble Game', - 'Kakariko Well Cave', - 'Bat Cave Cave', - 'Elder House (East)', - 'Elder House (West)', - 'North Fairy Cave', - 'Lost Woods Hideout Stump', - 'Lumberjack Tree Cave', - 'Two Brothers House (East)', - 'Sanctuary', - 'Hyrule Castle Entrance (South)', - 'Hyrule Castle Secret Entrance Stairs'] - LW_walkable_entrances = ['Dark Lake Hylia Ledge Fairy', - 'Dark Lake Hylia Ledge Spike Cave', - 'Dark Lake Hylia Ledge Hint', - 'Mire Shed', - 'Dark Desert Hint', - 'Dark Desert Fairy', - 'Misery Mire'] - Northern_DW_entrances = ['Brewery', - 'C-Shaped House', - 'Chest Game', - 'Dark World Hammer Peg Cave', - 'Red Shield Shop', - 'Dark Sanctuary Hint', - 'Fortune Teller (Dark)', - 'Dark World Shop', - 'Dark World Lumberjack Shop', - 'Thieves Town', - 'Skull Woods First Section Door', - 'Skull Woods Second Section Door (East)'] - Southern_DW_entrances = ['Hype Cave', - 'Bonk Fairy (Dark)', - 'Archery Game', - 'Big Bomb Shop', - 'Dark Lake Hylia Shop', - 'Swamp Palace'] - Isolated_DW_entrances = ['Spike Cave', - 'Cave Shop (Dark Death Mountain)', - 'Dark Death Mountain Fairy', - 'Mimic Cave', - 'Skull Woods Second Section Door (West)', - 'Skull Woods Final Section', - 'Ice Palace', - 'Turtle Rock', - 'Dark Death Mountain Ledge (West)', - 'Dark Death Mountain Ledge (East)', - 'Bumper Cave (Top)', - 'Superbunny Cave (Top)', - 'Superbunny Cave (Bottom)', - 'Hookshot Cave', - 'Ganons Tower', - 'Turtle Rock Isolated Ledge Entrance', - 'Hookshot Cave Back Entrance'] - Isolated_LW_entrances = ['Capacity Upgrade', - 'Tower of Hera', - 'Death Mountain Return Cave (West)', - 'Paradox Cave (Top)', - 'Fairy Ascension Cave (Top)', - 'Spiral Cave', - 'Desert Palace Entrance (East)'] - West_LW_DM_entrances = ['Old Man Cave (East)', - 'Old Man House (Bottom)', - 'Old Man House (Top)', - 'Death Mountain Return Cave (East)', - 'Spectacle Rock Cave Peak', - 'Spectacle Rock Cave', - 'Spectacle Rock Cave (Bottom)'] - East_LW_DM_entrances = ['Paradox Cave (Bottom)', - 'Paradox Cave (Middle)', - 'Hookshot Fairy', - 'Spiral Cave (Bottom)'] - Mirror_from_SDW_entrances = ['Two Brothers House (West)', - 'Cave 45'] - Castle_ledge_entrances = ['Hyrule Castle Entrance (West)', - 'Hyrule Castle Entrance (East)', - 'Agahnims Tower'] - Desert_mirrorable_ledge_entrances = ['Desert Palace Entrance (West)', - 'Desert Palace Entrance (North)', - 'Desert Palace Entrance (South)', - 'Checkerboard Cave'] - - set_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_reach('Pyramid Area', 'Region', player) or state.can_reach('East Dark World', 'Region', player)) and state.can_reach('Big Bomb Shop', 'Region', player) and state.has('Crystal 5', player) and state.has('Crystal 6', player)) - - #crossing peg bridge starting from the southern dark world - def cross_peg_bridge(state): - return state.has('Hammer', player) and state.has_Pearl(player) - - # returning via the eastern and southern teleporters needs the same items, so we use the southern teleporter for out routing. - # crossing preg bridge already requires hammer so we just add the gloves to the requirement - def southern_teleporter(state): - return state.can_lift_rocks(player) and cross_peg_bridge(state) - - # the basic routes assume you can reach eastern light world with the bomb. - # you can then use the southern teleporter, or (if you have beaten Aga1) the hyrule castle gate warp - def basic_routes(state): - return southern_teleporter(state) or state.has('Beat Agahnim 1', player) - - # Key for below abbreviations: - # P = pearl - # A = Aga1 - # H = hammer - # M = Mirror - # G = Glove - - if bombshop_entrance.name in Normal_LW_entrances: - #1. basic routes - #2. Can reach Eastern dark world some other way, mirror, get bomb, return to mirror spot, walk to pyramid: Needs mirror - # -> M or BR - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: basic_routes(state) or state.has_Mirror(player)) - elif bombshop_entrance.name in LW_walkable_entrances: - #1. Mirror then basic routes - # -> M and BR - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has_Mirror(player) and basic_routes(state)) - elif bombshop_entrance.name in Northern_DW_entrances: - #1. Mirror and basic routes - #2. Go to south DW and then cross peg bridge: Need Mitts and hammer and moon pearl - # -> (Mitts and CPB) or (M and BR) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_lift_heavy_rocks(player) and cross_peg_bridge(state)) or (state.has_Mirror(player) and basic_routes(state))) - elif bombshop_entrance.name == 'Bumper Cave (Bottom)': - #1. Mirror and Lift rock and basic_routes - #2. Mirror and Flute and basic routes (can make difference if accessed via insanity or w/ mirror from connector, and then via hyrule castle gate, because no gloves are needed in that case) - #3. Go to south DW and then cross peg bridge: Need Mitts and hammer and moon pearl - # -> (Mitts and CPB) or (((G or Flute) and M) and BR)) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_lift_heavy_rocks(player) and cross_peg_bridge(state)) or (((state.can_lift_rocks(player) or state.can_flute(player)) and state.has_Mirror(player)) and basic_routes(state))) - elif bombshop_entrance.name in Southern_DW_entrances: - #1. Mirror and enter via gate: Need mirror and Aga1 - #2. cross peg bridge: Need hammer and moon pearl - # -> CPB or (M and A) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: cross_peg_bridge(state) or (state.has_Mirror(player) and state.has('Beat Agahnim 1', player))) - elif bombshop_entrance.name in Isolated_DW_entrances: - # 1. mirror then flute then basic routes - # -> M and Flute and BR - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has_Mirror(player) and state.can_flute(player) and basic_routes(state)) - elif bombshop_entrance.name in Isolated_LW_entrances: - # 1. flute then basic routes - # Prexisting mirror spot is not permitted, because mirror might have been needed to reach these isolated locations. - # -> Flute and BR - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_flute(player) and basic_routes(state)) - elif bombshop_entrance.name in West_LW_DM_entrances: - # 1. flute then basic routes or mirror - # Prexisting mirror spot is permitted, because flute can be used to reach west DM directly. - # -> Flute and (M or BR) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('West Death Mountain (Bottom)', 'Region', player)) - elif bombshop_entrance.name in East_LW_DM_entrances: - # 1. flute then basic routes or mirror and hookshot - # Prexisting mirror spot is permitted, because flute can be used to reach west DM directly and then east DM via Hookshot - # -> Flute and ((M and Hookshot) or BR) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('East Death Mountain (Bottom)', 'Region', player)) - elif bombshop_entrance.name == 'Fairy Ascension Cave (Bottom)': - # Same as East_LW_DM_entrances except navigation without BR requires Mitts - # -> Flute and ((M and Hookshot and Mitts) or BR) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('East Death Mountain (Bottom)', 'Region', player) and state.can_lift_heavy_rocks(player)) - elif bombshop_entrance.name in Castle_ledge_entrances: - # 1. mirror on pyramid to castle ledge, grab bomb, return through mirror spot: Needs mirror - # 2. flute then basic routes - # -> M or (Flute and BR) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('Hyrule Castle Ledge', 'Region', player)) - elif bombshop_entrance.name in Desert_mirrorable_ledge_entrances: - # Cases when you have mire access: Mirror to reach locations, return via mirror spot, move to center of desert, mirror anagin and: - # 1. Have mire access, Mirror to reach locations, return via mirror spot, move to center of desert, mirror again and then basic routes - # 2. flute then basic routes - # -> (Mire access and M) or Flute) and BR - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('Desert Ledge', 'Region', player)) - elif bombshop_entrance.name == 'Old Man Cave (West)': - # 1. Lift rock then basic_routes - # 2. flute then basic_routes - # -> (Flute or G) and BR - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('Death Mountain Entrance', 'Region', player)) - elif bombshop_entrance.name == 'Graveyard Cave': - # 1. flute then basic routes - # 2. (has west dark world access) use existing mirror spot (required Pearl), mirror again off ledge - # -> (Flute or (M and P and West Dark World access) and BR - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_flute(player) or (state.can_reach('Dark Graveyard Area', 'Region', player) and state.has_Pearl(player) and state.has_Mirror(player))) and basic_routes(state)) - elif bombshop_entrance.name in Mirror_from_SDW_entrances: - # 1. flute then basic routes - # 2. (has South dark world access) use existing mirror spot, mirror again off ledge - # -> (Flute or (M and South Dark World access) and BR - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_flute(player) or (state.can_reach('Pyramid Area', 'Region', player) and state.has_Mirror(player))) and basic_routes(state)) - elif bombshop_entrance.name == 'Dark World Potion Shop': - # 1. walk down by lifting rock: needs gloves and pearl` - # 2. walk down by hammering peg: needs hammer and pearl - # 3. mirror and basic routes - # -> (P and (H or Gloves)) or (M and BR) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('Dark Witch Area', 'Region', player)) - elif bombshop_entrance.name == 'Kings Grave': - # same as the Normal_LW_entrances case except that the pre-existing mirror is only possible if you have mitts - # (because otherwise mirror was used to reach the grave, so would cancel a pre-existing mirror spot) - # to account for insanity, must consider a way to escape without a cave for basic_routes - # -> (M and Mitts) or ((Mitts or Flute or (M and P and West Dark World access)) and BR) - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_lift_heavy_rocks(player) or state.can_flute(player) or (state.can_reach('Dark Graveyard Area', 'Region', player) and state.has_Pearl(player) and state.has_Mirror(player)))) - elif bombshop_entrance.name == 'Waterfall of Wishing': - # same as the Normal_LW_entrances case except in insanity it's possible you could be here without Flippers which - # means you need an escape route of either Flippers or Flute - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.has('Flippers', player) or state.can_flute(player))) - - #TODO: Fix red bomb rules, artifically adding a bunch of rules to help reduce unbeatable seeds in OW shuffle - set_rule(world.get_entrance('Pyramid Fairy', player), lambda state: False) - #add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_reach('Pyramid Area', 'Region', player)) - #add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_lift_heavy_rocks(player) and state.has('Flippers', player) and state.can_flute(player) and state.has('Hammer', player) and state.has('Hookshot', player) and state.has_Pearl(player) and state.has_Mirror(player))) - -def set_inverted_big_bomb_rules(world, player): - if len(world.get_region('Big Bomb Shop', player).entrances) > 0: - bombshop_entrance = world.get_region('Big Bomb Shop', player).entrances[0] - Normal_LW_entrances = ['Blinds Hideout', - 'Bonk Fairy (Light)', - 'Lake Hylia Fairy', - 'Light Hype Fairy', - 'Desert Fairy', - 'Chicken House', - 'Aginahs Cave', - 'Sahasrahlas Hut', - 'Cave Shop (Lake Hylia)', - 'Blacksmiths Hut', - 'Sick Kids House', - 'Lost Woods Gamble', - 'Fortune Teller (Light)', - 'Snitch Lady (East)', - 'Snitch Lady (West)', - 'Tavern (Front)', - 'Kakariko Shop', - 'Mini Moldorm Cave', - 'Long Fairy Cave', - 'Good Bee Cave', - '20 Rupee Cave', - '50 Rupee Cave', - 'Ice Rod Cave', - 'Bonk Rock Cave', - 'Library', - 'Potion Shop', - 'Dam', - 'Lumberjack House', - 'Lake Hylia Fortune Teller', - 'Eastern Palace', - 'Kakariko Gamble Game', - 'Kakariko Well Cave', - 'Bat Cave Cave', - 'Elder House (East)', - 'Elder House (West)', - 'North Fairy Cave', - 'Lost Woods Hideout Stump', - 'Lumberjack Tree Cave', - 'Two Brothers House (East)', - 'Sanctuary', - 'Hyrule Castle Entrance (South)', - 'Hyrule Castle Secret Entrance Stairs', - 'Hyrule Castle Entrance (West)', - 'Hyrule Castle Entrance (East)', - 'Ganons Tower', - 'Cave 45', - 'Checkerboard Cave', - 'Links House'] - Isolated_LW_entrances = ['Old Man Cave (East)', - 'Old Man House (Bottom)', - 'Old Man House (Top)', - 'Death Mountain Return Cave (East)', - 'Spectacle Rock Cave Peak', - 'Tower of Hera', - 'Death Mountain Return Cave (West)', - 'Paradox Cave (Top)', - 'Fairy Ascension Cave (Top)', - 'Spiral Cave', - 'Paradox Cave (Bottom)', - 'Paradox Cave (Middle)', - 'Hookshot Fairy', - 'Spiral Cave (Bottom)', - 'Mimic Cave', - 'Fairy Ascension Cave (Bottom)', - 'Desert Palace Entrance (West)', - 'Desert Palace Entrance (North)', - 'Desert Palace Entrance (South)'] - Eastern_DW_entrances = ['Palace of Darkness', - 'Palace of Darkness Hint', - 'Dark Lake Hylia Fairy', - 'East Dark World Hint'] - Northern_DW_entrances = ['Brewery', - 'C-Shaped House', - 'Chest Game', - 'Dark World Hammer Peg Cave', - 'Dark Sanctuary Hint', - 'Fortune Teller (Dark)', - 'Dark World Lumberjack Shop', - 'Thieves Town', - 'Skull Woods First Section Door', - 'Skull Woods Second Section Door (East)'] - Southern_DW_entrances = ['Hype Cave', - 'Bonk Fairy (Dark)', - 'Archery Game', - 'Big Bomb Shop', - 'Dark Lake Hylia Shop', - 'Swamp Palace'] - Isolated_DW_entrances = ['Spike Cave', - 'Cave Shop (Dark Death Mountain)', - 'Dark Death Mountain Fairy', - 'Skull Woods Second Section Door (West)', - 'Skull Woods Final Section', - 'Turtle Rock', - 'Dark Death Mountain Ledge (West)', - 'Dark Death Mountain Ledge (East)', - 'Bumper Cave (Top)', - 'Superbunny Cave (Top)', - 'Superbunny Cave (Bottom)', - 'Hookshot Cave', - 'Turtle Rock Isolated Ledge Entrance', - 'Hookshot Cave Back Entrance', - 'Agahnims Tower'] - LW_walkable_entrances = ['Dark Lake Hylia Ledge Fairy', - 'Dark Lake Hylia Ledge Spike Cave', - 'Dark Lake Hylia Ledge Hint', - 'Mire Shed', - 'Dark Desert Hint', - 'Dark Desert Fairy', - 'Misery Mire', - 'Red Shield Shop'] - LW_bush_entrances = ['Bush Covered House', - 'Light World Bomb Hut', - 'Graveyard Cave'] - LW_inaccessible_entrances = ['Desert Palace Entrance (East)', - 'Spectacle Rock Cave', - 'Spectacle Rock Cave (Bottom)'] - - set_rule(world.get_entrance('Pyramid Fairy', player), - lambda state: state.can_reach('Pyramid Area', 'Region', player) and state.can_reach('Big Bomb Shop', 'Region', player) and state.has('Crystal 5', player) and state.has('Crystal 6', player)) - - # Key for below abbreviations: - # P = pearl - # A = Aga1 - # H = hammer - # M = Mirror - # G = Glove - if bombshop_entrance.name in Eastern_DW_entrances: - # Just walk to the pyramid - pass - elif bombshop_entrance.name in Normal_LW_entrances: - # Just walk to the castle and mirror. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has_Mirror(player)) - elif bombshop_entrance.name in Isolated_LW_entrances: - # For these entrances, you cannot walk to the castle/pyramid and thus must use Mirror and then Flute. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_flute(player) and state.has_Mirror(player)) - elif bombshop_entrance.name in Northern_DW_entrances: - # You can just fly with the Flute, you can take a long walk with Mitts and Hammer, - # or you can leave a Mirror portal nearby and then walk to the castle to Mirror again. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_flute or (state.can_lift_heavy_rocks(player) and state.has('Hammer', player)) or (state.has_Mirror(player) and state.can_reach('Hyrule Castle Area', 'Region', player))) - elif bombshop_entrance.name in Southern_DW_entrances: - # This is the same as north DW without the Mitts rock present. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has('Hammer', player) or state.can_flute(player) or (state.has_Mirror(player) and state.can_reach('Hyrule Castle Area', 'Region', player))) - elif bombshop_entrance.name in Isolated_DW_entrances: - # There's just no way to escape these places with the bomb and no Flute. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_flute(player)) - elif bombshop_entrance.name in LW_walkable_entrances: - # You can fly with the flute, or leave a mirror portal and walk through the light world - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_flute(player) or (state.has_Mirror(player) and state.can_reach('Hyrule Castle Area', 'Region', player))) - elif bombshop_entrance.name in LW_bush_entrances: - # These entrances are behind bushes in LW so you need either Pearl or the tools to solve NDW bomb shop locations. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has_Mirror(player) and (state.can_flute(player) or state.has_Pearl(player) or (state.can_lift_heavy_rocks(player) and state.has('Hammer', player)))) - elif bombshop_entrance.name == 'Dark World Shop': - # This is mostly the same as NDW but the Mirror path requires the Pearl, or using the Hammer - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_flute or (state.can_lift_heavy_rocks(player) and state.has('Hammer', player)) or (state.has_Mirror(player) and state.can_reach('Hyrule Castle Area', 'Region', player) and (state.has_Pearl(player) or state.has('Hammer', player)))) - elif bombshop_entrance.name == 'Bumper Cave (Bottom)': - # This is mostly the same as NDW but the Mirror path requires being able to lift a rock. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_flute or (state.can_lift_heavy_rocks(player) and state.has('Hammer', player)) or (state.has_Mirror(player) and state.can_lift_rocks(player) and state.can_reach('Hyrule Castle Area', 'Region', player))) - elif bombshop_entrance.name == 'Old Man Cave (West)': - # The three paths back are Mirror and DW walk, Mirror and Flute, or LW walk and then Mirror. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has_Mirror(player) and ((state.can_lift_heavy_rocks(player) and state.has('Hammer', player)) or (state.can_lift_rocks(player) and state.has_Pearl(player)) or state.can_flute(player))) - elif bombshop_entrance.name == 'Dark World Potion Shop': - # You either need to Flute to 5 or cross the rock/hammer choice pass to the south. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.can_flute(player) or state.has('Hammer', player) or state.can_lift_rocks(player)) - elif bombshop_entrance.name == 'Kings Grave': - # Either lift the rock and walk to the castle to Mirror or Mirror immediately and Flute. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_flute(player) or (state.has_Pearl(player) and state.can_lift_heavy_rocks(player))) and state.has_Mirror(player)) - elif bombshop_entrance.name == 'Two Brothers House (West)': - # First you must Mirror. Then you can either Flute, cross the peg bridge, or use the Agah 1 portal to Mirror again. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_flute(player) or state.has('Hammer', player) or state.has('Beat Agahnim 1', player)) and state.has_Mirror(player)) - elif bombshop_entrance.name == 'Waterfall of Wishing': - # You absolutely must be able to swim to return it from here. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has('Flippers', player) and state.has_Pearl(player) and state.has_Mirror(player)) - elif bombshop_entrance.name == 'Ice Palace': - # You can swim to the dock or use the Flute to get off the island. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: state.has('Flippers', player) or state.can_flute(player)) - elif bombshop_entrance.name == 'Capacity Upgrade': - # You must Mirror but then can use either Ice Palace return path. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.has('Flippers', player) or state.can_flute(player)) and state.has_Mirror(player)) - elif bombshop_entrance.name == 'Two Brothers House (West)': - # First you must Mirror. Then you can either Flute, cross the peg bridge, or use the Agah 1 portal to Mirror again. - add_rule(world.get_entrance('Pyramid Fairy', player), lambda state: (state.can_flute(player) or state.has('Hammer', player) or state.has('Beat Agahnim 1', player)) and state.has_Mirror(player)) - elif bombshop_entrance.name in LW_inaccessible_entrances: - # You can't get to the pyramid from these entrances without bomb duping. - raise Exception('No valid path to open Pyramid Fairy. (Could not route from %s)' % bombshop_entrance.name) - elif bombshop_entrance.name == 'Pyramid Fairy': - # Self locking. The shuffles don't put the bomb shop here, but doesn't lock anything important. - set_rule(world.get_entrance('Pyramid Fairy', player), lambda state: False) - else: - raise Exception('No logic found for routing from %s to the pyramid.' % bombshop_entrance.name) - - if world.owShuffle[player] != 'vanilla' or world.owMixed[player] or world.owCrossed[player] not in ['none', 'polar']: - set_rule(world.get_entrance('Pyramid Fairy', player), lambda state: False) #temp disable progression until routing to Pyramid get be guaranteed - - def set_bunny_rules(world, player, inverted): # regions for the exits of multi-entrace caves/drops that bunny cannot pass @@ -2117,7 +1686,7 @@ def set_bunny_rules(world, player, inverted): 'Checkerboard Cave', 'Potion Shop', 'Spectacle Rock Cave', 'Pyramid', 'Hype Cave - Generous Guy', 'Peg Cave', 'Bumper Cave Ledge', 'Dark Blacksmith Ruins', 'Spectacle Rock', 'Bombos Tablet', 'Ether Tablet', 'Purple Chest', 'Blacksmith', - 'Missing Smith', 'Master Sword Pedestal', 'Bottle Merchant', 'Sunken Treasure', 'Desert Ledge', + 'Missing Smith', 'Pyramid Crack', 'Big Bomb', 'Master Sword Pedestal', 'Bottle Merchant', 'Sunken Treasure', 'Desert Ledge', 'Kakariko Shop - Left', 'Kakariko Shop - Middle', 'Kakariko Shop - Right', 'Lake Hylia Shop - Left', 'Lake Hylia Shop - Middle', 'Lake Hylia Shop - Right', 'Potion Shop - Left', 'Potion Shop - Middle', 'Potion Shop - Right', diff --git a/Utils.py b/Utils.py index 8a4eabcf..7d9f5ead 100644 --- a/Utils.py +++ b/Utils.py @@ -318,6 +318,10 @@ def update_deprecated_args(args): if args: argVars = vars(args) truthy = [1, True, "True", "true"] + if "multi" in argVars: + players = int(args.multi) + else: + players = 1 # Hints default to FALSE # Don't do: Yes # Do: No @@ -351,6 +355,16 @@ def update_deprecated_args(args): if "create_rom" in argVars: args.suppress_rom = not args.create_rom in truthy + # Shuffle Ganon defaults to TRUE + # Don't do: Yes + # Do: No + if "no_shuffleganon" in argVars: + if isinstance(args.shuffleganon, dict): + for player in range(1, players + 1): + args.shuffleganon[player] = not args.no_shuffleganon in truthy + else: + args.shuffleganon = not args.no_shuffleganon in truthy + # Playthrough defaults to TRUE # Don't do: Yes # Do: No diff --git a/asm/doorrando.asm b/asm/doorrando.asm index fe0cc415..7a6c926c 100644 --- a/asm/doorrando.asm +++ b/asm/doorrando.asm @@ -9,6 +9,7 @@ ; Normal doors use $FE to store the trap door indicator ; Normal doors use $045e to store Y coordinate when transitioning to in-room stairs ; Normal doors use $045f to determine the order in which supertile quadrants are drawn +; Straight stairs use $046d to store X coordinate on animation start ; Spiral doors use $045e to store stair type ; Gfx uses $b1 to for sub-sub-sub-module thing diff --git a/asm/doortables.asm b/asm/doortables.asm index eae16430..90678ca3 100644 --- a/asm/doortables.asm +++ b/asm/doortables.asm @@ -681,6 +681,8 @@ db $00,$07,$20,$20,$07,$07,$07,$07,$07,$20,$20,$07,$20,$20,$20,$20 db $07,$07,$02,$02,$02,$02,$07,$07,$07,$20,$20,$07,$20,$20,$20,$07 ;27f300 +DungeonTilesets: +db $04,$04,$05,$12,$04,$08,$07,$0C,$09,$0B,$05,$0A,$0D,$0E,$06,$06 ; ;org $27ff00 diff --git a/asm/normal.asm b/asm/normal.asm index 3bdf9622..13323d88 100644 --- a/asm/normal.asm +++ b/asm/normal.asm @@ -150,15 +150,14 @@ LoadRoomVert: .notEdge lda $01 : and #$03 : cmp #$03 : bne .normal jsr ScrollToInroomStairs + stz $046d bra .end .normal ldy #$01 : jsr ShiftVariablesMainDir jsr PrepScrollToNormal .scroll - lda $01 : and #$40 : pha + lda $01 : and #$40 : sta $046d jsr ScrollX - pla : beq .end - ldy #$00 : jsr ApplyScroll .end plb ; restore db register rts @@ -291,6 +290,11 @@ StraightStairsAdj: stx $0464 : sty $012e ; what we wrote over lda.l DRMode : beq + lda $045e : bne .toInroom + lda $046d : beq .noScroll + sta $22 + ldy #$00 : jsr ApplyScroll + stz $046d + .noScroll jsr GetTileAttribute : tax lda $11 : cmp #$12 : beq .goingNorth lda $a2 : cmp #$51 : bne ++ @@ -338,9 +342,10 @@ db $d0, $f6, $10, $1a, $f0, $00 StraightStairsFix: { + pha lda.l DRMode : bne + - !add $20 : sta $20 ;what we wrote over - + rtl + pla : !add $20 : sta $20 : rtl ;what we wrote over + + pla : rtl } StraightStairLayerFix: diff --git a/asm/owrando.asm b/asm/owrando.asm index d4a5ebd1..283c358f 100644 --- a/asm/owrando.asm +++ b/asm/owrando.asm @@ -130,9 +130,11 @@ OWWorldCheck16: OWWhirlpoolUpdate: { jsl $02ea6c ; what we wrote over - lda.l OWFlags : and #$01 : beq + - ldx $8a : jsr OWWorldUpdate - + rtl + lda.l OWFlags : and #$01 : bne + + lda.l OWMode+1 : and #$02 : beq .return + + ldx $8a : jsr OWWorldUpdate + .return + rtl } OWFluteCancel: @@ -358,6 +360,11 @@ OWNewDestination: .return lda $05 : sta $8a + ;bra + + ; nop #8 + ; jsl $02EA41 + ; nop #8 + ;+ rep #$30 : rts } OWWorldUpdate: ; x = owid of destination screen diff --git a/asm/scroll.asm b/asm/scroll.asm index f66918c8..435b5c98 100644 --- a/asm/scroll.asm +++ b/asm/scroll.asm @@ -168,7 +168,11 @@ ScrollX: ;change the X offset variables pla : sta $00 sep #$30 - lda $04 : sta $22 + lda $04 : ldx $046d : bne .straight + sta $22 : bra + + .straight + sta $046d ; set X position later + + lda $00 : sta $23 : sta $0609 : sta $060d lda $01 : sta $a9 lda $0e : asl : ora $ac : sta $ac diff --git a/data/base2current.bps b/data/base2current.bps index a333f536..ce5c9e1e 100644 Binary files a/data/base2current.bps and b/data/base2current.bps differ diff --git a/mystery_example.yml b/mystery_example.yml index 3ac5950b..d6fa1eb5 100644 --- a/mystery_example.yml +++ b/mystery_example.yml @@ -50,6 +50,7 @@ restricted: 2 full: 2 lite: 2 + lean: 2 crossed: 3 insanity: 1 shufflelinks: diff --git a/mystery_example_subweights.yml b/mystery_example_subweights.yml new file mode 100644 index 00000000..1ec43cac --- /dev/null +++ b/mystery_example_subweights.yml @@ -0,0 +1,57 @@ + description: Example for subweights + glitches_required: none + world_state: open + goals: ganon + weapons: randomized + entrance_shuffle: none + intensity: 3 + subweights: + vanilla: + chance: 25 + weights: + door_shuffle: vanilla + keydropshuffle: + on: 40 + off: 60 + basic: + chance: 25 + weights: + door_shuffle: basic + keydropshuffle: + on: 70 + off: 30 + crossed: + chance: 25 + weights: + door_shuffle: crossed + keydropshuffle: + on: 90 + off: 10 + chaos: + chance: 25 + weights: + door_shuffle: crossed + entrance_shuffle: + none: 30 + crossed: 70 + keydropshuffle: + on: 90 + off: 10 + shopsanity: + on: 50 + off: 50 + bombbag: + on: 25 + off: 75 + subweights: + normal: + chance: 40 + weights: {} + swordless: + chance: 20 + weights: + weapons: swordless + keysanity: + chance: 40 + weights: + dungeon_items: full diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index b6c56165..91dc20d2 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -381,13 +381,13 @@ "help": "suppress" }, "shuffleganon": { - "action": "store_false", - "type": "bool" + "action": "store_true", + "type": "bool", + "help": "suppress" }, "no_shuffleganon": { "action": "store_true", - "dest": "shuffleganon", - "help": "suppress" + "dest": "shuffleganon" }, "shufflelinks": { "action": "store_true", diff --git a/resources/app/cli/lang/en.json b/resources/app/cli/lang/en.json index ba6e7ef0..dbf5b88c 100644 --- a/resources/app/cli/lang/en.json +++ b/resources/app/cli/lang/en.json @@ -186,10 +186,10 @@ " connect remaining entrances.", "Full: Mix cave and dungeon entrances freely while limiting", " multi-entrance caves to one world.", - "Lite: Entrances are put into separate pools based on their", - " vanilla location. Dungeons, dropdowns, connector caves,", - " and locations that have an item are shuffled from", - " individual pools. Non-item locations remain vanilla.", + "Lite: Beginner-friendly. Dungeons/connectors, dropdowns, and", + " item locations are shuffled in separate pools. Non-item", + " locations remain vanilla. Connectors are same-world.", + "Lean: Same as Lite, except connectors can travel cross worlds.", "Crossed: Mix cave and dungeon entrances freely while allowing", " caves to cross between worlds.", "Insanity: Decouple entrances and exits from each other and", @@ -313,7 +313,7 @@ "Keys are universal, shooting arrows costs rupees,", "and a few other little things make this more like Zelda-1. (default: %(default)s)" ], - "pseudoboots": [ " Players starts with pseudo boots that allow dashing but no item checks (default: %(default)s"], + "pseudoboots": [ " Players starts with pseudo boots that allow dashing but no item checks (default: %(default)s)"], "bombbag": ["Start with 0 bomb capacity. Two capacity upgrades (+10) are added to the pool (default: %(default)s)" ], "startinventory": [ "Specifies a list of items that will be in your starting inventory (separated by commas). (default: %(default)s)" ], "usestartinventory": [ "Toggle usage of Starting Inventory." ], @@ -327,8 +327,8 @@ "None: You will be able to reach enough locations to beat the game." ], "hints": [ "Make telepathic tiles and storytellers give helpful hints. (default: %(default)s)" ], - "shuffleganon": [ - "Include the Ganon's Tower and Pyramid Hole in the", + "no_shuffleganon": [ + "Don't include the Ganon's Tower and Pyramid Hole in the", "entrance shuffle pool. (default: %(default)s)" ], "shufflelinks": [