* Fix chests always being for yourself AND intended recipient for Race Rom seeds.
* Fix MultiMystery not being able to correctly pack Race Rom seeds into a zip file.
* Add tags to multidata for Race rom, Spoiler log, and Playthrough if spoiler log was generated.
This commit is contained in:
CaitSith2 2020-10-21 02:02:13 -07:00
parent 963abac2d7
commit 651e1a1901
4 changed files with 17 additions and 5 deletions

View File

@ -296,6 +296,13 @@ def main(args, seed=None):
for future in roms:
rom_name = future.result()
rom_names.append(rom_name)
multidatatags = ["ER"]
if args.race:
multidatatags.append("Race")
if args.create_spoiler:
multidatatags.append("Spoiler")
if not args.skip_playthrough:
multidatatags.append("Play through")
multidata = zlib.compress(json.dumps({"names": parsed_names,
# backwards compat for < 2.4.1
"roms": [(slot, team, list(name.encode()))
@ -311,7 +318,7 @@ def main(args, seed=None):
"er_hint_data": er_hint_data,
"precollected_items": precollected_items,
"version": _version_tuple,
"tags": ["ER"]
"tags": multidatatags
}).encode("utf-8"), 9)
with open(output_path('%s.multidata' % outfilebase), 'wb') as f:

View File

@ -57,12 +57,12 @@ def main(args=None, callback=ERmain):
seed = get_seed(args.seed)
random.seed(seed)
if args.race:
random.seed() # reset to time-based random source
seedname = "M" + (f"{random.randint(0, pow(10, seeddigits) - 1)}".zfill(seeddigits))
print(f"Generating mystery for {args.multi} player{'s' if args.multi > 1 else ''}, {seedname} Seed {seed}")
if args.race:
random.seed() # reset to time-based random source
weights_cache = {}
if args.weights:
try:

7
Rom.py
View File

@ -1,5 +1,5 @@
JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = '31d50ce7f1dd3bc33bdc3b2e90f0104e'
RANDOMIZERBASEHASH = '1217774de26e67d300fa681775e8c08d'
import io
import json
@ -73,13 +73,18 @@ class LocalRom(object):
itemtable = []
locationtable = []
itemplayertable = []
for i in range(168):
itemtable.append(self.read_byte(0xE96E + (i * 3)))
itemplayertable.append(self.read_byte(0x186142 + (i * 3)))
locationtable.append(self.read_byte(0xe96C + (i * 3)))
locationtable.append(self.read_byte(0xe96D + (i * 3)))
self.write_bytes(0xE96C, locationtable)
self.write_bytes(0xE96C + 0x150, itemtable)
self.encrypt_range(0xE96C + 0x150, 168, key)
self.write_bytes(0x186140, [0] * 0x150)
self.write_bytes(0x186140 + 0x150, itemplayertable)
self.encrypt_range(0x186140 + 0x150, 168, key)
self.encrypt_range(0x180000, 32, key)
self.encrypt_range(0x180140, 32, key)

Binary file not shown.