Fixed clock -> process_time for Python 3.8 Fixed interior blocked doors Vanilla logical connections for Ice Cross (Push block) Dungeon entrance enhancement for TR, Skull, HC (Standard) Kill on invalid dungeons during key door shuffle Key logic improvements (Smallkey restrictions, Logic Min/Logic Max for key doors, Big Chest doesn't count for small keys if BK not found yet) Key door candidate now accounts for "overworld" dungeon traversal Path checking added some Crystal Logic (Blind's Cell to Boss mostly) Kill on dungeon gen if taking too long
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
import os
|
|
import time
|
|
import logging
|
|
|
|
from Utils import output_path
|
|
from Rom import LocalRom, Sprite, apply_rom_settings
|
|
|
|
|
|
def adjust(args):
|
|
start = time.process_time()
|
|
logger = logging.getLogger('')
|
|
logger.info('Patching ROM.')
|
|
|
|
if args.sprite is not None:
|
|
if isinstance(args.sprite, Sprite):
|
|
sprite = args.sprite
|
|
else:
|
|
sprite = Sprite(args.sprite)
|
|
else:
|
|
sprite = None
|
|
|
|
outfilebase = os.path.basename(args.rom)[:-4] + '_adjusted'
|
|
|
|
if os.stat(args.rom).st_size in (0x200000, 0x400000) and os.path.splitext(args.rom)[-1].lower() == '.sfc':
|
|
rom = LocalRom(args.rom, False)
|
|
else:
|
|
raise RuntimeError('Provided Rom is not a valid Link to the Past Randomizer Rom. Please provide one for adjusting.')
|
|
|
|
apply_rom_settings(rom, args.heartbeep, args.heartcolor, args.quickswap, args.fastmenu, args.disablemusic, sprite)
|
|
|
|
rom.write_to_file(output_path('%s.sfc' % outfilebase))
|
|
|
|
logger.info('Done. Enjoy.')
|
|
logger.debug('Total Time: %s', time.process_time() - start)
|
|
|
|
return args
|