Fixed some minor issues

Started work on Straight Stairs
This commit is contained in:
aerinon
2020-04-01 12:48:04 -06:00
parent c968621ba3
commit 01bff51707
13 changed files with 294 additions and 425 deletions

View File

@@ -1161,7 +1161,7 @@ class Door(object):
entrance.door = self
def getAddress(self):
if self.type == DoorType.Normal:
if self.type in [DoorType.Normal, DoorType.StraightStairs]:
return 0x13A000 + normal_offset_table[self.roomIndex] * 24 + (self.doorIndex + self.direction.value * 3) * 2
elif self.type == DoorType.SpiralStairs:
return 0x13B000 + (spiral_offset_table[self.roomIndex] + self.doorIndex) * 4
@@ -1175,9 +1175,11 @@ class Door(object):
return base_address[self.direction] + self.edge_id * 3
def getTarget(self, src):
if self.type == DoorType.Normal:
if self.type in [DoorType.Normal, DoorType.StraightStairs]:
bitmask = 4 * (self.layer ^ 1 if src.toggle else self.layer)
bitmask += 0x08 * int(self.trapFlag)
if src.type == DoorType.StraightStairs:
bitmask += 0x40
return [self.roomIndex, bitmask + self.doorIndex]
if self.type == DoorType.SpiralStairs:
bitmask = int(self.layer) << 2
@@ -1187,8 +1189,10 @@ class Door(object):
return [self.roomIndex, bitmask + self.quadrant, self.shiftX, self.shiftY]
if self.type == DoorType.Open:
bitmask = self.edge_id
bitmask += 0x10 * self.layer
bitmask += 0x10 * (self.layer ^ 1 if src.toggle else self.layer)
bitmask += 0x80
if src.type == DoorType.StraightStairs:
bitmask += 0x40
if src.type == DoorType.Open:
bitmask += 0x20 * self.quadrant
fraction = 0x10 * multiply_lookup[src.edge_width][self.edge_width]
@@ -1205,7 +1209,6 @@ class Door(object):
return (self.quadrant & 0x2) >> 1
return 0
def dir(self, direction, room, doorIndex, layer):
self.direction = direction
self.roomIndex = room