Skip to content

Commit

Permalink
game controller completed locations should be derived from game state…
Browse files Browse the repository at this point in the history
… + 1 new missable to grant if option is on
  • Loading branch information
nbrochu committed Mar 6, 2024
1 parent 3aa9f8f commit cd181c3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
10 changes: 0 additions & 10 deletions worlds/zork_grand_inquisitor/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,6 @@ async def controller(self):
while not self.exit_event.is_set():
await asyncio.sleep(0.1)

# Update Completed Locations
completed_locations: Set[ZorkGrandInquisitorLocations] = set()

location_id: int
for location_id in self.checked_locations:
location: ZorkGrandInquisitorLocations = self.id_to_locations[location_id]
completed_locations.add(location)

self.game_controller.completed_locations = completed_locations

# Enqueue Received Item Delta
network_item: NetUtils.NetworkItem
for network_item in self.items_received:
Expand Down
2 changes: 1 addition & 1 deletion worlds/zork_grand_inquisitor/data/location_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ class ZorkGrandInquisitorLocationData(NamedTuple):
game_state_trigger=(("location", "dm2g"),),
archipelago_id=LOCATION_OFFSET + 128,
region=ZorkGrandInquisitorRegions.DM_LAIR_INTERIOR,
tags=(ZorkGrandInquisitorTags.CORE,),
tags=(ZorkGrandInquisitorTags.CORE, ZorkGrandInquisitorTags.MISSABLE),
requirements=(ZorkGrandInquisitorItems.HOTSPOT_MIRROR,),
),
ZorkGrandInquisitorLocations.YOUR_PUNY_WEAPONS_DONT_PHASE_ME_BABY: ZorkGrandInquisitorLocationData(
Expand Down
4 changes: 4 additions & 0 deletions worlds/zork_grand_inquisitor/game_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def _check_for_completed_locations(self) -> None:
break

if is_location_completed:
self.completed_locations.add(location)
self.completed_locations_queue.append(location)

def _check_for_missable_locations_to_grant(self) -> None:
Expand Down Expand Up @@ -456,6 +457,9 @@ def _check_for_missable_locations_to_grant(self) -> None:
if ZorkGrandInquisitorLocations.FIRE_FIRE in self.completed_locations:
if self._player_has(ZorkGrandInquisitorItems.PLASTIC_SIX_PACK_HOLDER):
self.completed_locations_queue.append(missable_location)
elif missable_location == ZorkGrandInquisitorLocations.YAD_GOHDNUORGREDNU_3_YRAUBORF:
if ZorkGrandInquisitorLocations.REASSEMBLE_SNAVIG in self.completed_locations:
self.completed_locations_queue.append(missable_location)
elif missable_location == ZorkGrandInquisitorLocations.YOUR_PUNY_WEAPONS_DONT_PHASE_ME_BABY:
if ZorkGrandInquisitorLocations.WANT_SOME_RYE_COURSE_YA_DO in self.completed_locations:
if self._player_has(ZorkGrandInquisitorItems.SWORD) and self._player_has(
Expand Down

0 comments on commit cd181c3

Please sign in to comment.