From 240cf2d84459b76d0534694a4cb9fe2e8d4ebda5 Mon Sep 17 00:00:00 2001 From: Bonta-kun <40473493+Bonta0@users.noreply.github.com> Date: Thu, 9 Jan 2020 09:13:50 +0100 Subject: [PATCH] Mystery: pot_shuffle (on/off) --- Mystery.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Mystery.py b/Mystery.py index 9d7755ea..0ebd1c06 100644 --- a/Mystery.py +++ b/Mystery.py @@ -113,6 +113,8 @@ def get_weights(path): def roll_settings(weights): def get_choice(option, root=weights): + if option not in weights: + return None if type(root[option]) is not dict: return root[option] if not root[option]: @@ -130,17 +132,11 @@ def roll_settings(weights): item_placement = get_choice('item_placement') # not supported in ER - if {'map_shuffle', 'compass_shuffle', 'smallkey_shuffle', 'bigkey_shuffle'}.issubset(weights.keys()): - ret.mapshuffle = get_choice('map_shuffle') == 'on' - ret.compassshuffle = get_choice('compass_shuffle') == 'on' - ret.keyshuffle = get_choice('smallkey_shuffle') == 'on' - ret.bigkeyshuffle = get_choice('bigkey_shuffle') == 'on' - else: - dungeon_items = get_choice('dungeon_items') - ret.mapshuffle = dungeon_items in ['mc', 'mcs', 'full'] - ret.compassshuffle = dungeon_items in ['mc', 'mcs', 'full'] - ret.keyshuffle = dungeon_items in ['mcs', 'full'] - ret.bigkeyshuffle = dungeon_items in ['full'] + dungeon_items = get_choice('dungeon_items') + ret.mapshuffle = get_choice('map_shuffle') == 'on' if 'map_shuffle' in weights else dungeon_items in ['mc', 'mcs', 'full'] + ret.compassshuffle = get_choice('compass_shuffle') == 'on' if 'compass_shuffle' in weights else dungeon_items in ['mc', 'mcs', 'full'] + ret.keyshuffle = get_choice('smallkey_shuffle') == 'on' if 'smallkey_shuffle' in weights else dungeon_items in ['mcs', 'full'] + ret.bigkeyshuffle = get_choice('bigkey_shuffle') == 'on' if 'bigkey_shuffle' in weights else dungeon_items in ['full'] accessibility = get_choice('accessibility') ret.accessibility = accessibility @@ -207,7 +203,10 @@ def roll_settings(weights): enemy_health = get_choice('enemy_health') ret.enemy_health = enemy_health - ret.beemizer = int(get_choice('beemizer')) if 'beemizer' in weights.keys() else 1 # suck it :) + pot_shuffle = get_choice('pot_shuffle') + ret.shufflepots = pot_shuffle == 'on' + + ret.beemizer = int(get_choice('beemizer')) if 'beemizer' in weights else 0 inventoryweights = weights.get('startinventory', {}) startitems = []