Adding new option for Bonk Drop Shuffle

This commit is contained in:
codemann8
2022-07-24 12:42:08 -05:00
parent 360a61a65c
commit a5729b51a2
10 changed files with 28 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ class World(object):
self._entrance_cache = {} self._entrance_cache = {}
self._location_cache = {} self._location_cache = {}
self.required_locations = [] self.required_locations = []
self.shuffle_bonk_prizes = False self.shuffle_bonk_drops = {}
self.light_world_light_cone = False self.light_world_light_cone = False
self.dark_world_light_cone = False self.dark_world_light_cone = False
self.clock_mode = 'none' self.clock_mode = 'none'

3
CLI.py
View File

@@ -109,7 +109,7 @@ def parse_cli(argv, no_defaults=False):
'ow_palettes', 'uw_palettes', 'sprite', 'disablemusic', 'quickswap', 'fastmenu', 'heartcolor', 'ow_palettes', 'uw_palettes', 'sprite', 'disablemusic', 'quickswap', 'fastmenu', 'heartcolor',
'heartbeep', 'remote_items', 'shopsanity', 'dropshuffle', 'pottery', 'keydropshuffle', 'heartbeep', 'remote_items', 'shopsanity', 'dropshuffle', 'pottery', 'keydropshuffle',
'mixed_travel', 'standardize_palettes', 'code', 'reduce_flashing', 'shuffle_sfx', '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) value = getattr(defaults, name) if getattr(playerargs, name) is None else getattr(playerargs, name)
if player == 1: if player == 1:
setattr(ret, name, {1: value}) setattr(ret, name, {1: value})
@@ -159,6 +159,7 @@ def parse_settings():
"ow_mixed": False, "ow_mixed": False,
"ow_whirlpool": False, "ow_whirlpool": False,
"ow_fluteshuffle": "vanilla", "ow_fluteshuffle": "vanilla",
"bonk_drops": False,
"shuffle": "vanilla", "shuffle": "vanilla",
"shufflelinks": False, "shufflelinks": False,
"overworld_map": "default", "overworld_map": "default",

View File

@@ -91,6 +91,7 @@ def main(args, seed=None, fish=None):
world.owKeepSimilar = args.ow_keepsimilar.copy() world.owKeepSimilar = args.ow_keepsimilar.copy()
world.owWhirlpoolShuffle = args.ow_whirlpool.copy() world.owWhirlpoolShuffle = args.ow_whirlpool.copy()
world.owFluteShuffle = args.ow_fluteshuffle.copy() world.owFluteShuffle = args.ow_fluteshuffle.copy()
world.shuffle_bonk_drops = args.bonk_drops.copy()
world.open_pyramid = args.openpyramid.copy() world.open_pyramid = args.openpyramid.copy()
world.boss_shuffle = args.shufflebosses.copy() world.boss_shuffle = args.shufflebosses.copy()
world.enemy_shuffle = args.shuffleenemies.copy() world.enemy_shuffle = args.shuffleenemies.copy()
@@ -438,6 +439,7 @@ def copy_world(world, partial_copy=False):
ret.owKeepSimilar = world.owKeepSimilar.copy() ret.owKeepSimilar = world.owKeepSimilar.copy()
ret.owWhirlpoolShuffle = world.owWhirlpoolShuffle.copy() ret.owWhirlpoolShuffle = world.owWhirlpoolShuffle.copy()
ret.owFluteShuffle = world.owFluteShuffle.copy() ret.owFluteShuffle = world.owFluteShuffle.copy()
ret.shuffle_bonk_drops = world.shuffle_bonk_drops.copy()
ret.open_pyramid = world.open_pyramid.copy() ret.open_pyramid = world.open_pyramid.copy()
ret.boss_shuffle = world.boss_shuffle.copy() ret.boss_shuffle = world.boss_shuffle.copy()
ret.enemy_shuffle = world.enemy_shuffle.copy() ret.enemy_shuffle = world.enemy_shuffle.copy()

View File

@@ -174,6 +174,7 @@ def roll_settings(weights):
ret.ow_whirlpool = get_choice('whirlpool_shuffle') == 'on' ret.ow_whirlpool = get_choice('whirlpool_shuffle') == 'on'
overworld_flute = get_choice('flute_shuffle') overworld_flute = get_choice('flute_shuffle')
ret.ow_fluteshuffle = overworld_flute if overworld_flute != 'none' else 'vanilla' 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') entrance_shuffle = get_choice('entrance_shuffle')
ret.shuffle = entrance_shuffle if entrance_shuffle != 'none' else 'vanilla' ret.shuffle = entrance_shuffle if entrance_shuffle != 'none' else 'vanilla'
overworld_map = get_choice('overworld_map') overworld_map = get_choice('overworld_map')

View File

@@ -167,6 +167,10 @@
"action": "store_true", "action": "store_true",
"type": "bool" "type": "bool"
}, },
"bonk_drops": {
"action": "store_true",
"type": "bool"
},
"ow_fluteshuffle": { "ow_fluteshuffle": {
"choices": [ "choices": [
"vanilla", "vanilla",

View File

@@ -234,6 +234,9 @@
"ow_whirlpool": [ "ow_whirlpool": [
"Whirlpools will be shuffled and paired together." "Whirlpools will be shuffled and paired together."
], ],
"bonk_drops": [
"Bonk drops from trees, rocks, and statues are shuffled with the item pool."
],
"ow_fluteshuffle": [ "ow_fluteshuffle": [
"This randomizes the flute spot destinations.", "This randomizes the flute spot destinations.",
"Vanilla: All flute spots remain unchanged.", "Vanilla: All flute spots remain unchanged.",

View File

@@ -145,6 +145,8 @@
"randomizer.overworld.whirlpool": "Whirlpool Shuffle", "randomizer.overworld.whirlpool": "Whirlpool Shuffle",
"randomizer.overworld.bonk_drops": "Bonk Drops",
"randomizer.overworld.overworldflute": "Flute Shuffle", "randomizer.overworld.overworldflute": "Flute Shuffle",
"randomizer.overworld.overworldflute.vanilla": "Vanilla", "randomizer.overworld.overworldflute.vanilla": "Vanilla",
"randomizer.overworld.overworldflute.balanced": "Balanced", "randomizer.overworld.overworldflute.balanced": "Balanced",

View File

@@ -1,4 +1,10 @@
{ {
"topOverworldFrame": {
"bonk_drops": {
"type": "checkbox",
"default": false
}
},
"leftOverworldFrame": { "leftOverworldFrame": {
"overworldshuffle": { "overworldshuffle": {
"type": "selectbox", "type": "selectbox",

View File

@@ -81,6 +81,7 @@ SETTINGSTOPROCESS = {
"keepsimilar": "ow_keepsimilar", "keepsimilar": "ow_keepsimilar",
"mixed": "ow_mixed", "mixed": "ow_mixed",
"whirlpool": "ow_whirlpool", "whirlpool": "ow_whirlpool",
"bonk_drops": "bonk_drops",
"overworldflute": "ow_fluteshuffle" "overworldflute": "ow_fluteshuffle"
}, },
"entrance": { "entrance": {

View File

@@ -15,13 +15,17 @@ def overworld_page(parent):
# Load Overworld Shuffle option widgets as defined by JSON file # Load Overworld Shuffle option widgets as defined by JSON file
# Defns include frame name, widget type, widget options, widget placement attributes # 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["leftOverworldFrame"] = Frame(self)
self.frames["rightOverworldFrame"] = 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["leftOverworldFrame"].pack(side=LEFT, anchor=NW, fill=Y)
self.frames["rightOverworldFrame"].pack(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: with open(os.path.join("resources","app","gui","randomize","overworld","widgets.json")) as overworldWidgets:
myDict = json.load(overworldWidgets) myDict = json.load(overworldWidgets)
for framename,theseWidgets in myDict.items(): for framename,theseWidgets in myDict.items():
@@ -33,7 +37,7 @@ def overworld_page(parent):
packAttrs = {"side":LEFT, "pady":(18,0)} packAttrs = {"side":LEFT, "pady":(18,0)}
elif key == "overworldflute": elif key == "overworldflute":
packAttrs["pady"] = (20,0) packAttrs["pady"] = (20,0)
elif key in ["whirlpool", "mixed"]: elif key in ["mixed", "whirlpool"]:
packAttrs = {"anchor":W, "padx":(79,0)} packAttrs = {"anchor":W, "padx":(79,0)}
self.widgets[key].pack(packAttrs) self.widgets[key].pack(packAttrs)