diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-22 12:05:18 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-22 12:05:18 -0400 |
commit | 424f5d4a830fb43f86c76d73d795412890d55bc2 (patch) | |
tree | e949a30d7d683cb45d3c0dcfd8f391a769c3dc7f /apworld/rules.py | |
parent | bc3f90b6bdfdb651570a7b3f0e80fea19db14974 (diff) | |
download | lingo2-archipelago-424f5d4a830fb43f86c76d73d795412890d55bc2.tar.gz lingo2-archipelago-424f5d4a830fb43f86c76d73d795412890d55bc2.tar.bz2 lingo2-archipelago-424f5d4a830fb43f86c76d73d795412890d55bc2.zip |
[Apworld] Added worldport shuffle
Diffstat (limited to 'apworld/rules.py')
-rw-r--r-- | apworld/rules.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apworld/rules.py b/apworld/rules.py index c077858..f859e75 100644 --- a/apworld/rules.py +++ b/apworld/rules.py | |||
@@ -54,10 +54,13 @@ def lingo2_can_satisfy_requirements(state: CollectionState, reqs: AccessRequirem | |||
54 | return True | 54 | return True |
55 | 55 | ||
56 | def make_location_lambda(reqs: AccessRequirements, world: "Lingo2World", | 56 | def make_location_lambda(reqs: AccessRequirements, world: "Lingo2World", |
57 | regions: dict[str, Region]) -> Callable[[CollectionState], bool]: | 57 | regions: dict[str, Region] | None) -> Callable[[CollectionState], bool]: |
58 | # Replace required rooms with regions for the top level requirement, which saves looking up the regions during rule | 58 | # Replace required rooms with regions for the top level requirement, which saves looking up the regions during rule |
59 | # checking. | 59 | # checking. |
60 | required_regions = [regions[room_name] for room_name in reqs.rooms] | 60 | if regions is not None: |
61 | required_regions = [regions[room_name] for room_name in reqs.rooms] | ||
62 | else: | ||
63 | required_regions = [world.multiworld.get_region(room_name, world.player) for room_name in reqs.rooms] | ||
61 | new_reqs = reqs.copy() | 64 | new_reqs = reqs.copy() |
62 | new_reqs.rooms.clear() | 65 | new_reqs.rooms.clear() |
63 | return lambda state: lingo2_can_satisfy_requirements(state, new_reqs, required_regions, world) | 66 | return lambda state: lingo2_can_satisfy_requirements(state, new_reqs, required_regions, world) |