From 93211567c2d68061864ab545ba71e189acedc7ee Mon Sep 17 00:00:00 2001 From: aerinon Date: Mon, 27 Nov 2023 16:41:58 -0700 Subject: [PATCH] fix: customizer errors fix: poor enemy placement fix: insanity rng --- EntranceShuffle.py | 2 ++ Main.py | 9 +++++---- source/enemizer/enemy_deny.yaml | 1 + source/gui/bottom.py | 4 ++-- source/tools/MysteryUtils.py | 23 ++++++++++++++++++++--- test/customizer/test.yaml | 32 +++++++++++++++----------------- 6 files changed, 45 insertions(+), 26 deletions(-) diff --git a/EntranceShuffle.py b/EntranceShuffle.py index 1ebe7e30..b95048c4 100644 --- a/EntranceShuffle.py +++ b/EntranceShuffle.py @@ -836,6 +836,7 @@ def link_entrances(world, player): random.shuffle(hole_targets) random.shuffle(exit_pool) + # fill up holes for hole in hole_entrances: connect_entrance(world, hole, hole_targets.pop(), player) @@ -851,6 +852,7 @@ def link_entrances(world, player): caves.append(('Hyrule Castle Exit (South)', 'Hyrule Castle Exit (West)', 'Hyrule Castle Exit (East)')) if not invFlag: exit_pool.append('Hyrule Castle Entrance (South)') + random.shuffle(doors) # place links house if world.mode[player] == 'standard' or not world.shufflelinks[player]: diff --git a/Main.py b/Main.py index 98cac70e..853350fe 100644 --- a/Main.py +++ b/Main.py @@ -220,10 +220,11 @@ def main(args, seed=None, fish=None): if world.customizer and world.customizer.get_start_inventory(): for p, inv_list in world.customizer.get_start_inventory().items(): - for inv_item in inv_list: - item = ItemFactory(inv_item.strip(), p) - if item: - world.push_precollected(item) + if inv_list: + for inv_item in inv_list: + item = ItemFactory(inv_item.strip(), p) + if item: + world.push_precollected(item) if args.print_custom_yaml: world.settings.record_info(world) diff --git a/source/enemizer/enemy_deny.yaml b/source/enemizer/enemy_deny.yaml index bcf49947..196a408f 100644 --- a/source/enemizer/enemy_deny.yaml +++ b/source/enemizer/enemy_deny.yaml @@ -167,6 +167,7 @@ UwGeneralDeny: - [ 0x0067, 1, [ "RollerVerticalUp", "RollerVerticalDown" ] ] #"Skull Woods - Firebar Pits - Blue Bari 1" - [ 0x0067, 2, ["Bumper"]] #"Skull Woods - Firebar Pits - Blue Bari 2" - [ 0x0067, 3, [ "RollerVerticalUp", "RollerVerticalDown" ] ] #"Skull Woods - Firebar Pits - Hardhat Beetle 1" + - [ 0x0067, 4, [ "AntiFairyCircle", "Bumper" ]] - [ 0x0067, 5, [ "RollerVerticalDown" ] ] #"Skull Woods - Firebar Pits - Hardhat Beetle 3" - [ 0x0067, 6, [ "RollerVerticalDown" ] ] #"Skull Woods - Firebar Pits - Hardhat Beetle 4" - [ 0x0067, 7, [ "Beamos", "AntiFairyCircle", "Bumper", "BunnyBeam" ] ] #"Skull Woods - Firebar Pits - Fire Bar (Clockwise)" diff --git a/source/gui/bottom.py b/source/gui/bottom.py index 402e9286..3457f60a 100644 --- a/source/gui/bottom.py +++ b/source/gui/bottom.py @@ -70,11 +70,11 @@ def bottom_frame(self, parent, args=None): def generateRom(): guiargs = create_guiargs(parent) # get default values for missing parameters - for k,v in vars(parse_cli(['--multi', str(guiargs.multi)])).items(): + for k,v in vars(parse_cli(['--multi', str(guiargs.multi), '--customizer', str(guiargs.customizer)])).items(): if k not in vars(guiargs): setattr(guiargs, k, v) elif type(v) is dict: # use same settings for every player - setattr(guiargs, k, {player: getattr(guiargs, k) for player in range(1, guiargs.multi + 1)}) + setattr(guiargs, k, {player: getattr(guiargs, k) for player in range(1, len(v) + 1)}) argsDump = vars(guiargs) needEnemizer = False diff --git a/source/tools/MysteryUtils.py b/source/tools/MysteryUtils.py index 017144eb..eb6f0fee 100644 --- a/source/tools/MysteryUtils.py +++ b/source/tools/MysteryUtils.py @@ -43,6 +43,23 @@ def roll_settings(weights): return choice raise Exception("This fields needs to be true/false or off/on") + def get_choice_non_bool(option, root=weights): + choice = get_choice(option, root) + if choice is True or choice == 'on': + return 'on' + if choice is False or choice == 'off': + return 'off' + return choice + + def get_choice_yn(option, root=weights): + choice = get_choice(option, root) + if choice is True or choice == 'yes': + return 'yes' + if choice is False or choice == 'no': + return 'no' + return choice + + def get_choice_bool_default(option, root=weights, default=None): choice = get_choice_bool(option, root) if choice is None and default is not None: @@ -107,7 +124,7 @@ def roll_settings(weights): ret.experimental = get_choice_bool('experimental') ret.collection_rate = get_choice_bool('collection_rate') - ret.dungeon_counters = get_choice('dungeon_counters') if 'dungeon_counters' in weights else 'default' + ret.dungeon_counters = get_choice_non_bool('dungeon_counters') if 'dungeon_counters' in weights else 'default' if ret.dungeon_counters == 'default': ret.dungeon_counters = 'pickup' if ret.door_shuffle != 'vanilla' or ret.compassshuffle == 'on' else 'off' @@ -138,7 +155,7 @@ def roll_settings(weights): 'ganonhunt': 'ganonhunt', 'completionist': 'completionist' }[goal] - ret.openpyramid = get_choice('open_pyramid') if 'open_pyramid' in weights else 'auto' + ret.openpyramid = get_choice_yn('open_pyramid') if 'open_pyramid' in weights else 'auto' ret.crystals_gt = get_choice('tower_open') @@ -220,7 +237,7 @@ def roll_settings(weights): ret.reduce_flashing = get_choice_bool('reduce_flashing', romweights) ret.fastmenu = get_choice('menuspeed', romweights) ret.heartcolor = get_choice('heartcolor', romweights) - ret.heartbeep = get_choice('heartbeep', romweights) + ret.heartbeep = get_choice_non_bool('heartbeep', romweights) ret.ow_palettes = get_choice('ow_palettes', romweights) ret.uw_palettes = get_choice('uw_palettes', romweights) ret.shuffle_sfx = get_choice_bool('shuffle_sfx', romweights) diff --git a/test/customizer/test.yaml b/test/customizer/test.yaml index 5cef71d0..d4d6ebe2 100644 --- a/test/customizer/test.yaml +++ b/test/customizer/test.yaml @@ -1,6 +1,5 @@ meta: - players: 2 - seed: 400 + seed: 398 settings: 1: # mode: standard @@ -10,17 +9,16 @@ settings: # enemy_shuffle: shuffled # door_shuffle: crossed # intensity: 3 - shuffle: lean + shuffle: insanity + experimental: on # dungeon_counters: 'on' - 2: {} -entrances: - 1: - entrances: - Hyrule Castle Secret Entrance Drop: Lumberjack Tree (top) - two-way: - Hyrule Castle Entrance (South): Links House Exit - 2: {} +#entrances: +# 1: +# entrances: +# Hyrule Castle Secret Entrance Drop: Lumberjack Tree (top) +# two-way: +# Hyrule Castle Entrance (South): Links House Exit #doors: # 1: # lobbies: @@ -33,14 +31,14 @@ entrances: #bosses: # 1: # Ganons Tower (middle): Trinexx -placements: - 1: - Lumberjack Tree: Lamp#2 - Link's House: Lamp - 2: {} -# keyshuffle: wild +#placements: +# 1: +# Lumberjack Tree: Lamp#2 +# Link's House: Lamp + + #placements: # 1: # 'Hera Basement Cage Enemy #4': Small Key (Palace of Darkness)