Skip to content

Commit

Permalink
output starter in client on /zork
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrochu committed Nov 22, 2024
1 parent b9e06c2 commit 4417e59
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions worlds/zork_grand_inquisitor/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def _cmd_zork(self) -> None:
self.output("Successfully attached to Zork Grand Inquisitor process.")

self.ctx.game_controller.output_seed_information()
self.ctx.game_controller.output_starter_kit()
else:
self.output("Failed to attach to Zork Grand Inquisitor process.")

Expand Down Expand Up @@ -140,6 +141,9 @@ def on_package(self, cmd: str, _args: Any) -> None:
_args["slot_data"]["grant_missable_location_checks"] == 1
)

# Starter Kit
self.game_controller.starter_kit = _args["slot_data"]["starter_kit"]

# Initial Totemizer Destination
self.game_controller.initial_totemizer_destination = item_names_to_item()[
_args["slot_data"]["initial_totemizer_destination"]
Expand Down
24 changes: 24 additions & 0 deletions worlds/zork_grand_inquisitor/game_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class GameController:
option_landmarksanity: Optional[ZorkGrandInquisitorLandmarksanity]
option_grant_missable_location_checks: Optional[bool]

starter_kit: Optional[List[str]]
initial_totemizer_destination: Optional[ZorkGrandInquisitorItems]

def __init__(self, logger=None) -> None:
Expand Down Expand Up @@ -116,6 +117,7 @@ def __init__(self, logger=None) -> None:
self.option_landmarksanity = None
self.option_grant_missable_location_checks = None

self.starter_kit = None
self.initial_totemizer_destination = None

@functools.cached_property
Expand Down Expand Up @@ -194,6 +196,28 @@ def output_seed_information(self) -> None:
else:
self.log(f" Grant Missable Location Checks: Off")

def output_starter_kit(self) -> None:
if self.starter_kit is None:
return

self.log("Starter Kit:")

if len(self.starter_kit):
item: str
for item in self.starter_kit:
if self.option_hotspots == ZorkGrandInquisitorHotspots.ENABLED:
if item.startswith("Hotspot"):
continue
elif item in (
"Hotspot: Dungeon Master's Lair Entrance",
"Hotspot: Spell Lab Bridge Exit",
):
continue

self.log(f" {item}")
else:
self.log(" Nothing")

def output_goal_item_update(self) -> None:
if self.goal_completed:
return
Expand Down
1 change: 1 addition & 0 deletions worlds/zork_grand_inquisitor/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def fill_slot_data(self) -> Dict[str, Any]:
"grant_missable_location_checks",
)

slot_data["starter_kit"] = sorted([item.value for item in self.starter_kit])
slot_data["initial_totemizer_destination"] = self.initial_totemizer_destination.value

return slot_data
Expand Down

0 comments on commit 4417e59

Please sign in to comment.