Skip to content

Commit

Permalink
allow i'm not impressed to be triggered shore-side, while keeping the…
Browse files Browse the repository at this point in the history
… logic expectation of being across the river
  • Loading branch information
nbrochu committed Nov 23, 2024
1 parent 38ad9a6 commit cdbce91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion worlds/zork_grand_inquisitor/data/location_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ZorkGrandInquisitorLocationData(NamedTuple):
Tuple[int, int],
Tuple[int, Tuple[int, ...]],
Tuple[Tuple[int, ...], int],
Tuple[str, Tuple[str, ...]],
],
...,
]
Expand Down Expand Up @@ -669,7 +670,7 @@ class ZorkGrandInquisitorLocationData(NamedTuple):
),
),
ZorkGrandInquisitorLocations.I_AM_NOT_IMPRESSED: ZorkGrandInquisitorLocationData(
game_state_trigger=(("location", "hp4f"), (8419, 1)),
game_state_trigger=(("location", ("hp4f", "hp1g")), (8419, 1)),
archipelago_id=LOCATION_OFFSET + 63,
region=ZorkGrandInquisitorRegions.HADES,
tags=(ZorkGrandInquisitorTags.CORE,),
Expand Down
13 changes: 9 additions & 4 deletions worlds/zork_grand_inquisitor/game_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,12 +598,17 @@ def _check_for_completed_locations(self) -> None:
is_location_completed: bool = True

trigger: Union[str, int, Tuple[int, ...]]
value: Union[str, int, Tuple[int, ...]]
value: Union[str, int, Tuple[int, ...], Tuple[str, ...]]
for trigger, value in data.game_state_trigger:
if trigger == "location":
if not self._player_is_at(value):
is_location_completed = False
break
if isinstance(value, str):
if not self._player_is_at(value):
is_location_completed = False
break
elif isinstance(value, tuple):
if not any(self._player_is_at(key) for key in value):
is_location_completed = False
break
elif isinstance(trigger, int):
if isinstance(value, int):
if self._read_game_state_value_for(trigger) != value:
Expand Down

0 comments on commit cdbce91

Please sign in to comment.