From e2afe98b7522e7caf8c4d360e9fc2d59815123e9 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 31 Oct 2021 15:57:32 -0500 Subject: [PATCH] Fixed issue with shuffling Ganon/GT via CLI --- Utils.py | 18 ++++++++++++------ resources/app/cli/args.json | 6 +++--- resources/app/cli/lang/en.json | 6 +++--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Utils.py b/Utils.py index b35e6f4c..c28aa250 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 @@ -354,12 +358,14 @@ def update_deprecated_args(args): # Shuffle Ganon defaults to TRUE # Don't do: Yes # Do: No - if "no_shuffleganon" in argVars: - args.shuffleganon = not args.no_shuffleganon in truthy - # Don't do: No - # Do: Yes - if "shuffleganon" in argVars: - args.no_shuffleganon = not args.shuffleganon in truthy + orig_shuffleganon = args.shuffleganon + if isinstance(orig_shuffleganon, bool): + args.shuffleganon = {} + for player in range(1, players + 1): + args.shuffleganon[player] = orig_shuffleganon + for player in range(1, players + 1): + if "no_shuffleganon" in argVars: + args.shuffleganon[player] = not args.no_shuffleganon in truthy # Playthrough defaults to TRUE # Don't do: Yes diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index 05bc7dea..464fd83b 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -359,12 +359,12 @@ }, "shuffleganon": { "action": "store_false", - "type": "bool" + "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 30e46f20..b38fea4c 100644 --- a/resources/app/cli/lang/en.json +++ b/resources/app/cli/lang/en.json @@ -301,7 +301,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." ], @@ -315,8 +315,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": [