handler.applyPatch( 'happyVending' ) if( config[ 'patches' ][ 'FixMusicTransition' ] ): handler.applyPatch( 'fixMusicTransition' ) print( 'Writing to ' + outFile + '...' ) sys.stdout.flush() try: handler.write( outFile ) except Exception as ex: logger.logError( 'System error: {0}'.format(ex) ) print( 'An irrecoverable error occured' ) if( not logger.error ): print( 'Modifications completed successfully. See log file for details (Warning: spoilers!).' ) print( 'Seed was ' + str( handler.randomseed ) ) print( 'Enter this seed in settings file to produce the same ROM again.' ) else: print( 'Program ended with errors. See log file for details.' ) sys.stdout.flush() logger.logAlways( logger.getHeader( 'Seed' ) ) logger.logAlways( 'Seed was ' + str( handler.randomseed ) + '.' ) logger.close() logger.rename( 'randomize-' + str( handler.randomseed ) + '.log')
if (config['patches']['UnrigSlots']): handler.applyPatch('slots') if (config['patches']['Softlock']): handler.applyPatch('softlock') print('Writing to ' + outFile + '...') sys.stdout.flush() try: handler.write(outFile) except: logger.logError('System error') print('An irrecoverable error occured') if (not logger.error): print( 'Modifications completed successfully. See log file for details (Warning: spoilers!).' ) print('Seed was ' + str(handler.randomseed)) print('Enter this seed in settings file to produce the same ROM again.') else: print('Program ended with errors. See log file for details.') sys.stdout.flush() logger.logAlways(logger.getHeader('Seed')) logger.logAlways('Seed was ' + str(handler.randomseed) + '.') logger.logAlways(logger.getHeader('End of log'))