From ffcc78f95c9d2f73a5beca78b32339abb1ac8f1a Mon Sep 17 00:00:00 2001 From: aerinon Date: Wed, 7 Jul 2021 16:23:16 -0700 Subject: [PATCH] Fake boots checkbox/argument --- BaseClasses.py | 1 + CLI.py | 3 ++- Main.py | 1 + Mystery.py | 1 + Rom.py | 4 +++- resources/app/cli/args.json | 4 ++++ resources/app/cli/lang/en.json | 1 + resources/app/gui/lang/en.json | 1 + resources/app/gui/randomize/item/widgets.json | 3 ++- source/classes/constants.py | 1 + source/gui/randomize/item.py | 7 +++++-- 11 files changed, 22 insertions(+), 5 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index fc0029ee..7521bd6e 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -131,6 +131,7 @@ class World(object): set_player_attr('treasure_hunt_total', 0) set_player_attr('potshuffle', False) set_player_attr('pot_contents', None) + set_player_attr('fakeboots', False) set_player_attr('shopsanity', False) set_player_attr('keydropshuffle', False) diff --git a/CLI.py b/CLI.py index 222f8a90..9b6e42fb 100644 --- a/CLI.py +++ b/CLI.py @@ -97,7 +97,7 @@ def parse_cli(argv, no_defaults=False): 'shuffle', 'door_shuffle', 'intensity', 'crystals_ganon', 'crystals_gt', 'openpyramid', 'mapshuffle', 'compassshuffle', 'keyshuffle', 'bigkeyshuffle', 'startinventory', 'triforce_pool_min', 'triforce_pool_max', 'triforce_goal_min', 'triforce_goal_max', - 'triforce_min_difference', 'triforce_goal', 'triforce_pool', 'shufflelinks', + 'triforce_min_difference', 'triforce_goal', 'triforce_pool', 'shufflelinks', 'fakeboots', 'retro', 'accessibility', 'hints', 'beemizer', 'experimental', 'dungeon_counters', 'shufflebosses', 'shuffleenemies', 'enemy_health', 'enemy_damage', 'shufflepots', 'ow_palettes', 'uw_palettes', 'sprite', 'disablemusic', 'quickswap', 'fastmenu', 'heartcolor', 'heartbeep', @@ -144,6 +144,7 @@ def parse_settings(): "shuffleganon": True, "shuffle": "vanilla", "shufflelinks": False, + "fakeboots": False, "shufflepots": False, "shuffleenemies": "none", diff --git a/Main.py b/Main.py index 513f5a84..505c6d23 100644 --- a/Main.py +++ b/Main.py @@ -90,6 +90,7 @@ def main(args, seed=None, fish=None): world.treasure_hunt_count = args.triforce_goal.copy() world.treasure_hunt_total = args.triforce_pool.copy() world.shufflelinks = args.shufflelinks.copy() + world.fakeboots = args.fakeboots.copy() world.rom_seeds = {player: random.randint(0, 999999999) for player in range(1, world.players + 1)} diff --git a/Mystery.py b/Mystery.py index bd5581d6..0fd85108 100644 --- a/Mystery.py +++ b/Mystery.py @@ -143,6 +143,7 @@ def roll_settings(weights): ret.dungeon_counters = 'pickup' if ret.door_shuffle != 'vanilla' or ret.compassshuffle == 'on' else 'off' ret.shufflelinks = get_choice('shufflelinks') == 'on' + ret.fakeboots = get_choice('fakeboots') == 'on' ret.shopsanity = get_choice('shopsanity') == 'on' ret.keydropshuffle = get_choice('keydropshuffle') == 'on' ret.mixed_travel = get_choice('mixed_travel') if 'mixed_travel' in weights else 'prevent' diff --git a/Rom.py b/Rom.py index a3f37cb2..72be78d0 100644 --- a/Rom.py +++ b/Rom.py @@ -18,7 +18,6 @@ except ImportError: from BaseClasses import CollectionState, ShopType, Region, Location, Door, DoorType, RegionType, PotItem from DoorShuffle import compass_data, DROptions, boss_indicator from Dungeons import dungeon_music_addresses -from KeyDoorShuffle import count_locations_exclude_logic from Regions import location_table, shop_to_location_table, retro_shops from RoomData import DoorKind from Text import MultiByteTextMapper, CompressedTextMapper, text_addresses, Credits, TextTable @@ -1163,6 +1162,9 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False): rom.write_byte(0x18017E, 0x01) # Fairy fountains only trade in bottles # Starting equipment + if world.fakeboots[player]: + rom.write_byte(0x18008E, 0x01) + equip = [0] * (0x340 + 0x4F) equip[0x36C] = 0x18 equip[0x36D] = 0x18 diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index 00d1c9db..584593b4 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -310,6 +310,10 @@ "action": "store_true", "type": "bool" }, + "fakeboots": { + "action": "store_true", + "type": "bool" + }, "calc_playthrough": { "action": "store_false", "type": "bool" diff --git a/resources/app/cli/lang/en.json b/resources/app/cli/lang/en.json index 145667ef..6416e952 100644 --- a/resources/app/cli/lang/en.json +++ b/resources/app/cli/lang/en.json @@ -262,6 +262,7 @@ "Keys are universal, shooting arrows costs rupees,", "and a few other little things make this more like Zelda-1. (default: %(default)s)" ], + "fakeboots": [ " Players starts with fake boots that allow dashing but no item checks (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." ], "custom": [ "Not supported." ], diff --git a/resources/app/gui/lang/en.json b/resources/app/gui/lang/en.json index 850bb788..f4b8ca12 100644 --- a/resources/app/gui/lang/en.json +++ b/resources/app/gui/lang/en.json @@ -189,6 +189,7 @@ "randomizer.item.hints": "Include Helpful Hints", "randomizer.item.retro": "Retro mode (universal keys)", + "randomizer.item.fakeboots": "Start with Fake Boots", "randomizer.item.worldstate": "World State", "randomizer.item.worldstate.standard": "Standard", diff --git a/resources/app/gui/randomize/item/widgets.json b/resources/app/gui/randomize/item/widgets.json index 1871dcaf..1f5eb19a 100644 --- a/resources/app/gui/randomize/item/widgets.json +++ b/resources/app/gui/randomize/item/widgets.json @@ -4,7 +4,8 @@ "shopsanity": { "type": "checkbox" }, "hints": { "type": "checkbox" - } + }, + "fakeboots": { "type": "checkbox" } }, "leftItemFrame": { "worldstate": { diff --git a/source/classes/constants.py b/source/classes/constants.py index 3e59af3c..14c70f79 100644 --- a/source/classes/constants.py +++ b/source/classes/constants.py @@ -58,6 +58,7 @@ SETTINGSTOPROCESS = { "hints": "hints", "retro": "retro", "shopsanity": "shopsanity", + "fakeboots": "fakeboots", "worldstate": "mode", "logiclevel": "logic", "goal": "goal", diff --git a/source/gui/randomize/item.py b/source/gui/randomize/item.py index b01892ab..81c957ce 100644 --- a/source/gui/randomize/item.py +++ b/source/gui/randomize/item.py @@ -1,4 +1,4 @@ -from tkinter import ttk, Frame, E, W, LEFT, RIGHT +from tkinter import ttk, Frame, E, W, LEFT, RIGHT, Label import source.gui.widgets as widgets import json import os @@ -17,6 +17,9 @@ def item_page(parent): self.frames["checkboxes"] = Frame(self) self.frames["checkboxes"].pack(anchor=W) + various_options = Label(self.frames["checkboxes"], text="") + various_options.pack(side=LEFT) + self.frames["leftItemFrame"] = Frame(self) self.frames["rightItemFrame"] = Frame(self) self.frames["leftItemFrame"].pack(side=LEFT) @@ -34,7 +37,7 @@ def item_page(parent): self.widgets[key] = dictWidgets[key] packAttrs = {"anchor":E} if self.widgets[key].type == "checkbox": - packAttrs["anchor"] = W + packAttrs["side"] = LEFT self.widgets[key].pack(packAttrs) return self