Merge pull request #7 from Catobat/Special

Randomize Special Transitions
This commit is contained in:
codemann8
2022-05-04 16:46:07 -05:00
committed by GitHub
6 changed files with 227 additions and 111 deletions

View File

@@ -2238,7 +2238,6 @@ class Door(object):
class WorldType(IntEnum):
Light = 0
Dark = 1
Special = 2
@unique
@@ -2254,6 +2253,8 @@ class OWEdge(object):
self.type = DoorType.Open
self.direction = direction
self.terrain = terrain
self.specialEntrance = False
self.specialExit = False
self.deadEnd = False
# rom properties
@@ -2267,6 +2268,7 @@ class OWEdge(object):
self.zeroHzCam = False
self.zeroVtCam = False
self.edge_id = edge_id
self.specialID = 0x0
self.midpoint = 0x0
self.linkOpp = 0x0
@@ -2278,12 +2280,10 @@ class OWEdge(object):
self.unknownX = 0x0
self.unknownY = 0x0
if self.owIndex < 0x40:
if self.owIndex < 0x40 or self.owIndex >= 0x80:
self.worldType = WorldType.Light
elif self.owIndex < 0x80:
self.worldType = WorldType.Dark
else:
self.worldType = WorldType.Special
self.worldType = WorldType.Dark
# logical properties
# self.connected = False # combine with Dest?
@@ -2301,7 +2301,7 @@ class OWEdge(object):
return base_address[self.direction] + (self.edge_id * 16)
def getTarget(self):
return self.dest.edge_id
return self.dest.specialID if self.dest.specialExit else self.dest.edge_id
def dead_end(self):
self.deadEnd = True
@@ -2311,6 +2311,16 @@ class OWEdge(object):
self.vramLoc = vram_loc
return self
def special_entrance(self, special_id):
self.specialEntrance = True
self.specialID = special_id
return self
def special_exit(self, special_id):
self.specialExit = True
self.specialID = special_id
return self
def __eq__(self, other):
return isinstance(other, self.__class__) and self.name == other.name