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:
espeon65536
2021-11-11 04:42:08 -05:00
committed by GitHub
parent 80c86f34a4
commit 8eb1f0258c
9 changed files with 949 additions and 34 deletions

View File

@@ -451,14 +451,16 @@ class Rule_AST_Transformer(ast.NodeTransformer):
if self.world.ensure_tod_access:
# tod has DAY or (tod == NONE and (ss or find a path from a provider))
# parsing is better than constructing this expression by hand
return ast.parse("(tod & TimeOfDay.DAY) if tod else (state.has_all(('Ocarina', 'Suns Song')) or state.search.can_reach(spot.parent_region, age=age, tod=TimeOfDay.DAY))", mode='eval').body
r = self.current_spot if type(self.current_spot) == OOTRegion else self.current_spot.parent_region
return ast.parse(f"(state.has('Ocarina', player) and state.has('Suns Song', player)) or state._oot_reach_at_time('{r.name}', TimeOfDay.DAY, [], player)", mode='eval').body
return ast.NameConstant(True)
def at_dampe_time(self, node):
if self.world.ensure_tod_access:
# tod has DAMPE or (tod == NONE and (find a path from a provider))
# parsing is better than constructing this expression by hand
return ast.parse("(tod & TimeOfDay.DAMPE) if tod else state.search.can_reach(spot.parent_region, age=age, tod=TimeOfDay.DAMPE)", mode='eval').body
r = self.current_spot if type(self.current_spot) == OOTRegion else self.current_spot.parent_region
return ast.parse(f"state._oot_reach_at_time('{r.name}', TimeOfDay.DAMPE, [], player)", mode='eval').body
return ast.NameConstant(True)
def at_night(self, node):
@@ -468,7 +470,8 @@ class Rule_AST_Transformer(ast.NodeTransformer):
if self.world.ensure_tod_access:
# tod has DAMPE or (tod == NONE and (ss or find a path from a provider))
# parsing is better than constructing this expression by hand
return ast.parse("(tod & TimeOfDay.DAMPE) if tod else (state.has_all(('Ocarina', 'Suns Song')) or state.search.can_reach(spot.parent_region, age=age, tod=TimeOfDay.DAMPE))", mode='eval').body
r = self.current_spot if type(self.current_spot) == OOTRegion else self.current_spot.parent_region
return ast.parse(f"(state.has('Ocarina', player) and state.has('Suns Song', player)) or state._oot_reach_at_time('{r.name}', TimeOfDay.DAMPE, [], player)", mode='eval').body
return ast.NameConstant(True)