Skip to content

Commit b369ed5

Browse files
authored
Merge pull request #60 from axxroytovu/can_reach_location
Add canReachLocation
2 parents 9acd5a1 + 40477da commit b369ed5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/hooks/Rules.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,10 @@ def OptAll(world: World, multiworld: MultiWorld, state: CollectionState, player:
128128
for function in functions:
129129
requires_list = requires_list.replace("{" + function + "(temp)}", "{" + func_name + "(" + functions[func_name] + ")}")
130130
return requires_list
131+
132+
# Rule to expose the can_reach_location core function
133+
def canReachLocation(world: World, multiworld: MultiWorld, state: CollectionState, player: int, location: str):
134+
"""Can the player reach the given location?"""
135+
if state.can_reach_location(location, player):
136+
return True
137+
return False

0 commit comments

Comments
 (0)