Merged in DR v0.5.0.1
This commit is contained in:
18
Main.py
18
Main.py
@@ -29,14 +29,24 @@ from Fill import sell_potions, sell_keys, balance_multiworld_progression, balanc
|
||||
from ItemList import generate_itempool, difficulties, fill_prizes, customize_shops
|
||||
from Utils import output_path, parse_player_names
|
||||
|
||||
__version__ = '0.4.0.12u'
|
||||
__version__ = '0.5.0.1-u'
|
||||
|
||||
from source.classes.BabelFish import BabelFish
|
||||
|
||||
|
||||
class EnemizerError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
||||
def check_python_version():
|
||||
import sys
|
||||
version = sys.version_info
|
||||
if version.major < 3 or version.minor < 7:
|
||||
logging.warning(BabelFish().translate("cli","cli","old.python.version"), sys.version)
|
||||
|
||||
|
||||
def main(args, seed=None, fish=None):
|
||||
check_python_version()
|
||||
if args.outputpath:
|
||||
os.makedirs(args.outputpath, exist_ok=True)
|
||||
output_path.cached_path = args.outputpath
|
||||
@@ -70,6 +80,7 @@ def main(args, seed=None, fish=None):
|
||||
world.compassshuffle = args.compassshuffle.copy()
|
||||
world.keyshuffle = args.keyshuffle.copy()
|
||||
world.bigkeyshuffle = args.bigkeyshuffle.copy()
|
||||
world.bomblogic = args.bomblogic.copy()
|
||||
world.crystals_needed_for_ganon = {player: random.randint(0, 7) if args.crystals_ganon[player] == 'random' else int(args.crystals_ganon[player]) for player in range(1, world.players + 1)}
|
||||
world.crystals_needed_for_gt = {player: random.randint(0, 7) if args.crystals_gt[player] == 'random' else int(args.crystals_gt[player]) for player in range(1, world.players + 1)}
|
||||
world.crystals_ganon_orig = args.crystals_ganon.copy()
|
||||
@@ -268,11 +279,11 @@ def main(args, seed=None, fish=None):
|
||||
rom = JsonRom() if args.jsonout or use_enemizer else LocalRom(args.rom)
|
||||
|
||||
if use_enemizer and (args.enemizercli or not args.jsonout):
|
||||
base_patch = LocalRom(args.rom) # update base2current.json (side effect)
|
||||
local_rom = LocalRom(args.rom) # update base2current.json (side effect)
|
||||
if args.rom and not(os.path.isfile(args.rom)):
|
||||
raise RuntimeError("Could not find valid base rom for enemizing at expected path %s." % args.rom)
|
||||
if os.path.exists(args.enemizercli):
|
||||
patch_enemizer(world, player, rom, args.rom, args.enemizercli, sprite_random_on_hit)
|
||||
patch_enemizer(world, player, rom, local_rom, args.enemizercli, sprite_random_on_hit)
|
||||
enemized = True
|
||||
if not args.jsonout:
|
||||
rom = LocalRom.fromJsonRom(rom, args.rom, 0x400000)
|
||||
@@ -382,6 +393,7 @@ def copy_world(world):
|
||||
ret.compassshuffle = world.compassshuffle.copy()
|
||||
ret.keyshuffle = world.keyshuffle.copy()
|
||||
ret.bigkeyshuffle = world.bigkeyshuffle.copy()
|
||||
ret.bomblogic = world.bomblogic.copy()
|
||||
ret.crystals_needed_for_ganon = world.crystals_needed_for_ganon.copy()
|
||||
ret.crystals_needed_for_gt = world.crystals_needed_for_gt.copy()
|
||||
ret.crystals_ganon_orig = world.crystals_ganon_orig.copy()
|
||||
|
||||
Reference in New Issue
Block a user