bugfixes, starting boots

This commit is contained in:
qadan
2020-02-11 18:25:09 -04:00
parent d235ebbe01
commit e94131ab1d
4 changed files with 12 additions and 5 deletions

8
Rom.py
View File

@@ -872,7 +872,7 @@ def patch_rom(world, player, rom):
rom.write_byte(x, 0) # Zero the initial equipment array
rom.write_byte(0x18302C, 0x18) # starting max health
rom.write_byte(0x18302D, 0x18) # starting current health
rom.write_byte(0x183039, 0x68) # starting abilities, bit array
ability_flags = 0x68 # starting abilities, bit array; may be modified by precollected items
for item in world.precollected_items:
if item.player != player:
@@ -882,9 +882,15 @@ def patch_rom(world, player, rom):
rom.write_byte(0x183000+0x19, 0x01)
rom.write_byte(0x0271A6+0x19, 0x01)
rom.write_byte(0x180043, 0x01) # special starting sword byte
elif item.name == 'Pegasus Boots':
rom.write_byte(0x183015, 0x01)
ability_flags |= 0b00000100
else:
raise RuntimeError("Unsupported pre-collected item: {}".format(item))
# write ability flags after determined.
rom.write_byte(0x183039, ability_flags)
rom.write_byte(0x18004A, 0x00 if world.mode != 'inverted' else 0x01) # Inverted mode
rom.write_byte(0x18005D, 0x00) # Hammer always breaks barrier
rom.write_byte(0x2AF79, 0xD0 if world.mode != 'inverted' else 0xF0) # vortexes: Normal (D0=light to dark, F0=dark to light, 42 = both)