First pass on multiworld for enemy drops. Fixed a few graphical enemizer issues.

This commit is contained in:
aerinon
2023-06-26 10:29:37 -06:00
parent 503be6aa91
commit 627168e771
12 changed files with 97 additions and 38 deletions

View File

@@ -2107,16 +2107,24 @@ class EnemyTable:
data_pointer += 2
for room in range(0, 0x128):
if room in self.room_map:
tracking_mask = 0x00
data_address = pc_to_snes(data_pointer) & 0xFFFF
rom.write_bytes(pointer_address + room * 2, int16_as_bytes(data_address))
rom.write_byte(data_pointer, 0x01 if room in layered_oam_rooms else 0x00)
list_offset = 1
for sprite in self.room_map[room]:
idx_adj = 0
for idx, sprite in enumerate(self.room_map[room]):
data = sprite.sprite_data()
rom.write_bytes(data_pointer + list_offset, data)
list_offset += len(data)
if sprite.sub_type == 0x07: # overlord
idx_adj += 1
continue
if sprite.location is not None:
tracking_mask |= 1 << (15 - idx + idx_adj)
rom.write_byte(data_pointer + list_offset, 0xff)
data_pointer += list_offset + 1
rom.write_bytes(snes_to_pc(0x28ACB0) + room * 2, int16_as_bytes(tracking_mask))
else:
rom.write_bytes(pointer_address + room * 2, int16_as_bytes(empty_pointer))

View File

@@ -46,9 +46,10 @@ class Room:
def find_all_pots(self):
pots = []
pots.extend([x for x in self.layer1 if x.data[2] == 0xFA])
pots.extend([x for x in self.layer2 if x.data[2] == 0xFA])
pots.extend([x for x in self.layer3 if x.data[2] == 0xFA])
pots.extend([x for x in self.layer1 if x.data[2] in {0xFA, 0xFB} and not x.dummy])
pots.extend([x for x in self.layer2 if x.data[2] in {0xFA, 0xFB} and not x.dummy])
if self.layer3:
pots.extend([x for x in self.layer3 if x.data[2] in {0xFA, 0xFB} and not x.dummy])
return pots
@@ -514,12 +515,12 @@ Room0127 = Room([0xE1, 0x00],
RoomObject(0x0AB61E, [0x43, 0xCB, 0xFA]),
RoomObject(0x0AB621, [0x4B, 0xCB, 0xFA]),
RoomObject(0x0AB624, [0xBF, 0x94, 0xF9]),
RoomObject(0x0AB627, [0xB3, 0xB3, 0xFA]),
RoomObject(0x0AB62A, [0xCB, 0xB3, 0xFA]),
RoomObject(0x0AB627, [0xB3, 0xB3, 0xFA], True),
RoomObject(0x0AB62A, [0xCB, 0xB3, 0xFA], True),
RoomObject(0x0AB62D, [0xAD, 0xC8, 0xDF]),
RoomObject(0x0AB630, [0xC4, 0xC8, 0xDF]),
RoomObject(0x0AB633, [0xB3, 0xE3, 0xFA]),
RoomObject(0x0AB636, [0xCB, 0xE3, 0xFA]),
RoomObject(0x0AB633, [0xB3, 0xE3, 0xFA], True),
RoomObject(0x0AB636, [0xCB, 0xE3, 0xFA], True),
RoomObject(0x0AB639, [0x81, 0x93, 0xC0]),
RoomObject(0x0AB63C, [0x81, 0xD2, 0xC0]),
RoomObject(0x0AB63F, [0xE1, 0x93, 0xC0]),

View File

@@ -8,9 +8,10 @@ Shuffled_Pot = (0xFB, 0, 0) # formerly weird pot, or black diagonal thing
class RoomObject:
def __init__(self, address, data):
def __init__(self, address, data, dummy=False):
self.address = address
self.data = data
self.dummy = dummy # some room objects are dummies, unreachable
def change_type(self, new_type):
type_id, datum_a, datum_b = new_type