From 320b06142fbe3528a0920ea543d53f20f13a98e0 Mon Sep 17 00:00:00 2001 From: compiling <8335770+compiling@users.noreply.github.com> Date: Fri, 14 Feb 2020 19:29:58 +1100 Subject: [PATCH] Make dungeon counters a config setting --- DungeonRandomizer.py | 3 ++- Gui.py | 4 ++++ Main.py | 1 + Rom.py | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DungeonRandomizer.py b/DungeonRandomizer.py index 299a72fd..5153443e 100755 --- a/DungeonRandomizer.py +++ b/DungeonRandomizer.py @@ -184,6 +184,7 @@ def parse_arguments(argv, no_defaults=False): base game. ''') parser.add_argument('--experimental', default=defval(False), help='Enable experimental features', action='store_true') + parser.add_argument('--dungeon_counters', default=defval(False), help='Enable dungeon chest counters', action='store_true') parser.add_argument('--crystals_ganon', default=defval('7'), const='7', nargs='?', choices=['random', '0', '1', '2', '3', '4', '5', '6', '7'], help='''\ How many crystals are needed to defeat ganon. Any other @@ -302,7 +303,7 @@ def parse_arguments(argv, no_defaults=False): for name in ['logic', 'mode', 'swords', 'goal', 'difficulty', 'item_functionality', 'shuffle', 'door_shuffle', 'crystals_ganon', 'crystals_gt', 'openpyramid', 'mapshuffle', 'compassshuffle', 'keyshuffle', 'bigkeyshuffle', 'startinventory', - 'retro', 'accessibility', 'hints', 'beemizer', 'experimental', + 'retro', 'accessibility', 'hints', 'beemizer', 'experimental', 'dungeon_counters', 'shufflebosses', 'shuffleenemies', 'enemy_health', 'enemy_damage', 'shufflepots', 'ow_palettes', 'uw_palettes', 'sprite', 'disablemusic', 'quickswap', 'fastmenu', 'heartcolor', 'heartbeep', 'remote_items']: diff --git a/Gui.py b/Gui.py index 6656b3e3..ccbac707 100755 --- a/Gui.py +++ b/Gui.py @@ -85,6 +85,8 @@ def guiMain(args=None): hintsCheckbutton = Checkbutton(checkBoxFrame, text="Include Helpful Hints", variable=hintsVar) customVar = IntVar() customCheckbutton = Checkbutton(checkBoxFrame, text="Use custom item pool", variable=customVar) + dungeonCounterVar = IntVar() + dungeonCounterbutton = Checkbutton(checkBoxFrame, text="Enable dungeon chest counters", variable=dungeonCounterVar) createSpoilerCheckbutton.pack(expand=True, anchor=W) suppressRomCheckbutton.pack(expand=True, anchor=W) @@ -99,6 +101,7 @@ def guiMain(args=None): shuffleGanonCheckbutton.pack(expand=True, anchor=W) hintsCheckbutton.pack(expand=True, anchor=W) customCheckbutton.pack(expand=True, anchor=W) + dungeonCounterbutton.pack(expand=True, anchor=W) romOptionsFrame = LabelFrame(rightHalfFrame, text="Rom options") romOptionsFrame.columnconfigure(0, weight=1) @@ -468,6 +471,7 @@ def guiMain(args=None): int(arrow1Var.get()), int(arrow10Var.get()), int(bomb1Var.get()), int(bomb3Var.get()), int(rupee1Var.get()), int(rupee5Var.get()), int(rupee20Var.get()), int(rupee50Var.get()), int(rupee100Var.get()), int(rupee300Var.get()), int(rupoorVar.get()), int(blueclockVar.get()), int(greenclockVar.get()), int(redclockVar.get()), int(progbowVar.get()), int(bomb10Var.get()), int(triforcepieceVar.get()), int(triforcecountVar.get()), int(triforceVar.get()), int(rupoorcostVar.get()), int(universalkeyVar.get())] + guiargs.dungeon_counters = bool(dungeonCounterVar.get()) guiargs.rom = romVar.get() guiargs.sprite = sprite guiargs.outputpath = args.outputpath if args else None diff --git a/Main.py b/Main.py index 2b12d179..2c8b66f8 100644 --- a/Main.py +++ b/Main.py @@ -56,6 +56,7 @@ def main(args, seed=None): world.enemy_health = args.enemy_health.copy() world.enemy_damage = args.enemy_damage.copy() world.beemizer = args.beemizer.copy() + world.dungeon_counters = args.dungeon_counters.copy() world.experimental = args.experimental.copy() world.rom_seeds = {player: random.randint(0, 999999999) for player in range(1, world.players + 1)} diff --git a/Rom.py b/Rom.py index 5228be7c..0b86ed4a 100644 --- a/Rom.py +++ b/Rom.py @@ -1157,7 +1157,7 @@ def patch_rom(world, rom, player, team, enemized): # compasses showing dungeon count if world.clock_mode != 'off': rom.write_byte(0x18003C, 0x00) # Currently must be off if timer is on, because they use same HUD location - elif world.doorShuffle[player] == 'crossed': + elif world.dungeon_counters[player]: rom.write_byte(0x18003C, 0x02) # show always elif world.compassshuffle[player] or world.doorShuffle[player] != 'vanilla': rom.write_byte(0x18003C, 0x01) # show on pickup