First pass on boss randomization

This commit is contained in:
aerinon
2022-10-06 14:17:12 -06:00
parent a5fc4dd7a6
commit 1529ec9473
9 changed files with 641 additions and 52 deletions

View File

@@ -22,6 +22,17 @@ class RoomObject:
def write_to_rom(self, rom):
rom.write_bytes(snes_to_pc(self.address), self.data)
# subtype 3 only?
def matches_oid(self, oid):
my_oid = (self.data[2] << 4) | ((self.data[1] & 3) << 2) | (self.data[0] & 3)
return my_oid == oid
@staticmethod
def subtype3_factory(x, y, type_id):
return RoomObject(None, [((x << 2) & 0xFC) | (type_id & 0x3),
((y << 2) & 0xFC) | ((type_id >> 2) & 0x3),
0xF0 | ((type_id >> 4) & 0xF)])
class DoorObject: