From d23d2d8323a82141b9a282b7b5de74037c21adc5 Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 24 Feb 2023 15:45:37 -0700 Subject: [PATCH 01/10] Better support for customized start_inverntory with dungeon items (can be mixed with item pool) --- ItemList.py | 17 ++++++++++++++--- KeyDoorShuffle.py | 6 ++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ItemList.py b/ItemList.py index b708b284..53524e6c 100644 --- a/ItemList.py +++ b/ItemList.py @@ -1014,8 +1014,19 @@ item_alternates = { def modify_pool_for_start_inventory(start_inventory, world, player): - # skips custom item pools - these shouldn't be adjusted if (world.customizer and world.customizer.get_item_pool()) or world.custom: + # custom item pools only adjust in dungeon items + for item in start_inventory: + if item.dungeon: + d = world.get_dungeon(item.dungeon, item.player) + match = next((i for i in d.all_items if i.name == item.name), None) + if match: + if match.map or match.compass: + d.dungeon_items.remove(match) + elif match.smallkey: + d.small_keys.remove(match) + elif match.bigkey and d.big_key == match: + d.big_key = None return for item in start_inventory: if item.player == player: @@ -1041,8 +1052,8 @@ def modify_pool_for_start_inventory(start_inventory, world, player): d.dungeon_items.remove(match) elif match.smallkey: d.small_keys.remove(match) - elif match.bigkey: - d.big_key.remove(match) + elif match.bigkey and d.big_key == match: + d.big_key = None def make_custom_item_pool(world, player, progressive, shuffle, difficulty, timer, goal, mode, swords, bombbag, customitemarray): diff --git a/KeyDoorShuffle.py b/KeyDoorShuffle.py index 2a39f38c..f8bda68e 100644 --- a/KeyDoorShuffle.py +++ b/KeyDoorShuffle.py @@ -2094,6 +2094,12 @@ def validate_key_placement(key_layout, world, player): if world.bigkeyshuffle[player]: max_counter = find_max_counter(key_layout) big_key_outside = bigkey_name not in (l.item.name for l in max_counter.free_locations if l.item) + for i in world.precollected_items: + if i.player == player and i.name == bigkey_name: + big_key_outside = True + break + if i.player == player and i.name == smallkey_name: + keys_outside += 1 for code, counter in key_layout.key_counters.items(): if len(counter.child_doors) == 0: From 7397d779ad8c87cb184b9c2cdc6af932705422b1 Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 24 Feb 2023 16:20:29 -0700 Subject: [PATCH 02/10] Changing colorizing pots defaults --- BaseClasses.py | 2 +- CLI.py | 2 +- Rom.py | 5 ++--- source/tools/MysteryUtils.py | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index dd39cfc9..0dc89695 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -142,7 +142,7 @@ class World(object): set_player_attr('pot_contents', None) set_player_attr('pseudoboots', False) set_player_attr('collection_rate', False) - set_player_attr('colorizepots', False) + set_player_attr('colorizepots', True) set_player_attr('pot_pool', {}) set_player_attr('decoupledoors', False) set_player_attr('door_type_mode', 'original') diff --git a/CLI.py b/CLI.py index 536543f2..d1bc47d3 100644 --- a/CLI.py +++ b/CLI.py @@ -205,7 +205,7 @@ def parse_settings(): 'keydropshuffle': False, 'dropshuffle': False, 'pottery': 'none', - 'colorizepots': False, + 'colorizepots': True, 'shufflepots': False, 'mapshuffle': False, 'compassshuffle': False, diff --git a/Rom.py b/Rom.py index 1dd05a8f..6be923da 100644 --- a/Rom.py +++ b/Rom.py @@ -1585,9 +1585,8 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False): Room0127.write_to_rom(snes_to_pc(0x2B8000), rom) if world.pot_contents[player]: - colorize_pots = is_mystery or (world.pottery[player] not in ['vanilla', 'lottery'] - and (world.colorizepots[player] - or world.pottery[player] in ['reduced', 'clustered'])) + colorize_pots = (world.pottery[player] != 'vanilla' + and (world.colorizepots[player] or world.pottery[player] in ['reduced', 'clustered'])) if world.pot_contents[player].size() > 0x2800: raise Exception('Pot table is too big for current area') world.pot_contents[player].write_pot_data_to_rom(rom, colorize_pots) diff --git a/source/tools/MysteryUtils.py b/source/tools/MysteryUtils.py index 322ed447..2bdcdcd7 100644 --- a/source/tools/MysteryUtils.py +++ b/source/tools/MysteryUtils.py @@ -102,7 +102,7 @@ def roll_settings(weights): ret.dropshuffle = get_choice('dropshuffle') == 'on' or keydropshuffle ret.pottery = get_choice('pottery') if 'pottery' in weights else 'none' ret.pottery = 'keys' if ret.pottery == 'none' and keydropshuffle else ret.pottery - ret.colorizepots = get_choice('colorizepots') == 'on' + ret.colorizepots = get_choice_default('colorizepots', default='on') == 'on' ret.shufflepots = get_choice('pot_shuffle') == 'on' ret.mixed_travel = get_choice('mixed_travel') if 'mixed_travel' in weights else 'prevent' ret.standardize_palettes = (get_choice('standardize_palettes') if 'standardize_palettes' in weights From 6c0da515b440827c40050d9d916b1d51d899eb16 Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 24 Feb 2023 17:00:25 -0700 Subject: [PATCH 03/10] Fix dungeon_only + pottery modes --- source/item/FillUtil.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/item/FillUtil.py b/source/item/FillUtil.py index 0252673f..f581f3fb 100644 --- a/source/item/FillUtil.py +++ b/source/item/FillUtil.py @@ -3,7 +3,7 @@ import logging from collections import defaultdict from source.item.District import resolve_districts -from BaseClasses import PotItem, PotFlags +from BaseClasses import PotItem, PotFlags, LocationType from DoorShuffle import validate_vanilla_reservation from Dungeons import dungeon_table from Items import item_table, ItemFactory @@ -82,8 +82,8 @@ def create_item_pool_config(world): if pot.item not in [PotItem.Key, PotItem.Hole, PotItem.Switch]: item = pot_items[pot.item] descriptor = 'Large Block' if pot.flags & PotFlags.Block else f'Pot #{pot_index+1}' - location = f'{pot.room} {descriptor}' - config.static_placement[player][item].append(location) + loc = f'{pot.room} {descriptor}' + config.static_placement[player][item].append(loc) if world.shopsanity[player]: for item, locs in shop_vanilla_mapping.items(): config.static_placement[player][item].extend(locs) @@ -164,6 +164,10 @@ def create_item_pool_config(world): mode_grouping['Heart Containers'] + mode_grouping['GT Trash'] + mode_grouping['Small Keys'] + mode_grouping['Compasses'] + mode_grouping['Maps'] + mode_grouping['Key Drops'] + mode_grouping['Pot Keys'] + mode_grouping['Big Key Drops']) + dungeon_set = set(dungeon_set) + for loc in world.get_locations(): + if loc.parent_region.dungeon and loc.type in [LocationType.Pot, LocationType.Drop]: + dungeon_set.add(loc.name) for player in range(1, world.players + 1): config.item_pool[player] = determine_major_items(world, player) config.location_groups[0].locations = set(dungeon_set) From 3047826808deb0d5feebefb34945d8d56c4d52d8 Mon Sep 17 00:00:00 2001 From: aerinon Date: Mon, 27 Feb 2023 14:41:43 -0700 Subject: [PATCH 04/10] Fix AllowAccidentalGlitches flag --- Rom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rom.py b/Rom.py index 6be923da..5b137612 100644 --- a/Rom.py +++ b/Rom.py @@ -1489,7 +1489,7 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False): rom.write_byte(0x1800A3, 0x01) # enable correct world setting behaviour after agahnim kills rom.write_byte(0x1800A4, 0x01 if world.logic[player] != 'nologic' else 0x00) # enable POD EG fix rom.write_byte(0x180042, 0x01 if world.save_and_quit_from_boss else 0x00) # Allow Save and Quit after boss kill - rom.write_byte(0x180358, 0x01 if world.logic[player] == 'nologic' else 0x00) + rom.write_byte(0x180358, 0x01 if (world.logic[player] in ['owglitches', 'nologic']) else 0x00) # remove shield from uncle rom.write_bytes(0x6D253, [0x00, 0x00, 0xf6, 0xff, 0x00, 0x0E]) From 1dc3b13449fa3fbcee462e70a7e97d7aaa231f90 Mon Sep 17 00:00:00 2001 From: aerinon Date: Mon, 27 Feb 2023 14:42:52 -0700 Subject: [PATCH 05/10] Change info message to debug for cleaner output Possible generation error --- DungeonGenerator.py | 2 +- Rules.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DungeonGenerator.py b/DungeonGenerator.py index e429719a..f97f8ecf 100644 --- a/DungeonGenerator.py +++ b/DungeonGenerator.py @@ -3572,7 +3572,7 @@ def check_for_valid_layout(builder, sector_list, builder_info): builder.exception_list = list(sector_list) return True, {}, package except (GenerationException, NeutralizingException, OtherGenException) as e: - logging.getLogger('').info(f'Bailing on this layout for {builder.name}', exc_info=1) + logging.getLogger('').debug(f'Bailing on this layout for {builder.name}', exc_info=1) builder.split_dungeon_map = None builder.valid_proposal = None if temp_builder.name == 'Hyrule Castle' and temp_builder.throne_door: diff --git a/Rules.py b/Rules.py index ed6367dd..5015c019 100644 --- a/Rules.py +++ b/Rules.py @@ -2110,6 +2110,8 @@ def eval_small_key_door_main(state, door_name, dungeon, player): if state.is_door_open(door_name, player): return True key_logic = state.world.key_logic[player][dungeon] + if door_name not in key_logic.door_rules: + return False door_rule = key_logic.door_rules[door_name] door_openable = False for ruleType, number in door_rule.new_rules.items(): From a75b36e2eb7d1e4388f3e2eaa994c71e9a27ce7d Mon Sep 17 00:00:00 2001 From: aerinon Date: Wed, 1 Mar 2023 16:23:03 -0700 Subject: [PATCH 06/10] ER2 Minor issues --- source/overworld/EntranceShuffle2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/overworld/EntranceShuffle2.py b/source/overworld/EntranceShuffle2.py index a89e6085..51a702dd 100644 --- a/source/overworld/EntranceShuffle2.py +++ b/source/overworld/EntranceShuffle2.py @@ -1630,7 +1630,7 @@ default_dw = { 'Palace of Darkness Exit', 'Swamp Palace Exit', 'Turtle Rock Exit (Front)', 'Turtle Rock Ledge Exit (West)', 'Turtle Rock Ledge Exit (East)', 'Turtle Rock Isolated Ledge Exit', 'Bumper Cave Exit (Top)', 'Bumper Cave Exit (Bottom)', 'Superbunny Cave Exit (Top)', 'Superbunny Cave Exit (Bottom)', - 'Hookshot Cave Front Exit', 'Hookshot Cave Back Exit', 'Ganons Tower Exit', 'Pyramid Exit', + 'Hookshot Cave Front Exit', 'Hookshot Cave Back Exit', 'Ganons Tower Exit', 'Pyramid Exit', 'Bonk Fairy (Dark)', 'Dark Lake Hylia Healer Fairy', 'Dark Lake Hylia Ledge Healer Fairy', 'Dark Desert Healer Fairy', 'Dark Death Mountain Healer Fairy', 'Cave Shop (Dark Death Mountain)', 'Pyramid Fairy', 'East Dark World Hint', 'Palace of Darkness Hint', 'Big Bomb Shop', 'Village of Outcasts Shop', 'Dark Lake Hylia Shop', @@ -1653,7 +1653,7 @@ default_lw = { 'Spectacle Rock Cave Exit (Top)', 'Spectacle Rock Cave Exit (Peak)', 'Paradox Cave Exit (Bottom)', 'Paradox Cave Exit (Middle)', 'Paradox Cave Exit (Top)', 'Fairy Ascension Cave Exit (Bottom)', 'Fairy Ascension Cave Exit (Top)', 'Spiral Cave Exit', 'Spiral Cave Exit (Top)', 'Waterfall of Wishing', 'Dam', - 'Blinds Hideout', 'Lumberjack House', 'Bonk Fairy (Light)', 'Bonk Fairy (Dark)', 'Lake Hylia Healer Fairy', + 'Blinds Hideout', 'Lumberjack House', 'Bonk Fairy (Light)', 'Lake Hylia Healer Fairy', 'Swamp Healer Fairy', 'Desert Healer Fairy', 'Fortune Teller (Light)', 'Lake Hylia Fortune Teller', 'Kings Grave', 'Tavern', 'Chicken House', 'Aginahs Cave', 'Sahasrahlas Hut', 'Cave Shop (Lake Hylia)', 'Capacity Upgrade', 'Blacksmiths Hut', 'Sick Kids House', 'Lost Woods Gamble', 'Snitch Lady (East)', 'Snitch Lady (West)', 'Bush Covered House', @@ -1698,7 +1698,7 @@ DW_Entrances = ['Bumper Cave (Bottom)', 'Superbunny Cave (Top)', 'Superbunny Ca 'Dark Lake Hylia Ledge Hint', 'Chest Game', 'Dark Desert Fairy', 'Dark Lake Hylia Ledge Fairy', 'Fortune Teller (Dark)', 'Dark World Hammer Peg Cave', 'Pyramid Entrance', 'Skull Woods First Section Door', 'Skull Woods Second Section Door (East)', - 'Skull Woods Second Section Door (West)', + 'Skull Woods Second Section Door (West)', 'Ganons Tower', 'Inverted Dark Sanctuary', 'Inverted Links House', 'Inverted Agahnims Tower'] LW_Must_Exit = ['Desert Palace Entrance (East)'] From 00b06c53d64eb9832507148008e31f061b3c82e0 Mon Sep 17 00:00:00 2001 From: aerinon Date: Wed, 1 Mar 2023 16:28:47 -0700 Subject: [PATCH 07/10] Rom updates and version update --- Main.py | 2 +- RELEASENOTES.md | 8 ++++++++ Rom.py | 2 +- data/base2current.bps | Bin 93908 -> 93872 bytes 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Main.py b/Main.py index 7266628d..52073cce 100644 --- a/Main.py +++ b/Main.py @@ -34,7 +34,7 @@ from source.overworld.EntranceShuffle2 import link_entrances_new from source.tools.BPS import create_bps_from_data from source.classes.CustomSettings import CustomSettings -__version__ = '1.2.0.9-u' +__version__ = '1.2.0.10u' from source.classes.BabelFish import BabelFish diff --git a/RELEASENOTES.md b/RELEASENOTES.md index d5a492b1..6cb841e6 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -108,6 +108,14 @@ These are now independent of retro mode and have three options: None, Random, an * Bonk Fairy (Dark) # Bug Fixes and Notes +* 1.2.0.10u + * Fixed overrun issues with edge transitions + * Better support for customized start_inventory with dungeon items + * Colorized pots now available with lottery. Default is on. + * Dungeon_only support pottery + * Fix AllowAccidentalGlitches flag in OWG + * Potential fix for mirror portal and entering cave on same frame + * A few other minor issues, generation and graphical * 1.2.0.9-u * Disallowed standard exits (due to ER) are now graphically half blocked instead of missing * Graphical issues with Sanctuary and Swamp Hub lobbies are fixed diff --git a/Rom.py b/Rom.py index 5b137612..0d9b0849 100644 --- a/Rom.py +++ b/Rom.py @@ -37,7 +37,7 @@ from source.dungeon.RoomList import Room0127 JAP10HASH = '03a63945398191337e896e5771f77173' -RANDOMIZERBASEHASH = '67279b96a589f09e3ba8393a5bc5f071' +RANDOMIZERBASEHASH = 'd981a1fc7408ecbb30fa44135c7239b7' class JsonRom(object): diff --git a/data/base2current.bps b/data/base2current.bps index be3d11ea1f94a232964df475e95479bc094ec0cc..b5582c3f917243a2eedb422ae856bbf82f7f21cd 100644 GIT binary patch delta 3335 zcmW+&3s@6Z+MY9+gd~J}2q~ft1E}dw6}-@B6)Cl=i#M#TYZWzG*alN8uC}YL!kNH; z0b(xGa3B#0mvIOb6N+23zbq81CEee@*|zR(-SyF8?JC=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-9Gl zjV3WHMo5d*VrmRS>nI?^*`qQdBB!q-s2`P2dw)UDqr81FUphX#WgaC6F=M(f4VxPs zj}e@KkNec8pe~6XL#V-{GP&*W3p0M}xQ9vlEnaQMZ^wh2xcR57cVbad6RLh85iWsI zUL1-CnOig8Q$ug&=T(-l+Udoo0>>Iy7qSI{*zikxFNhTP<^50<9+$Zm^^|znWw`tu zJL|%GSX^mmb31MAt3I!SE0`I_I|9jOdtj&49w@Nl`3WFZQ`pW%(9+|lvuT94CV(t3 z1J@>i%s5xGvjZ0#fET+yuNux0X&1hj0Jf-@IO$=D058YMdayEKBSx_{K8lFQ3O3?U zTt?sPF?f$2%%MlUg0cFqUg7MBSrmLP8LnOpJx-Tw=cZh-T}fLpuLpAt6&ZRMD6C<1 zffSwJEh^}a=AP^XJf;V0HqF`3oY36&GR!h*F;T;XQit~1PMmiC&EQB+>TFMg z9=n2Oup0KNJBmI+A$!*f|<3X6V z#BP5xNc7dRgkbYkn7N>%k-~X}b~`C%`&UtYy%AHNI3-*Tim`o@q;^kNUQS?--y@L05$?>)SkUp6A!LQBp9jZ?oZaspPGdqNnaV9S%vfa)uO3@q#3fqIxwk5q`|6 z=?i#s5}-Au`b6m2w(VqK%>jHg31k}d1*doMPqBACka_QJU9f zdgzFd$;my%`0yNH*X^&Yx#IF!94#8FrA1gaq@{rZkn8iYJ{8O-cfE#RNCoT20|zlo zmHxvK97+Y9WbPKcnE~r`2dj^}Evu}-VBeCZuE4&b(+to7vhe+(zBKU9d?o&QO~oU9 HciH~|=+T7u From 2f61dceb0e6af90ba7aec2bd70400a5a9c43164d Mon Sep 17 00:00:00 2001 From: codemann8 Date: Fri, 3 Mar 2023 20:29:19 -0600 Subject: [PATCH 08/10] Placing Sanc Drop in DW if HC in DW and non-crossworld --- source/overworld/EntranceShuffle2.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/overworld/EntranceShuffle2.py b/source/overworld/EntranceShuffle2.py index fe3a2f89..349af41c 100644 --- a/source/overworld/EntranceShuffle2.py +++ b/source/overworld/EntranceShuffle2.py @@ -442,14 +442,18 @@ def do_holes_and_linked_drops(entrances, exits, avail, cross_world, keep_togethe hole_targets.append((target_exit, target_drop)) random.shuffle(hole_entrances) - if not cross_world and avail.is_sanc_forced_in_hc() and 'Sanctuary Grave' in holes_to_shuffle: - lw_entrance = next(entrance for entrance in hole_entrances if entrance[0] in LW_Entrances) - hole_entrances.remove(lw_entrance) + if not cross_world and 'Sanctuary Grave' in holes_to_shuffle: + hc = avail.world.get_entrance('Hyrule Castle Exit (South)', avail.player) + if hc.connected_region and hc.connected_region.type == RegionType.DarkWorld: + chosen_entrance = next(entrance for entrance in hole_entrances if entrance[0] in DW_Entrances) + if not chosen_entrance: + chosen_entrance = next(entrance for entrance in hole_entrances if entrance[0] in LW_Entrances) + hole_entrances.remove(chosen_entrance) sanc_interior = next(target for target in hole_targets if target[0] == 'Sanctuary Exit') hole_targets.remove(sanc_interior) - connect_two_way(lw_entrance[0], sanc_interior[0], avail) # two-way exit - connect_entrance(lw_entrance[1], sanc_interior[1], avail) # hole - remove_from_list(entrances, [lw_entrance[0], lw_entrance[1]]) + connect_two_way(chosen_entrance[0], sanc_interior[0], avail) # two-way exit + connect_entrance(chosen_entrance[1], sanc_interior[1], avail) # hole + remove_from_list(entrances, [chosen_entrance[0], chosen_entrance[1]]) remove_from_list(exits, [sanc_interior[0], sanc_interior[1]]) random.shuffle(hole_targets) From cc84c4e9b441d22ce2d2c767f3e063d835889d69 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 5 Mar 2023 01:26:24 -0600 Subject: [PATCH 09/10] Adding OWR Tile Flip to Customizer --- OverworldShuffle.py | 51 ++++++++++++++++++++++++++++---- docs/Customizer.md | 29 ++++++++++++++---- docs/customizer_example.yaml | 8 +++++ docs/standardinverted.yaml | 10 +++++++ source/classes/CustomSettings.py | 6 ++++ 5 files changed, 93 insertions(+), 11 deletions(-) create mode 100644 docs/standardinverted.yaml diff --git a/OverworldShuffle.py b/OverworldShuffle.py index c73c5ea6..0854d1e1 100644 --- a/OverworldShuffle.py +++ b/OverworldShuffle.py @@ -632,17 +632,56 @@ def shuffle_tiles(world, groups, result_list, do_grouped, player): parity[5] -= 1 group_parity[group[0]] = parity - attempts = 1000 + # customizer adjustments + undefined_chance = 50 + flipped_groups = list() + always_removed = list() + if world.customizer: + if not do_grouped: + custom_flips = world.customizer.get_owtileflips() + if custom_flips: + nonflipped_groups = list() + forced_flips = list() + forced_nonflips = list() + player_key = player + if 'undefined_chance' in custom_flips[player_key]: + undefined_chance = custom_flips[player_key]['undefined_chance'] + if 'force_flip' in custom_flips[player_key]: + forced_flips = custom_flips[player_key]['force_flip'] + if 'force_no_flip' in custom_flips[player_key]: + forced_nonflips = custom_flips[player_key]['force_no_flip'] + + for group in groups: + if any(owid in group[0] for owid in forced_nonflips): + nonflipped_groups.append(group) + if any(owid in group[0] for owid in forced_flips): + flipped_groups.append(group) + + # Check if there are any groups that appear in both sets + if any(group in flipped_groups for group in nonflipped_groups): + raise GenerationException('Conflict found when flipping tiles') + + for g in nonflipped_groups: + always_removed.append(g) + if undefined_chance == 0: + for g in [g for g in groups if g not in flipped_groups + always_removed]: + always_removed.append(g) + + attempts = 1 + if 0 < undefined_chance < 100: + # do roughly 1000 attempts at a full list + attempts = len(groups) - len(always_removed) + attempts = (attempts ** 1.9) + (attempts * 10) + 1 while True: if attempts == 0: # expected to only occur with custom flips raise GenerationException('Could not find valid tile flips') # tile shuffle happens here - removed = list() - for group in groups: - #if 0x1b in group[0] or 0x13 in group[0] or (0x1a in group[0] and world.owCrossed[player] == 'none'): # TODO: Standard + Inverted - if random.randint(0, 1): - removed.append(group) + removed = copy.deepcopy(always_removed) + if 0 < undefined_chance < 100: + for group in [g for g in groups if g not in always_removed]: + if group not in flipped_groups and random.randint(1, 100) > undefined_chance: + removed.append(group) # save shuffled tiles to list new_results = [[],[],[]] diff --git a/docs/Customizer.md b/docs/Customizer.md index b95081bd..9e45635a 100644 --- a/docs/Customizer.md +++ b/docs/Customizer.md @@ -86,7 +86,30 @@ You may define an item, and a list of locations. The locations may be weighted i #### NotPlacementGroup You may define an item and a list of locations that an item should not be placed at. This will apply to all items of that type. The logic is considered for this. If it is otherwise impossible, the item will be considered for the listed locations. This is important for small key layouts mostly, but it will try other locations first. - + +### ow-tileflips + +This must be defined by player. Each player number should be listed with the appropriate sections and each of these players MUST have `ow_mixed: true` in the `settings` section in order for any values here to take effect. This section has three primary subsections: `force_flip`, `force_no_flip`, and `undefined`. + +#### force_flip / force_no_flip + +`force_flip` and `force_no_flip` should be used for tiles you want to flip or not flip. These sections are optional but must contain a list of OW Screen IDs. It is common to reference OW Screen IDs in hexadecimal (altho decimal is okay to use, if preferred), which range from: + 0x00 to 0x3f - Light World + 0x40 to 0x7f - Dark World + 0x80 - Pedestal/Hobo + 0x81 - Zoras Domain + +Here is an example which forces Links House and Sanctuary screens to stay in their original worlds. Note: It is unnecessary to supply both worlds' IDs. Links House is 0x2c and Big Bomb Shop is 0x6c. +``` +force_no_flip: + - 0x2c + - 0x13 +``` + +#### undefined_chance + +`undefined_chance` should be used to determine how to handle all the remaining tiles that aren't explicitly defined in the earlier step. This represents the percent chance a tile will flip. This value can be set from 0 to 100 (default is 50). A value of 0 means there is a 0% chance it will be flipped. + ### entrances This must be defined by player. Each player number should be listed with the appropriate sections. This section has three primary subsections: `entrances`, `exits`, and `two-way`. @@ -111,10 +134,6 @@ This must be defined by player. Each player number should be listed with the app `Chicken House: Kakariko Shop` if you walk into Chicken House door, you will in the Kakariko Shop. -##### Known Issues - -Chris Houlihan and Links House should be specified together or not at all. - ### doors This must be defined by player. Each player number should be listed with the appropriate sections. This section has three primary subsections: `lobbies` and `doors`. diff --git a/docs/customizer_example.yaml b/docs/customizer_example.yaml index 3d0c7624..188c17d6 100644 --- a/docs/customizer_example.yaml +++ b/docs/customizer_example.yaml @@ -61,6 +61,14 @@ placements: Palace of Darkness - Big Chest: Hammer Capacity Upgrade - Left: Moon Pearl Turtle Rock - Pokey 2 Key Drop: Ice Rod +ow-tileflips: + 1: + force_flip: + - 0x1b + force_no_flip: + - 0x2c + - 0x18 + undefined_chance: 50 entrances: 1: entrances: diff --git a/docs/standardinverted.yaml b/docs/standardinverted.yaml new file mode 100644 index 00000000..c5590090 --- /dev/null +++ b/docs/standardinverted.yaml @@ -0,0 +1,10 @@ +meta: + players: 1 +settings: + 1: + mode: standard + ow_mixed: true +ow-tileflips: + 1: + undefined_chance: 100 + diff --git a/source/classes/CustomSettings.py b/source/classes/CustomSettings.py index fd15253f..8108712e 100644 --- a/source/classes/CustomSettings.py +++ b/source/classes/CustomSettings.py @@ -72,6 +72,7 @@ class CustomSettings(object): args.mystery = True else: settings = defaultdict(lambda: None, player_setting) + args.ow_mixed[p] = get_setting(settings['ow_mixed'], args.ow_mixed[p]) args.shuffle[p] = get_setting(settings['shuffle'], args.shuffle[p]) args.door_shuffle[p] = get_setting(settings['door_shuffle'], args.door_shuffle[p]) args.logic[p] = get_setting(settings['logic'], args.logic[p]) @@ -176,6 +177,11 @@ class CustomSettings(object): return self.file_source['advanced_placements'] return None + def get_owtileflips(self): + if 'ow-tileflips' in self.file_source: + return self.file_source['ow-tileflips'] + return None + def get_entrances(self): if 'entrances' in self.file_source: return self.file_source['entrances'] From 074894750213ac80097f54ab003c7db2726e5284 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 5 Mar 2023 19:31:15 -0600 Subject: [PATCH 10/10] Version bump 0.3.0.1 --- CHANGELOG.md | 9 ++++++++- OverworldShuffle.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48a0a29b..f782574c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,14 @@ # Changelog +## 0.3.0.1 +- \~Merged in DR v1.2.0.10~ + - Fixed some door landing issues +- Added Customizer support for OWR Tile Flips + - Added 'Standard+Inverted' template customizer yaml +- Fixed some ER issues with placing Sanc Drop in non-crossed ER + ## 0.3.0.0 -- Merged in all DR Customizer features since its initial release up to v1.2.0.9 +- \~Merged in all DR Customizer features since its initial release up to v1.2.0.9~ - Major revamp of Aerinon's ER 2.0 to better support OWR modes - Fixed various incorrect logic issues (Inverted flute spots, Bomb Shop start, etc) - Flute is disabled in rain state except glitched modes diff --git a/OverworldShuffle.py b/OverworldShuffle.py index 0854d1e1..a49a6db5 100644 --- a/OverworldShuffle.py +++ b/OverworldShuffle.py @@ -7,7 +7,7 @@ from OWEdges import OWTileRegions, OWEdgeGroups, OWEdgeGroupsTerrain, OWExitType from OverworldGlitchRules import create_owg_connections from Utils import bidict -version_number = '0.3.0.0' +version_number = '0.3.0.1' # branch indicator is intentionally different across branches version_branch = '-u'