Skip to content

Commit

Permalink
address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrochu committed Mar 7, 2024
1 parent 0dc90b3 commit 5661d25
Show file tree
Hide file tree
Showing 5 changed files with 231 additions and 125 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
from typing import Dict, NamedTuple, Optional, Tuple

from ..enums import ZorkGrandInquisitorItems, ZorkGrandInquisitorLocations


class ZorkGrandInquisitorMissableLocationGrantConditionsData(NamedTuple):
location_condition: ZorkGrandInquisitorLocations
item_conditions: Optional[Tuple[ZorkGrandInquisitorItems, ...]]


missable_location_grant_conditions_data: Dict[
ZorkGrandInquisitorLocations, ZorkGrandInquisitorMissableLocationGrantConditionsData
] = {
ZorkGrandInquisitorLocations.BOING_BOING_BOING:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.FLYING_SNAPDRAGON,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.BONK:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.PROZORKED,
item_conditions=(ZorkGrandInquisitorItems.HAMMER,),
)
,
ZorkGrandInquisitorLocations.DEATH_ARRESTED_WITH_JACK:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.ARREST_THE_VANDAL,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_ATTACKED_THE_QUELBEES:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.OUTSMART_THE_QUELBEES,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_EATEN_BY_A_GRUE:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.MAGIC_FOREVER,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_LOST_GAME_OF_STRIP_GRUE_FIRE_WATER:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.STRIP_GRUE_FIRE_WATER,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_LOST_SOUL_TO_OLD_SCRATCH:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.OLD_SCRATCH_WINNER,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_OUTSMARTED_BY_THE_QUELBEES:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.OUTSMART_THE_QUELBEES,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_SLICED_UP_BY_THE_INVISIBLE_GUARD:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.YOU_GAINED_86_EXPERIENCE_POINTS,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_STEPPED_INTO_THE_INFINITE:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.A_SMALLWAY,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_SWALLOWED_BY_A_DRAGON:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.THAR_SHE_BLOWS,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_YOURE_NOT_CHARON:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.OPEN_THE_GATES_OF_HELL,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DEATH_ZORK_ROCKS_EXPLODED:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.CRISIS_AVERTED,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.DENIED_BY_THE_LAKE_MONSTER:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.WOW_IVE_NEVER_GONE_INSIDE_HIM_BEFORE,
item_conditions=(ZorkGrandInquisitorItems.SPELL_GOLGATEM,),
)
,
ZorkGrandInquisitorLocations.EMERGENCY_MAGICATRONIC_MESSAGE:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.ARTIFACTS_EXPLAINED,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.FAT_LOT_OF_GOOD_THATLL_DO_YA:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.YOU_GAINED_86_EXPERIENCE_POINTS,
item_conditions=(ZorkGrandInquisitorItems.SPELL_IGRAM,),
)
,
ZorkGrandInquisitorLocations.I_DONT_THINK_YOU_WOULDVE_WANTED_THAT_TO_WORK_ANYWAY:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.PROZORKED,
item_conditions=(ZorkGrandInquisitorItems.SPELL_THROCK,),
)
,
ZorkGrandInquisitorLocations.I_SPIT_ON_YOUR_FILTHY_COINAGE:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.YOU_GAINED_86_EXPERIENCE_POINTS,
item_conditions=(ZorkGrandInquisitorItems.POUCH_OF_ZORKMIDS,),
)
,
ZorkGrandInquisitorLocations.MEAD_LIGHT:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.FIRE_FIRE,
item_conditions=(ZorkGrandInquisitorItems.MEAD_LIGHT,),
)
,
ZorkGrandInquisitorLocations.MUSHROOM_HAMMERED:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.THROCKED_MUSHROOM_HAMMERED,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.NO_AUTOGRAPHS:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.FIRE_FIRE,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.NO_BONDAGE:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.HELP_ME_CANT_BREATHE,
item_conditions=(ZorkGrandInquisitorItems.ROPE,),
)
,
ZorkGrandInquisitorLocations.TALK_TO_ME_GRAND_INQUISITOR:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.FIRE_FIRE,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.THATS_A_ROPE:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.FIRE_FIRE,
item_conditions=(ZorkGrandInquisitorItems.ROPE,),
)
,
ZorkGrandInquisitorLocations.THATS_IT_JUST_KEEP_HITTING_THOSE_BUTTONS:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.ENJOY_YOUR_TRIP,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.THATS_STILL_A_ROPE:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.YOU_GAINED_86_EXPERIENCE_POINTS,
item_conditions=(ZorkGrandInquisitorItems.SPELL_GLORF,),
)
,
ZorkGrandInquisitorLocations.WHAT_ARE_YOU_STUPID:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.FIRE_FIRE,
item_conditions=(ZorkGrandInquisitorItems.PLASTIC_SIX_PACK_HOLDER,),
)
,
ZorkGrandInquisitorLocations.YAD_GOHDNUORGREDNU_3_YRAUBORF:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.REASSEMBLE_SNAVIG,
item_conditions=None,
)
,
ZorkGrandInquisitorLocations.YOUR_PUNY_WEAPONS_DONT_PHASE_ME_BABY:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.WANT_SOME_RYE_COURSE_YA_DO,
item_conditions=(ZorkGrandInquisitorItems.SWORD, ZorkGrandInquisitorItems.HOTSPOT_HARRY),
)
,
ZorkGrandInquisitorLocations.YOU_DONT_GO_MESSING_WITH_A_MANS_ZIPPER:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.YOU_GAINED_86_EXPERIENCE_POINTS,
item_conditions=(ZorkGrandInquisitorItems.SPELL_REZROV,),
)
,
ZorkGrandInquisitorLocations.YOU_WANT_A_PIECE_OF_ME_DOCK_BOY:
ZorkGrandInquisitorMissableLocationGrantConditionsData(
location_condition=ZorkGrandInquisitorLocations.HELP_ME_CANT_BREATHE,
item_conditions=None,
)
,
}
15 changes: 3 additions & 12 deletions worlds/zork_grand_inquisitor/data_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def item_names_to_id() -> Dict[str, int]:


def item_names_to_item() -> Dict[str, ZorkGrandInquisitorItems]:
return {item.value: item for item, _ in item_data.items()}
return {item.value: item for item in item_data}


def location_names_to_id() -> Dict[str, int]:
Expand Down Expand Up @@ -57,16 +57,12 @@ def id_to_locations() -> Dict[int, ZorkGrandInquisitorLocations]:
def item_groups() -> Dict[str, Set[str]]:
groups: Dict[str, Set[str]] = dict()

tag: ZorkGrandInquisitorTags
for tag in ZorkGrandInquisitorTags:
groups[tag.value] = set()

item: ZorkGrandInquisitorItems
data: ZorkGrandInquisitorItemData
for item, data in item_data.items():
if data.tags is not None:
for tag in data.tags:
groups[tag.value].add(item.value)
groups.setdefault(tag.value, set()).add(item.value)

return {k: v for k, v in groups.items() if len(v)}

Expand Down Expand Up @@ -136,15 +132,10 @@ def locations_by_region(include_deathsanity: bool = False) -> Dict[


def locations_with_tag(tag: ZorkGrandInquisitorTags) -> Set[ZorkGrandInquisitorLocations]:
locations: Set[ZorkGrandInquisitorLocations] = set()

location: ZorkGrandInquisitorLocations
data: ZorkGrandInquisitorLocationData
for location, data in location_data.items():
if data.tags is not None and tag in data.tags:
locations.add(location)

return locations
return {location for location, data in location_data.items() if data.tags is not None and tag in data.tags}


def location_access_rule_for(location: ZorkGrandInquisitorLocations, player: int) -> str:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Zork Grand Inquisitor

## Where is the settings page?
## Where is the options page?

The [player options page for this game](../player-options) contains all the options you need to configure and export a
configuration file.
Expand Down
Loading

0 comments on commit 5661d25

Please sign in to comment.