From a64fb33f4b330f895c73355190b5c698af50729c Mon Sep 17 00:00:00 2001 From: AmazingAmpharos Date: Sat, 11 Nov 2017 18:05:06 -0600 Subject: [PATCH] A little more polishing up -Support for balanced algorithm -Handle output file naming for new parameters --- Main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Main.py b/Main.py index 1974666e..9ba20284 100644 --- a/Main.py +++ b/Main.py @@ -80,6 +80,8 @@ def main(args, seed=None): distribute_items_restrictive(world, 0) elif args.algorithm == 'vt26': distribute_items_restrictive(world, random.randint(0, 15), shuffled_locations) + elif args.algorithm == 'balanced': + distribute_items_restrictive(world, random.randint(0, 15)) logger.info('Calculating playthrough.') @@ -92,7 +94,7 @@ def main(args, seed=None): else: sprite = None - outfilebase = 'ER_%s_%s-%s-%s_%s-%s%s%s%s%s_%s' % (world.logic, world.difficulty, world.mode, world.goal, world.shuffle, world.algorithm, "-keysanity" if world.keysanity else "", "-fastmenu" if world.fastmenu else "", "-quickswap" if world.quickswap else "", "-shuffleganon" if world.shuffle_ganon else "", world.seed) + outfilebase = 'ER_%s_%s-%s-%s%s_%s-%s%s%s%s%s%s_%s' % (world.logic, world.difficulty, world.mode, world.goal, "" if world.timer in ['none', 'display'] else "-" + world.timer, world.shuffle, world.algorithm, "-keysanity" if world.keysanity else "", "-progressives_" + world.progressive if world.progressive in ['off', 'random'] else "", "-fastmenu" if world.fastmenu else "", "-quickswap" if world.quickswap else "", "-shuffleganon" if world.shuffle_ganon else "", world.seed) if not args.suppress_rom: if args.jsonout: @@ -154,7 +156,6 @@ def copy_world(world): return ret - def create_playthrough(world): # create a copy as we will modify it old_world = world @@ -227,4 +228,4 @@ def create_playthrough(world): old_world.required_locations = [location.name for sphere in collection_spheres for location in sphere] # we can finally output our playthrough - old_world.spoiler.playthrough = OrderedDict([(str(i + 1), {str(location): str(location.item) for location in sphere}) for i, sphere in enumerate(collection_spheres)]) + old_world.spoiler.playthrough = OrderedDict([(str(i + 1), {str(location): str(location.item) for location in sphere}) for i, sphere in enumerate(collection_spheres)]) \ No newline at end of file