From a5729b51a242d829512bb5f15e144adcb39ffa41 Mon Sep 17 00:00:00 2001 From: codemann8 Date: Sun, 24 Jul 2022 12:42:08 -0500 Subject: [PATCH] Adding new option for Bonk Drop Shuffle --- BaseClasses.py | 2 +- CLI.py | 3 ++- Main.py | 2 ++ Mystery.py | 1 + resources/app/cli/args.json | 4 ++++ resources/app/cli/lang/en.json | 3 +++ resources/app/gui/lang/en.json | 2 ++ resources/app/gui/randomize/overworld/widgets.json | 6 ++++++ source/classes/constants.py | 1 + source/gui/randomize/overworld.py | 8 ++++++-- 10 files changed, 28 insertions(+), 4 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 5bd55485..01825043 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -54,7 +54,7 @@ class World(object): self._entrance_cache = {} self._location_cache = {} self.required_locations = [] - self.shuffle_bonk_prizes = False + self.shuffle_bonk_drops = {} self.light_world_light_cone = False self.dark_world_light_cone = False self.clock_mode = 'none' diff --git a/CLI.py b/CLI.py index 8ba224bd..4e7ad021 100644 --- a/CLI.py +++ b/CLI.py @@ -109,7 +109,7 @@ def parse_cli(argv, no_defaults=False): 'ow_palettes', 'uw_palettes', 'sprite', 'disablemusic', 'quickswap', 'fastmenu', 'heartcolor', 'heartbeep', 'remote_items', 'shopsanity', 'dropshuffle', 'pottery', 'keydropshuffle', 'mixed_travel', 'standardize_palettes', 'code', 'reduce_flashing', 'shuffle_sfx', - 'msu_resume', 'collection_rate', 'colorizepots']: + 'msu_resume', 'collection_rate', 'colorizepots', 'bonk_drops']: value = getattr(defaults, name) if getattr(playerargs, name) is None else getattr(playerargs, name) if player == 1: setattr(ret, name, {1: value}) @@ -159,6 +159,7 @@ def parse_settings(): "ow_mixed": False, "ow_whirlpool": False, "ow_fluteshuffle": "vanilla", + "bonk_drops": False, "shuffle": "vanilla", "shufflelinks": False, "overworld_map": "default", diff --git a/Main.py b/Main.py index ac5843e5..2ac286bf 100644 --- a/Main.py +++ b/Main.py @@ -91,6 +91,7 @@ def main(args, seed=None, fish=None): world.owKeepSimilar = args.ow_keepsimilar.copy() world.owWhirlpoolShuffle = args.ow_whirlpool.copy() world.owFluteShuffle = args.ow_fluteshuffle.copy() + world.shuffle_bonk_drops = args.bonk_drops.copy() world.open_pyramid = args.openpyramid.copy() world.boss_shuffle = args.shufflebosses.copy() world.enemy_shuffle = args.shuffleenemies.copy() @@ -438,6 +439,7 @@ def copy_world(world, partial_copy=False): ret.owKeepSimilar = world.owKeepSimilar.copy() ret.owWhirlpoolShuffle = world.owWhirlpoolShuffle.copy() ret.owFluteShuffle = world.owFluteShuffle.copy() + ret.shuffle_bonk_drops = world.shuffle_bonk_drops.copy() ret.open_pyramid = world.open_pyramid.copy() ret.boss_shuffle = world.boss_shuffle.copy() ret.enemy_shuffle = world.enemy_shuffle.copy() diff --git a/Mystery.py b/Mystery.py index 07955bff..60a3f064 100644 --- a/Mystery.py +++ b/Mystery.py @@ -174,6 +174,7 @@ def roll_settings(weights): ret.ow_whirlpool = get_choice('whirlpool_shuffle') == 'on' overworld_flute = get_choice('flute_shuffle') ret.ow_fluteshuffle = overworld_flute if overworld_flute != 'none' else 'vanilla' + ret.shuffle_bonk_drops = get_choice('bonk_drops') == 'on' entrance_shuffle = get_choice('entrance_shuffle') ret.shuffle = entrance_shuffle if entrance_shuffle != 'none' else 'vanilla' overworld_map = get_choice('overworld_map') diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index 2c169dcf..ebeedf53 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -167,6 +167,10 @@ "action": "store_true", "type": "bool" }, + "bonk_drops": { + "action": "store_true", + "type": "bool" + }, "ow_fluteshuffle": { "choices": [ "vanilla", diff --git a/resources/app/cli/lang/en.json b/resources/app/cli/lang/en.json index 802acf1e..5d753a66 100644 --- a/resources/app/cli/lang/en.json +++ b/resources/app/cli/lang/en.json @@ -234,6 +234,9 @@ "ow_whirlpool": [ "Whirlpools will be shuffled and paired together." ], + "bonk_drops": [ + "Bonk drops from trees, rocks, and statues are shuffled with the item pool." + ], "ow_fluteshuffle": [ "This randomizes the flute spot destinations.", "Vanilla: All flute spots remain unchanged.", diff --git a/resources/app/gui/lang/en.json b/resources/app/gui/lang/en.json index b325429c..b25f4233 100644 --- a/resources/app/gui/lang/en.json +++ b/resources/app/gui/lang/en.json @@ -145,6 +145,8 @@ "randomizer.overworld.whirlpool": "Whirlpool Shuffle", + "randomizer.overworld.bonk_drops": "Bonk Drops", + "randomizer.overworld.overworldflute": "Flute Shuffle", "randomizer.overworld.overworldflute.vanilla": "Vanilla", "randomizer.overworld.overworldflute.balanced": "Balanced", diff --git a/resources/app/gui/randomize/overworld/widgets.json b/resources/app/gui/randomize/overworld/widgets.json index 43dc9394..9595ea8e 100644 --- a/resources/app/gui/randomize/overworld/widgets.json +++ b/resources/app/gui/randomize/overworld/widgets.json @@ -1,4 +1,10 @@ { + "topOverworldFrame": { + "bonk_drops": { + "type": "checkbox", + "default": false + } + }, "leftOverworldFrame": { "overworldshuffle": { "type": "selectbox", diff --git a/source/classes/constants.py b/source/classes/constants.py index c120734b..1b6a6aa5 100644 --- a/source/classes/constants.py +++ b/source/classes/constants.py @@ -81,6 +81,7 @@ SETTINGSTOPROCESS = { "keepsimilar": "ow_keepsimilar", "mixed": "ow_mixed", "whirlpool": "ow_whirlpool", + "bonk_drops": "bonk_drops", "overworldflute": "ow_fluteshuffle" }, "entrance": { diff --git a/source/gui/randomize/overworld.py b/source/gui/randomize/overworld.py index 3cc3eb36..d3796af6 100644 --- a/source/gui/randomize/overworld.py +++ b/source/gui/randomize/overworld.py @@ -15,12 +15,16 @@ def overworld_page(parent): # Load Overworld Shuffle option widgets as defined by JSON file # Defns include frame name, widget type, widget options, widget placement attributes - # These get split left & right + self.frames["topOverworldFrame"] = Frame(self) self.frames["leftOverworldFrame"] = Frame(self) self.frames["rightOverworldFrame"] = Frame(self) + self.frames["topOverworldFrame"].pack(side=TOP, anchor=NW) self.frames["leftOverworldFrame"].pack(side=LEFT, anchor=NW, fill=Y) self.frames["rightOverworldFrame"].pack(anchor=NW, fill=Y) + + shuffleLabel = Label(self.frames["topOverworldFrame"], text="Shuffle: ") + shuffleLabel.pack(side=LEFT) with open(os.path.join("resources","app","gui","randomize","overworld","widgets.json")) as overworldWidgets: myDict = json.load(overworldWidgets) @@ -33,7 +37,7 @@ def overworld_page(parent): packAttrs = {"side":LEFT, "pady":(18,0)} elif key == "overworldflute": packAttrs["pady"] = (20,0) - elif key in ["whirlpool", "mixed"]: + elif key in ["mixed", "whirlpool"]: packAttrs = {"anchor":W, "padx":(79,0)} self.widgets[key].pack(packAttrs)