Use EasyModeEscape flag of upcoming Enemizer
This commit is contained in:
parent
fc76698997
commit
346a08c3dd
2
Main.py
2
Main.py
|
@ -176,7 +176,7 @@ def main(args, seed=None):
|
||||||
patch_rom(world, rom, player, team, use_enemizer)
|
patch_rom(world, rom, player, team, use_enemizer)
|
||||||
|
|
||||||
if use_enemizer:
|
if use_enemizer:
|
||||||
patch_enemizer(world, player, rom, args.rom, args.enemizercli, args.shufflepots[player],
|
patch_enemizer(world, player, rom, args.enemizercli,
|
||||||
sprite_random_on_hit)
|
sprite_random_on_hit)
|
||||||
|
|
||||||
if args.race:
|
if args.race:
|
||||||
|
|
5
Patch.py
5
Patch.py
|
@ -21,6 +21,7 @@ def get_base_rom_path(file_name: str = "") -> str:
|
||||||
file_name = Utils.local_path(file_name)
|
file_name = Utils.local_path(file_name)
|
||||||
return file_name
|
return file_name
|
||||||
|
|
||||||
|
|
||||||
def get_base_rom_bytes(file_name: str = "") -> bytes:
|
def get_base_rom_bytes(file_name: str = "") -> bytes:
|
||||||
base_rom_bytes = getattr(get_base_rom_bytes, "base_rom_bytes", None)
|
base_rom_bytes = getattr(get_base_rom_bytes, "base_rom_bytes", None)
|
||||||
if not base_rom_bytes:
|
if not base_rom_bytes:
|
||||||
|
@ -38,7 +39,9 @@ def get_base_rom_bytes(file_name: str = "") -> bytes:
|
||||||
|
|
||||||
def generate_yaml(patch: bytes, metadata: Optional[dict] = None) -> bytes:
|
def generate_yaml(patch: bytes, metadata: Optional[dict] = None) -> bytes:
|
||||||
patch = yaml.dump({"meta": metadata,
|
patch = yaml.dump({"meta": metadata,
|
||||||
"patch": patch})
|
"patch": patch,
|
||||||
|
"game": "alttp",
|
||||||
|
"base_checksum": JAP10HASH})
|
||||||
return patch.encode(encoding="utf-8-sig")
|
return patch.encode(encoding="utf-8-sig")
|
||||||
|
|
||||||
|
|
||||||
|
|
12
Rom.py
12
Rom.py
|
@ -143,7 +143,7 @@ def read_rom(stream) -> bytearray:
|
||||||
buffer = buffer[0x200:]
|
buffer = buffer[0x200:]
|
||||||
return buffer
|
return buffer
|
||||||
|
|
||||||
def patch_enemizer(world, player, rom, baserom_path, enemizercli, shufflepots, random_sprite_on_hit):
|
def patch_enemizer(world, player: int, rom: LocalRom, enemizercli, random_sprite_on_hit):
|
||||||
randopatch_path = os.path.abspath(output_path(f'enemizer_randopatch_{player}.sfc'))
|
randopatch_path = os.path.abspath(output_path(f'enemizer_randopatch_{player}.sfc'))
|
||||||
options_path = os.path.abspath(output_path(f'enemizer_options_{player}.json'))
|
options_path = os.path.abspath(output_path(f'enemizer_options_{player}.json'))
|
||||||
enemizer_output_path = os.path.abspath(output_path(f'enemizer_output_{player}.sfc'))
|
enemizer_output_path = os.path.abspath(output_path(f'enemizer_output_{player}.sfc'))
|
||||||
|
@ -161,12 +161,14 @@ def patch_enemizer(world, player, rom, baserom_path, enemizercli, shufflepots, r
|
||||||
'AllowEnemyZeroDamage': True,
|
'AllowEnemyZeroDamage': True,
|
||||||
'ShuffleEnemyDamageGroups': world.enemy_damage[player] != 'default',
|
'ShuffleEnemyDamageGroups': world.enemy_damage[player] != 'default',
|
||||||
'EnemyDamageChaosMode': world.enemy_damage[player] == 'chaos',
|
'EnemyDamageChaosMode': world.enemy_damage[player] == 'chaos',
|
||||||
'EasyModeEscape': False,
|
'EasyModeEscape': world.mode[player] == "standard",
|
||||||
'EnemiesAbsorbable': False,
|
'EnemiesAbsorbable': False,
|
||||||
'AbsorbableSpawnRate': 10,
|
'AbsorbableSpawnRate': 10,
|
||||||
'AbsorbableTypes': {
|
'AbsorbableTypes': {
|
||||||
'FullMagic': True, 'SmallMagic': True, 'Bomb_1': True, 'BlueRupee': True, 'Heart': True, 'BigKey': True, 'Key': True,
|
'FullMagic': True, 'SmallMagic': True, 'Bomb_1': True, 'BlueRupee': True, 'Heart': True, 'BigKey': True,
|
||||||
'Fairy': True, 'Arrow_10': True, 'Arrow_5': True, 'Bomb_8': True, 'Bomb_4': True, 'GreenRupee': True, 'RedRupee': True
|
'Key': True,
|
||||||
|
'Fairy': True, 'Arrow_10': True, 'Arrow_5': True, 'Bomb_8': True, 'Bomb_4': True, 'GreenRupee': True,
|
||||||
|
'RedRupee': True
|
||||||
},
|
},
|
||||||
'BossMadness': False,
|
'BossMadness': False,
|
||||||
'RandomizeBosses': True,
|
'RandomizeBosses': True,
|
||||||
|
@ -188,7 +190,7 @@ def patch_enemizer(world, player, rom, baserom_path, enemizercli, shufflepots, r
|
||||||
'GrayscaleMode': False,
|
'GrayscaleMode': False,
|
||||||
'GenerateSpoilers': False,
|
'GenerateSpoilers': False,
|
||||||
'RandomizeLinkSpritePalette': False,
|
'RandomizeLinkSpritePalette': False,
|
||||||
'RandomizePots': shufflepots,
|
'RandomizePots': world.shufflepots[player],
|
||||||
'ShuffleMusic': False,
|
'ShuffleMusic': False,
|
||||||
'BootlegMagic': True,
|
'BootlegMagic': True,
|
||||||
'CustomBosses': False,
|
'CustomBosses': False,
|
||||||
|
|
7
Utils.py
7
Utils.py
|
@ -15,7 +15,7 @@ import sys
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
from yaml import load, dump
|
from yaml import load, dump, safe_load
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from yaml import CLoader as Loader
|
from yaml import CLoader as Loader
|
||||||
|
@ -156,7 +156,8 @@ def make_new_base2current(old_rom='Zelda no Densetsu - Kamigami no Triforce (Jap
|
||||||
return "New Rom Hash: " + basemd5.hexdigest()
|
return "New Rom Hash: " + basemd5.hexdigest()
|
||||||
|
|
||||||
|
|
||||||
parse_yaml = functools.partial(load, Loader=Loader)
|
parse_yaml = safe_load
|
||||||
|
unsafe_parse_yaml = functools.partial(load, Loader=Loader)
|
||||||
|
|
||||||
|
|
||||||
class Hint(typing.NamedTuple):
|
class Hint(typing.NamedTuple):
|
||||||
|
@ -251,7 +252,7 @@ def persistent_load() -> typing.Dict[dict]:
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
try:
|
try:
|
||||||
with open(path, "r") as f:
|
with open(path, "r") as f:
|
||||||
storage = parse_yaml(f.read())
|
storage = unsafe_parse_yaml(f.read())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
import logging
|
import logging
|
||||||
logging.debug(f"Could not read store: {e}")
|
logging.debug(f"Could not read store: {e}")
|
||||||
|
|
Loading…
Reference in New Issue