mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
OoT Entrance Randomizer (#125)
Add options:
"shuffle_grotto_entrances": GrottoEntrances,
"shuffle_dungeon_entrances": DungeonEntrances,
"owl_drops": OwlDrops,
"warp_songs": WarpSongs,
"spawn_positions": SpawnPositions,
Add Logic Trick:
"Skip King Zora as Adult with Nothing"
This commit is contained in:
@@ -5,8 +5,9 @@ from .Regions import TimeOfDay
|
||||
class OOTEntrance(Entrance):
|
||||
game: str = 'Ocarina of Time'
|
||||
|
||||
def __init__(self, player, name='', parent=None):
|
||||
def __init__(self, player, world, name='', parent=None):
|
||||
super(OOTEntrance, self).__init__(player, name, parent)
|
||||
self.world = world
|
||||
self.access_rules = []
|
||||
self.reverse = None
|
||||
self.replaces = None
|
||||
@@ -17,3 +18,27 @@ class OOTEntrance(Entrance):
|
||||
self.primary = False
|
||||
self.always = False
|
||||
self.never = False
|
||||
|
||||
def bind_two_way(self, other_entrance):
|
||||
self.reverse = other_entrance
|
||||
other_entrance.reverse = self
|
||||
|
||||
def disconnect(self):
|
||||
self.connected_region.entrances.remove(self)
|
||||
previously_connected = self.connected_region
|
||||
self.connected_region = None
|
||||
return previously_connected
|
||||
|
||||
def get_new_target(self):
|
||||
root = self.world.get_region('Root Exits', self.player)
|
||||
target_entrance = OOTEntrance(self.player, self.world, 'Root -> ' + self.connected_region.name, root)
|
||||
target_entrance.connect(self.connected_region)
|
||||
target_entrance.replaces = self
|
||||
root.exits.append(target_entrance)
|
||||
return target_entrance
|
||||
|
||||
def assume_reachable(self):
|
||||
if self.assumed == None:
|
||||
self.assumed = self.get_new_target()
|
||||
self.disconnect()
|
||||
return self.assumed
|
||||
|
||||
Reference in New Issue
Block a user