diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-27 21:06:32 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-09-27 21:06:32 -0400 |
commit | 53e0509fcb20cc824e3fe5b3d3a826f09fc9c166 (patch) | |
tree | d83573fe2209122cc1c87d0a60ab22e6b20d4ec9 /apworld/tracker.py | |
parent | b0f474bee1c8e1111f7542bf4985136d9aedf340 (diff) | |
download | lingo2-archipelago-only-apworld.tar.gz lingo2-archipelago-only-apworld.tar.bz2 lingo2-archipelago-only-apworld.zip |
Treat worldports as items for tracker only-apworld
Diffstat (limited to 'apworld/tracker.py')
-rw-r--r-- | apworld/tracker.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/apworld/tracker.py b/apworld/tracker.py index 2c3d0f3..cf2dbe1 100644 --- a/apworld/tracker.py +++ b/apworld/tracker.py | |||
@@ -21,6 +21,7 @@ class Tracker: | |||
21 | collected_items: dict[int, int] | 21 | collected_items: dict[int, int] |
22 | checked_locations: set[int] | 22 | checked_locations: set[int] |
23 | accessible_locations: set[int] | 23 | accessible_locations: set[int] |
24 | accessible_worldports: set[int] | ||
24 | 25 | ||
25 | state: CollectionState | 26 | state: CollectionState |
26 | 27 | ||
@@ -29,6 +30,7 @@ class Tracker: | |||
29 | self.collected_items = {} | 30 | self.collected_items = {} |
30 | self.checked_locations = set() | 31 | self.checked_locations = set() |
31 | self.accessible_locations = set() | 32 | self.accessible_locations = set() |
33 | self.accessible_worldports = set() | ||
32 | 34 | ||
33 | def setup_slot(self, slot_data): | 35 | def setup_slot(self, slot_data): |
34 | Lingo2World.for_tracker = True | 36 | Lingo2World.for_tracker = True |
@@ -84,12 +86,21 @@ class Tracker: | |||
84 | self.state.collect(Lingo2Item(k.upper(), ItemClassification.progression, None, PLAYER_NUM), | 86 | self.state.collect(Lingo2Item(k.upper(), ItemClassification.progression, None, PLAYER_NUM), |
85 | prevent_sweep=True) | 87 | prevent_sweep=True) |
86 | 88 | ||
89 | for port_id in self.manager.worldports: | ||
90 | self.state.collect(Lingo2Item(f"Worldport {port_id} Entered", ItemClassification.progression, None, | ||
91 | PLAYER_NUM), prevent_sweep=True) | ||
92 | |||
87 | self.state.sweep_for_advancements() | 93 | self.state.sweep_for_advancements() |
88 | 94 | ||
89 | self.accessible_locations = set() | 95 | self.accessible_locations = set() |
96 | self.accessible_worldports = set() | ||
90 | 97 | ||
91 | for region in self.state.reachable_regions[PLAYER_NUM]: | 98 | for region in self.state.reachable_regions[PLAYER_NUM]: |
92 | for location in region.locations: | 99 | for location in region.locations: |
93 | if location.address not in self.checked_locations and location.access_rule(self.state): | 100 | if location.access_rule(self.state): |
94 | if location.address is not None: | 101 | if location.address is not None: |
95 | self.accessible_locations.add(location.address) | 102 | if location.address not in self.checked_locations: |
103 | self.accessible_locations.add(location.address) | ||
104 | elif hasattr(location, "port_id"): | ||
105 | if location.port_id not in self.manager.worldports: | ||
106 | self.accessible_worldports.add(location.port_id) | ||