From b1bbf92c6d9a1f6586eba6370f4fb64a5efac0b1 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 9 Nov 2021 16:13:01 -0600 Subject: [PATCH 1/7] Better approach for Links House/Bomb Shop ER hint --- Rom.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Rom.py b/Rom.py index 42d990ed..a5b95c56 100644 --- a/Rom.py +++ b/Rom.py @@ -2186,8 +2186,15 @@ def write_strings(rom, world, player, team): entrances_to_hint.update(OtherEntrances) elif world.shopsanity[player]: entrances_to_hint.update(ShopEntrances) - if world.shufflelinks[player] and world.shuffle[player] not in ['vanilla', 'dungeonssimple', 'dungeonsfull']: - entrances_to_hint.update({'Links House': 'The hero\'s old residence'}) + if world.shuffle[player] not in ['vanilla', 'dungeonssimple', 'dungeonsfull']: + if world.mode[player] == 'inverted' != (0x2c in world.owswaps[player][0] and world.owMixed[player]): + entrances_to_hint.update({'Links House': 'The hero\'s old residence'}) + if world.shufflelinks[player]: + entrances_to_hint.update({'Big Bomb Shop': 'The old bomb shop'}) + else: + entrances_to_hint.update({'Big Bomb Shop': 'The old bomb shop'}) + if world.shufflelinks[player]: + entrances_to_hint.update({'Links House': 'The hero\'s old residence'}) entrances_to_hint.update({'Dark Sanctuary Hint': 'The dark sanctuary cave'}) if world.shuffle[player] in ['insanity', 'madness_legacy', 'insanity_legacy']: entrances_to_hint.update(InsanityEntrances) @@ -2760,8 +2767,7 @@ ItemEntrances = {'Blinds Hideout': 'Blind\'s old house', 'Spike Cave': 'The ledge cave on west dark DM', 'Hype Cave': 'The cave south of the old bomb shop', 'Brewery': 'The Village of Outcasts building with no door', - 'Chest Game': 'The westmost building in the Village of Outcasts', - 'Big Bomb Shop': 'The old bomb shop' + 'Chest Game': 'The westmost building in the Village of Outcasts' } ShopEntrances = {'Cave Shop (Lake Hylia)': 'The cave NW Lake Hylia', From 8c05a3bd35094548c00d3278694b9c6ce2181ac6 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 9 Nov 2021 17:30:16 -0600 Subject: [PATCH 2/7] Fixed issue with Whirlpool Shuffle with Grouped OW Crossed --- OverworldShuffle.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OverworldShuffle.py b/OverworldShuffle.py index dfce3ccb..a25cbeff 100644 --- a/OverworldShuffle.py +++ b/OverworldShuffle.py @@ -153,7 +153,8 @@ def link_overworld(world, player): logging.getLogger('').debug('Crossing overworld edges') if world.owCrossed[player] in ['grouped', 'limited', 'chaos']: if world.owCrossed[player] == 'grouped': - crossed_edges = shuffle_tiles(world, tile_groups, [[],[],[]], player) + ow_crossed_tiles = [[],[],[]] + crossed_edges = shuffle_tiles(world, tile_groups, ow_crossed_tiles, player) elif world.owCrossed[player] in ['limited', 'chaos']: crossed_edges = list() crossed_candidates = list() @@ -202,12 +203,16 @@ def link_overworld(world, player): connect_simple(world, from_whirlpool, to_region, player) connect_simple(world, to_whirlpool, from_region, player) else: - if world.owCrossed[player] != 'none' or world.get_region(from_region, player).type == RegionType.LightWorld: + if (world.owCrossed[player] == 'none' and (world.get_region(from_region, player).type == RegionType.LightWorld)) \ + or (world.owCrossed[player] == 'grouped' and ((from_owid < 0x40) == (from_owid not in ow_crossed_tiles[0]))) \ + or world.owCrossed[player] not in ['none', 'grouped']: whirlpool_candidates[0].append(tuple((from_owid, from_whirlpool, from_region))) else: whirlpool_candidates[1].append(tuple((from_owid, from_whirlpool, from_region))) - if world.owCrossed[player] != 'none' or world.get_region(to_region, player).type == RegionType.LightWorld: + if (world.owCrossed[player] == 'none' and (world.get_region(to_region, player).type == RegionType.LightWorld)) \ + or (world.owCrossed[player] == 'grouped' and ((to_owid < 0x40) == (to_owid not in ow_crossed_tiles[0]))) \ + or world.owCrossed[player] not in ['none', 'grouped']: whirlpool_candidates[0].append(tuple((to_owid, to_whirlpool, to_region))) else: whirlpool_candidates[1].append(tuple((to_owid, to_whirlpool, to_region))) @@ -447,7 +452,7 @@ def shuffle_tiles(world, groups, result_list, player): exist_dw_regions.extend(dw_regions) # check whirlpool parity - valid_whirlpool_parity = world.owCrossed[player] != 'none' or len(set(new_results[0]) & set({0x0f, 0x12, 0x15, 0x33, 0x35, 0x3f, 0x55, 0x7f})) % 2 == 0 + valid_whirlpool_parity = world.owCrossed[player] not in ['none', 'grouped'] or len(set(new_results[0]) & set({0x0f, 0x12, 0x15, 0x33, 0x35, 0x3f, 0x55, 0x7f})) % 2 == 0 (exist_owids, exist_lw_regions, exist_dw_regions) = result_list exist_owids.extend(new_results[0]) From e31f41e7a9194f6b1b9cb66e046d8bdb64c012ff Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 9 Nov 2021 17:40:31 -0600 Subject: [PATCH 3/7] Fixed issue with Whirlpool Shuffle with Grouped OW Crossed --- OverworldShuffle.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OverworldShuffle.py b/OverworldShuffle.py index a25cbeff..a422b45a 100644 --- a/OverworldShuffle.py +++ b/OverworldShuffle.py @@ -204,15 +204,15 @@ def link_overworld(world, player): connect_simple(world, to_whirlpool, from_region, player) else: if (world.owCrossed[player] == 'none' and (world.get_region(from_region, player).type == RegionType.LightWorld)) \ - or (world.owCrossed[player] == 'grouped' and ((from_owid < 0x40) == (from_owid not in ow_crossed_tiles[0]))) \ - or world.owCrossed[player] not in ['none', 'grouped']: + or world.owCrossed[player] not in ['none', 'grouped'] \ + or (world.owCrossed[player] == 'grouped' and ((from_owid < 0x40) == (from_owid not in ow_crossed_tiles[0]))): whirlpool_candidates[0].append(tuple((from_owid, from_whirlpool, from_region))) else: whirlpool_candidates[1].append(tuple((from_owid, from_whirlpool, from_region))) if (world.owCrossed[player] == 'none' and (world.get_region(to_region, player).type == RegionType.LightWorld)) \ - or (world.owCrossed[player] == 'grouped' and ((to_owid < 0x40) == (to_owid not in ow_crossed_tiles[0]))) \ - or world.owCrossed[player] not in ['none', 'grouped']: + or world.owCrossed[player] not in ['none', 'grouped'] \ + or (world.owCrossed[player] == 'grouped' and ((to_owid < 0x40) == (to_owid not in ow_crossed_tiles[0]))): whirlpool_candidates[0].append(tuple((to_owid, to_whirlpool, to_region))) else: whirlpool_candidates[1].append(tuple((to_owid, to_whirlpool, to_region))) From 796171ab4dc882ff640a374d6d44d358bcc5c92c Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 9 Nov 2021 18:46:06 -0600 Subject: [PATCH 4/7] Fixed issue with Whirlpool Shuffle with Grouped OW Crossed --- OverworldShuffle.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/OverworldShuffle.py b/OverworldShuffle.py index a422b45a..0f3b2a5e 100644 --- a/OverworldShuffle.py +++ b/OverworldShuffle.py @@ -197,28 +197,31 @@ def link_overworld(world, player): connect_simple(world, to_whirlpool, from_region, player) else: whirlpool_candidates = [[],[]] + world.owwhirlpools[player] = [None] * 8 for (from_owid, from_whirlpool, from_region), (to_owid, to_whirlpool, to_region) in default_whirlpool_connections: if world.owCrossed[player] == 'polar' and world.owMixed[player] and from_owid == 0x55: # connect the 2 DW whirlpools in Polar Mixed connect_simple(world, from_whirlpool, to_region, player) connect_simple(world, to_whirlpool, from_region, player) + world.owwhirlpools[player][7] = from_owid + world.owwhirlpools[player][6] = to_owid + world.spoiler.set_overworld(from_whirlpool, to_whirlpool, 'both', player) else: - if (world.owCrossed[player] == 'none' and (world.get_region(from_region, player).type == RegionType.LightWorld)) \ - or world.owCrossed[player] not in ['none', 'grouped'] \ + if ((world.owCrossed[player] == 'none' or (world.owCrossed[player] == 'polar' and not world.owMixed[player])) and (world.get_region(from_region, player).type == RegionType.LightWorld)) \ + or world.owCrossed[player] not in ['none', 'polar', 'grouped'] \ or (world.owCrossed[player] == 'grouped' and ((from_owid < 0x40) == (from_owid not in ow_crossed_tiles[0]))): whirlpool_candidates[0].append(tuple((from_owid, from_whirlpool, from_region))) else: whirlpool_candidates[1].append(tuple((from_owid, from_whirlpool, from_region))) - if (world.owCrossed[player] == 'none' and (world.get_region(to_region, player).type == RegionType.LightWorld)) \ - or world.owCrossed[player] not in ['none', 'grouped'] \ + if ((world.owCrossed[player] == 'none' or (world.owCrossed[player] == 'polar' and not world.owMixed[player])) and (world.get_region(to_region, player).type == RegionType.LightWorld)) \ + or world.owCrossed[player] not in ['none', 'polar', 'grouped'] \ or (world.owCrossed[player] == 'grouped' and ((to_owid < 0x40) == (to_owid not in ow_crossed_tiles[0]))): whirlpool_candidates[0].append(tuple((to_owid, to_whirlpool, to_region))) else: whirlpool_candidates[1].append(tuple((to_owid, to_whirlpool, to_region))) # shuffle happens here - world.owwhirlpools[player] = [None] * 8 whirlpool_map = [ 0x35, 0x0f, 0x15, 0x33, 0x12, 0x3f, 0x55, 0x7f ] for whirlpools in whirlpool_candidates: random.shuffle(whirlpools) From 9db079fbbe8597b232548ad5a412f27285a51b2f Mon Sep 17 00:00:00 2001 From: codemann8 Date: Tue, 9 Nov 2021 18:57:45 -0600 Subject: [PATCH 5/7] Fixed Mystery filename to not spoil OWR --- Main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Main.py b/Main.py index 0b0443f0..f0b8be7c 100644 --- a/Main.py +++ b/Main.py @@ -130,8 +130,8 @@ def main(args, seed=None, fish=None): for player, name in enumerate(team, 1): world.player_names[player].append(name) logger.info('') - - if world.owShuffle[1] != 'vanilla' or world.owCrossed[1] not in ['none', 'polar'] or world.owMixed[1] or str(world.seed).startswith('M'): + + if world.owShuffle[1] != 'vanilla' or world.owCrossed[1] not in ['none', 'polar'] or world.owMixed[1] or str(args.outputname).startswith('M'): outfilebase = f'OR_{args.outputname if args.outputname else world.seed}' else: outfilebase = f'DR_{args.outputname if args.outputname else world.seed}' From d92f5382bddc08a639d8900d7892ba3a9f2cc242 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Thu, 11 Nov 2021 17:15:41 -0600 Subject: [PATCH 6/7] Fixed Triforce Hunt goal --- Rules.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rules.py b/Rules.py index 688e63da..aebc5fd7 100644 --- a/Rules.py +++ b/Rules.py @@ -56,7 +56,8 @@ def set_rules(world, player): # require aga2 to beat ganon add_rule(world.get_location('Ganon', player), lambda state: state.has('Beat Agahnim 2', 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 ('Murahdahla', player) in world._location_cache: + 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 swamp and dam have not been moved we require mirror for swamp palace if not world.swamp_patch_required[player]: From 48699036ed3fdf1f13b8298bf2968f5d73dc75a4 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Thu, 11 Nov 2021 17:33:20 -0600 Subject: [PATCH 7/7] Version bump 0.2.2.2 --- CHANGELOG.md | 5 +++++ OverworldShuffle.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 866c1d9e..d47f7c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +### 0.2.2.2 +- Fixed Whirlpool Shuffle with Grouped Crossed OW +- Made filename not spoil OWR in Mystery +- Fixed Triforce Hunt goal + ### 0.2.2.1 - Allow normal Link speed with Old Man following if not in his cave or WDM - Fixed issue with Flute exits not getting placed on the correct tiles diff --git a/OverworldShuffle.py b/OverworldShuffle.py index 0f3b2a5e..65236379 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.2.1-u' +__version__ = '0.2.2.2-u' def link_overworld(world, player): # setup mandatory connections