Made flute spots order on menu based on OW Slot rather than OWID

This commit is contained in:
codemann8
2021-06-29 17:28:51 -05:00
parent 4b994b173e
commit 2394e07e4b
2 changed files with 27 additions and 25 deletions

View File

@@ -141,9 +141,9 @@ def link_overworld(world, player):
# flute shuffle
def connect_flutes(flute_destinations):
for o in range(0, len(flute_destinations)):
owid = flute_destinations[o]
regions = flute_data[owid][0]
if (world.mode[player] == 'inverted') == (owid in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):
owslot = flute_destinations[o]
regions = flute_data[owslot][0]
if (world.mode[player] == 'inverted') == (flute_data[owslot][1] in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):
connect_simple(world, 'Flute Spot ' + str(o + 1), regions[0], player)
else:
connect_simple(world, 'Flute Spot ' + str(o + 1), regions[1], player)
@@ -155,12 +155,13 @@ def link_overworld(world, player):
new_spots = SortedList()
# guarantee desert/mire access
flute_pool.remove(0x30)
new_spots.add(0x30)
flute_pool.remove(0x38)
new_spots.add(0x38)
# guarantee mountain access
owid = random.randint(0, 2) * 2 + 3
flute_pool.remove(owid)
new_spots.add(owid)
mountainIds = [0x0b, 0x0e, 0x07]
owslot = mountainIds[random.randint(0, 2)]
flute_pool.remove(owslot)
new_spots.add(owslot)
random.shuffle(flute_pool)
f = 0

35
Rom.py
View File

@@ -651,28 +651,29 @@ def patch_rom(world, rom, player, team, enemized, is_mystery=False):
flute_spots = world.owflutespots[player]
for o in range(0, len(flute_spots)):
owid = flute_spots[o]
owslot = flute_spots[o]
offset = 0
if (world.mode[player] == 'inverted') != (owid in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):
data = flute_data[owslot]
if (world.mode[player] == 'inverted') != (data[1] in world.owswaps[player][0] and world.owSwap[player] == 'mixed'):
offset = 0x40
data = flute_data[owid]
write_int16(rom, snes_to_pc(0x02E849 + (o * 2)), owid + offset) # owid
write_int16(rom, snes_to_pc(0x02E86B + (o * 2)), data[1]) #vram
write_int16(rom, snes_to_pc(0x02E88D + (o * 2)), data[2]) # BG scroll Y
write_int16(rom, snes_to_pc(0x02E8AF + (o * 2)), data[3]) # BG scroll X
write_int16(rom, snes_to_pc(0x02E8D1 + (o * 2)), data[12] if offset > 0 and len(data) > 12 else data[4]) # link Y
write_int16(rom, snes_to_pc(0x02E8F3 + (o * 2)), data[13] if offset > 0 and len(data) > 12 else data[5]) # link X
write_int16(rom, snes_to_pc(0x02E915 + (o * 2)), data[6]) # cam Y
write_int16(rom, snes_to_pc(0x02E937 + (o * 2)), data[7]) # cam X
write_int16(rom, snes_to_pc(0x02E959 + (o * 2)), data[8]) # unknown 1
write_int16(rom, snes_to_pc(0x02E97B + (o * 2)), data[9]) # unknown 2
write_int16(rom, snes_to_pc(0x02E849 + (o * 2)), data[1] + offset) # owid
write_int16(rom, snes_to_pc(0x02E86B + (o * 2)), data[2]) #vram
write_int16(rom, snes_to_pc(0x02E88D + (o * 2)), data[3]) # BG scroll Y
write_int16(rom, snes_to_pc(0x02E8AF + (o * 2)), data[4]) # BG scroll X
write_int16(rom, snes_to_pc(0x02E8D1 + (o * 2)), data[13] if offset > 0 and len(data) > 13 else data[5]) # link Y
write_int16(rom, snes_to_pc(0x02E8F3 + (o * 2)), data[14] if offset > 0 and len(data) > 13 else data[6]) # link X
write_int16(rom, snes_to_pc(0x02E915 + (o * 2)), data[7]) # cam Y
write_int16(rom, snes_to_pc(0x02E937 + (o * 2)), data[8]) # cam X
write_int16(rom, snes_to_pc(0x02E959 + (o * 2)), data[9]) # unknown 1
write_int16(rom, snes_to_pc(0x02E97B + (o * 2)), data[10]) # unknown 2
# flute menu blips
rom.write_byte(snes_to_pc(0x0AB783 + o), data[11] & 0xff) # X low byte
rom.write_byte(snes_to_pc(0x0AB78B + o), data[11] // 0x100) # X high byte
rom.write_byte(snes_to_pc(0x0AB793 + o), data[10] & 0xff) # Y low byte
rom.write_byte(snes_to_pc(0x0AB79B + o), data[10] // 0x100) # Y high byte
rom.write_byte(snes_to_pc(0x0AB783 + o), data[12] & 0xff) # X low byte
rom.write_byte(snes_to_pc(0x0AB78B + o), data[12] // 0x100) # X high byte
rom.write_byte(snes_to_pc(0x0AB793 + o), data[11] & 0xff) # Y low byte
rom.write_byte(snes_to_pc(0x0AB79B + o), data[11] // 0x100) # Y high byte
# patch entrance/exits/holes