diff --git a/AdjusterMain.py b/AdjusterMain.py index 634661428..4646127c3 100644 --- a/AdjusterMain.py +++ b/AdjusterMain.py @@ -7,7 +7,7 @@ def adjust(args): - start = time.clock() + start = time.perf_counter() logger = logging.getLogger('') logger.info('Patching ROM.') @@ -31,6 +31,6 @@ def adjust(args): rom.write_to_file(output_path('%s.sfc' % outfilebase)) logger.info('Done. Enjoy.') - logger.debug('Total Time: %s', time.clock() - start) + logger.debug('Total Time: %s', time.perf_counter() - start) return args diff --git a/BaseClasses.py b/BaseClasses.py index c6d63713e..a04877da1 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -891,8 +891,8 @@ def get_bytes(self): # [id][roomID-low][roomID-high][doorID][zero][shop_config][shopkeeper_config][sram_index] entrances = self.region.entrances config = self.item_count - if len(entrances) == 1 and entrances[0].addresses: - door_id = entrances[0].addresses+1 + if len(entrances) == 1 and entrances[0].name in door_addresses: + door_id = door_addresses[entrances[0].name][0]+1 else: door_id = 0 config |= 0x40 # ignore door id diff --git a/ItemList.py b/ItemList.py index aeb7e106f..28edbdf66 100644 --- a/ItemList.py +++ b/ItemList.py @@ -228,7 +228,7 @@ def generate_itempool(world, player): 'Bonk Fairy (Dark)', 'Lake Hylia Healer Fairy', 'Swamp Healer Fairy', 'Desert Healer Fairy', 'Dark Lake Hylia Healer Fairy', 'Dark Lake Hylia Ledge Healer Fairy', 'Dark Desert Healer Fairy', 'Dark Death Mountain Healer Fairy', 'Long Fairy Cave', 'Good Bee Cave', '20 Rupee Cave', - 'Kakariko Gamble Game', 'Capacity Upgrade', '50 Rupee Cave', 'Lost Woods Gamble', 'Hookshot Fairy', + 'Kakariko Gamble Game', '50 Rupee Cave', 'Lost Woods Gamble', 'Hookshot Fairy', 'Palace of Darkness Hint', 'East Dark World Hint', 'Archery Game', 'Dark Lake Hylia Ledge Hint', 'Dark Lake Hylia Ledge Spike Cave', 'Fortune Teller (Dark)', 'Dark Sanctuary Hint', 'Dark Desert Hint'] @@ -337,7 +337,7 @@ def set_up_shops(world, player): # Randomized changes to Shops if world.retro: - for shop in random.sample([s for s in world.shops if s.replaceable and s.region.player == player], 5): + for shop in random.sample([s for s in world.shops if s.replaceable and s.type == ShopType.Shop and s.region.player == player], 5): shop.active = True shop.add_inventory(0, 'Single Arrow', 80) shop.add_inventory(1, 'Small Key (Universal)', 100) diff --git a/Main.py b/Main.py index 9442c8abc..1e3860b64 100644 --- a/Main.py +++ b/Main.py @@ -21,7 +21,7 @@ __version__ = '0.6.3-pre' def main(args, seed=None): - start = time.clock() + start = time.perf_counter() # initialize the world world = World(args.multi, args.shuffle, args.logic, args.mode, args.swords, args.difficulty, args.item_functionality, args.timer, args.progressive, args.goal, args.algorithm, not args.nodungeonitems, args.accessibility, args.shuffleganon, args.quickswap, args.fastmenu, args.disablemusic, args.keysanity, args.retro, args.custom, args.customitemarray, args.shufflebosses, args.hints) @@ -172,7 +172,7 @@ def main(args, seed=None): world.spoiler.to_file(output_path('%s_Spoiler.txt' % outfilebase)) logger.info('Done. Enjoy.') - logger.debug('Total Time: %s', time.clock() - start) + logger.debug('Total Time: %s', time.perf_counter() - start) return world diff --git a/Plando.py b/Plando.py index 290e212b5..1f2992bf8 100755 --- a/Plando.py +++ b/Plando.py @@ -20,7 +20,7 @@ __version__ = '0.2-dev' def main(args): - start_time = time.clock() + start_time = time.perf_counter() # initialize the world world = World(1, 'vanilla', 'noglitches', 'standard', 'normal', 'none', 'on', 'ganon', 'freshness', False, False, False, args.quickswap, args.fastmenu, args.disablemusic, False, False, False, None, 'none', False) @@ -89,7 +89,7 @@ def main(args): world.spoiler.to_file('%s_Spoiler.txt' % outfilebase) logger.info('Done. Enjoy.') - logger.debug('Total Time: %s', time.clock() - start_time) + logger.debug('Total Time: %s', time.perf_counter() - start_time) return world diff --git a/Rom.py b/Rom.py index c18784aba..49e45974a 100644 --- a/Rom.py +++ b/Rom.py @@ -662,8 +662,10 @@ def patch_rom(world, player, rom): [difficulty.progressive_sword_limit, overflow_replacement, difficulty.progressive_shield_limit, overflow_replacement, difficulty.progressive_armor_limit, overflow_replacement, - difficulty.progressive_bottle_limit, overflow_replacement, - difficulty.progressive_bow_limit, overflow_replacement]) + difficulty.progressive_bottle_limit, overflow_replacement]) + + #Work around for json patch ordering issues - write bow limit separately so that it is replaced in the patch + rom.write_bytes(0x180098, [difficulty.progressive_bow_limit, overflow_replacement]) if difficulty.progressive_bow_limit < 2 and world.swords == 'swordless': rom.write_bytes(0x180098, [2, overflow_replacement])