Skip to content

Commit

Permalink
LttP: now that Enemizer allows for AP rom name, rename it. (#730)
Browse files Browse the repository at this point in the history
* LttP: now that Enemizer allows for AP rom name, rename it.

* LttP: fix missing Enemizer message parenthesis
  • Loading branch information
Berserker66 authored Jun 30, 2022
1 parent d7a9b98 commit cea7278
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions worlds/alttp/Rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import xxtea
import concurrent.futures
import bsdiff4
from typing import Optional
from typing import Optional, List

from BaseClasses import CollectionState, Region, Location
from worlds.alttp.Shops import ShopType, ShopPriceType
Expand Down Expand Up @@ -186,7 +186,7 @@ def check_enemizer(enemizercli):
# some time may have passed since the lock was acquired, as such a quick re-check doesn't hurt
if getattr(check_enemizer, "done", None):
return

wanted_version = (7, 0, 1)
# version info is saved on the lib, for some reason
library_info = os.path.join(os.path.dirname(enemizercli), "EnemizerCLI.Core.deps.json")
with open(library_info) as f:
Expand All @@ -197,10 +197,11 @@ def check_enemizer(enemizercli):
version = lib.split("/")[-1]
version = tuple(int(element) for element in version.split("."))
enemizer_logger.debug(f"Found Enemizer version {version}")
if version < (6, 4, 0):
if version < wanted_version:
raise Exception(
f"Enemizer found at {enemizercli} is outdated ({info}), please update your Enemizer. "
f"Such as https://github.com/Ijwu/Enemizer/releases")
f"Enemizer found at {enemizercli} is outdated ({version}) < ({wanted_version}), "
f"please update your Enemizer. "
f"Such as from https://github.com/Ijwu/Enemizer/releases")
break
else:
raise Exception(f"Could not find Enemizer library version information in {library_info}")
Expand Down Expand Up @@ -1645,8 +1646,7 @@ def get_reveal_bytes(itemName):
# set rom name
# 21 bytes
from Main import __version__
# TODO: Adjust Enemizer to accept AP and AD
rom.name = bytearray(f'BM{__version__.replace(".", "")[0:3]}_{player}_{world.seed:11}\0', 'utf8')[:21]
rom.name = bytearray(f'AP{__version__.replace(".", "")[0:3]}_{player}_{world.seed:11}\0', 'utf8')[:21]
rom.name.extend([0] * (21 - len(rom.name)))
rom.write_bytes(0x7FC0, rom.name)

Expand Down Expand Up @@ -1677,7 +1677,7 @@ def patch_race_rom(rom, world, player):
rom.encrypt(world, player)


def get_price_data(price: int, price_type: int) -> bytes:
def get_price_data(price: int, price_type: int) -> List[int]:
if price_type != ShopPriceType.Rupees:
# Set special price flag 0x8000
# Then set the type of price we're setting 0x7F00 (this starts from Hearts, not Rupees, subtract 1)
Expand Down

0 comments on commit cea7278

Please sign in to comment.