Skip to content

Commit

Permalink
pivot on goal option + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrochu committed Nov 20, 2023
1 parent acf9cab commit e870fec
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 104 deletions.
7 changes: 2 additions & 5 deletions worlds/zork_grand_inquisitor/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import CommonClient
import Utils

from .data_funcs import item_names_to_id, location_names_to_id, id_to_items, id_to_locations
from .data_funcs import item_names_to_id, location_names_to_id, id_to_items, id_to_locations, id_to_goals
from .game_controller import GameController


Expand All @@ -25,9 +25,6 @@ class ZorkGrandInquisitorContext(CommonClient.CommonContext):
items_handling = 0b111
want_slot_data = True

option_skip_old_scratch_minigame = False
option_deathsanity = False

item_name_to_id = item_names_to_id()
location_name_to_id = location_names_to_id()

Expand Down Expand Up @@ -119,7 +116,7 @@ async def controller(ctx):
async def process_package(ctx: ZorkGrandInquisitorContext, cmd, _args):
if cmd == "Connected":
# Slot Data - Options
ctx.game_controller.option_skip_old_scratch_minigame = _args["slot_data"]["skip_old_scratch_minigame"] == 1
ctx.game_controller.option_goal = id_to_goals()[_args["slot_data"]["goal"]]
ctx.game_controller.option_deathsanity = _args["slot_data"]["deathsanity"] == 1


Expand Down
14 changes: 1 addition & 13 deletions worlds/zork_grand_inquisitor/data/entrance_rule_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@
),
(ZorkGrandInquisitorRegions.DRAGON_ARCHIPELAGO, ZorkGrandInquisitorRegions.ENDGAME): (
(
ZorkGrandInquisitorEvents.SWORD_ACCESSIBLE,
ZorkGrandInquisitorItems.SPELL_VOXAM,
ZorkGrandInquisitorItems.SPELL_REZROV,
ZorkGrandInquisitorItems.SPELL_IGRAM,
ZorkGrandInquisitorRegions.PORT_FOOZLE_PAST,
ZorkGrandInquisitorRegions.WHITE_HOUSE,
),
Expand Down Expand Up @@ -195,7 +191,7 @@
(ZorkGrandInquisitorItems.SUBWAY_DESTINATION_MONASTERY,),
),
(ZorkGrandInquisitorRegions.MENU, ZorkGrandInquisitorRegions.PORT_FOOZLE): None,
(ZorkGrandInquisitorRegions.MONASTERY, ZorkGrandInquisitorRegions.HADES): None,
(ZorkGrandInquisitorRegions.MONASTERY, ZorkGrandInquisitorRegions.HADES_SHORE): None,
(ZorkGrandInquisitorRegions.MONASTERY, ZorkGrandInquisitorRegions.PORT_FOOZLE_PAST): (
(
ZorkGrandInquisitorItems.LARGE_TELEGRAPH_HAMMER,
Expand All @@ -218,10 +214,6 @@
(ZorkGrandInquisitorRegions.PORT_FOOZLE_JACKS_SHOP, ZorkGrandInquisitorRegions.PORT_FOOZLE): None,
(ZorkGrandInquisitorRegions.PORT_FOOZLE_PAST, ZorkGrandInquisitorRegions.ENDGAME): (
(
ZorkGrandInquisitorEvents.SWORD_ACCESSIBLE,
ZorkGrandInquisitorItems.SPELL_VOXAM,
ZorkGrandInquisitorItems.SPELL_REZROV,
ZorkGrandInquisitorItems.SPELL_IGRAM,
ZorkGrandInquisitorRegions.DRAGON_ARCHIPELAGO,
ZorkGrandInquisitorRegions.WHITE_HOUSE,
),
Expand Down Expand Up @@ -306,10 +298,6 @@
(ZorkGrandInquisitorRegions.WHITE_HOUSE, ZorkGrandInquisitorRegions.DM_LAIR_INTERIOR): None,
(ZorkGrandInquisitorRegions.WHITE_HOUSE, ZorkGrandInquisitorRegions.ENDGAME): (
(
ZorkGrandInquisitorEvents.SWORD_ACCESSIBLE,
ZorkGrandInquisitorItems.SPELL_VOXAM,
ZorkGrandInquisitorItems.SPELL_REZROV,
ZorkGrandInquisitorItems.SPELL_IGRAM,
ZorkGrandInquisitorRegions.DRAGON_ARCHIPELAGO,
ZorkGrandInquisitorRegions.PORT_FOOZLE_PAST,
),
Expand Down
52 changes: 26 additions & 26 deletions worlds/zork_grand_inquisitor/data/item_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(23,),
archipelago_id=ITEM_OFFSET + 1,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM,),
),
ZorkGrandInquisitorItems.HUNGUS_LARD: ZorkGrandInquisitorItemData(
game_state_keys=(55,),
Expand All @@ -45,13 +45,13 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(4,),
archipelago_id=ITEM_OFFSET + 4,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM,),
),
ZorkGrandInquisitorItems.LARGE_TELEGRAPH_HAMMER: ZorkGrandInquisitorItemData(
game_state_keys=(88,),
archipelago_id=ITEM_OFFSET + 5,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM,),
),
ZorkGrandInquisitorItems.LETTER_OPENER: ZorkGrandInquisitorItemData(
game_state_keys=(64,),
Expand All @@ -63,7 +63,7 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(2,),
archipelago_id=ITEM_OFFSET + 7,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM,),
),
ZorkGrandInquisitorItems.MOSS_OF_MAREILON: ZorkGrandInquisitorItemData(
game_state_keys=(57,),
Expand Down Expand Up @@ -117,7 +117,7 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(83,),
archipelago_id=ITEM_OFFSET + 16,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM,),
),
ZorkGrandInquisitorItems.SHOVEL: ZorkGrandInquisitorItemData(
game_state_keys=(49,),
Expand All @@ -129,13 +129,13 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(50,),
archipelago_id=ITEM_OFFSET + 18,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM,),
),
ZorkGrandInquisitorItems.STUDENT_ID: ZorkGrandInquisitorItemData(
game_state_keys=(39,),
archipelago_id=ITEM_OFFSET + 19,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM,),
),
ZorkGrandInquisitorItems.SUBWAY_TOKEN: ZorkGrandInquisitorItemData(
game_state_keys=(20,),
Expand All @@ -147,7 +147,7 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(25,),
archipelago_id=ITEM_OFFSET + 21,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.INVENTORY_ITEM,),
),
ZorkGrandInquisitorItems.ZORK_ROCKS: ZorkGrandInquisitorItemData(
game_state_keys=(37,),
Expand All @@ -160,19 +160,19 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(15065, 15088, 2628),
archipelago_id=ITEM_OFFSET + 100 + 0,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.REVEALED, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.REVEALED,),
),
ZorkGrandInquisitorItems.REVEALED_GRIFFS_TIME_TUNNEL_ITEMS: ZorkGrandInquisitorItemData(
game_state_keys=(1340, 1341, 1477, 1814),
archipelago_id=ITEM_OFFSET + 100 + 1,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.REVEALED, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.REVEALED,),
),
ZorkGrandInquisitorItems.REVEALED_LUCYS_TIME_TUNNEL_ITEMS: ZorkGrandInquisitorItemData(
game_state_keys=(15405,),
archipelago_id=ITEM_OFFSET + 100 + 2,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.REVEALED, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.REVEALED,),
),
# Unlocked
ZorkGrandInquisitorItems.UNLOCKED_BLANK_SCROLL_BOX_ACCESS: ZorkGrandInquisitorItemData(
Expand All @@ -186,19 +186,19 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(202,),
archipelago_id=ITEM_OFFSET + 300 + 0,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SPELL, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.SPELL,),
),
ZorkGrandInquisitorItems.SPELL_GOLGATEM: ZorkGrandInquisitorItemData(
game_state_keys=(192,),
archipelago_id=ITEM_OFFSET + 300 + 1,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SPELL, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.SPELL,),
),
ZorkGrandInquisitorItems.SPELL_IGRAM: ZorkGrandInquisitorItemData(
game_state_keys=(199,),
archipelago_id=ITEM_OFFSET + 300 + 2,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SPELL, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.SPELL,),
),
ZorkGrandInquisitorItems.SPELL_KENDALL: ZorkGrandInquisitorItemData(
game_state_keys=(196,),
Expand All @@ -210,7 +210,7 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(197,),
archipelago_id=ITEM_OFFSET + 300 + 4,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SPELL, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.SPELL,),
),
ZorkGrandInquisitorItems.SPELL_OBIDIL: ZorkGrandInquisitorItemData(
game_state_keys=(193,),
Expand All @@ -222,32 +222,32 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(195,),
archipelago_id=ITEM_OFFSET + 300 + 6,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SPELL, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.SPELL,),
),
ZorkGrandInquisitorItems.SPELL_THROCK: ZorkGrandInquisitorItemData(
game_state_keys=(200,),
archipelago_id=ITEM_OFFSET + 300 + 7,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SPELL, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.SPELL,),
),
ZorkGrandInquisitorItems.SPELL_VOXAM: ZorkGrandInquisitorItemData(
game_state_keys=(191,),
archipelago_id=ITEM_OFFSET + 300 + 8,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SPELL, ZorkGrandInquisitorTags.GO_MODE),
classification=ItemClassification.filler,
tags=(ZorkGrandInquisitorTags.SPELL,),
),
ZorkGrandInquisitorItems.SPELL_YASTARD: ZorkGrandInquisitorItemData(
game_state_keys=(198,),
archipelago_id=ITEM_OFFSET + 300 + 9,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SPELL, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.SPELL,),
),
# Subway Destinations
ZorkGrandInquisitorItems.SUBWAY_DESTINATION_FLOOD_CONTROL_DAM: ZorkGrandInquisitorItemData(
game_state_keys=None, # This is more complicated. Will be handled in GameController
archipelago_id=ITEM_OFFSET + 400 + 0,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.SUBWAY_DESTINATION, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.SUBWAY_DESTINATION,),
),
ZorkGrandInquisitorItems.SUBWAY_DESTINATION_HADES: ZorkGrandInquisitorItemData(
game_state_keys=None, # This is more complicated. Will be handled in GameController
Expand Down Expand Up @@ -284,32 +284,32 @@ class ZorkGrandInquisitorItemData(NamedTuple):
game_state_keys=(7148,),
archipelago_id=ITEM_OFFSET + 500 + 3,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.TELEPORTER_DESTINATION, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.TELEPORTER_DESTINATION,),
),
ZorkGrandInquisitorItems.TELEPORTER_DESTINATION_SPELL_LAB: ZorkGrandInquisitorItemData(
game_state_keys=(16545,),
archipelago_id=ITEM_OFFSET + 500 + 4,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.TELEPORTER_DESTINATION, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.TELEPORTER_DESTINATION,),
),
# Totems
ZorkGrandInquisitorItems.TOTEM_BROG: ZorkGrandInquisitorItemData(
game_state_keys=(4853,),
archipelago_id=ITEM_OFFSET + 600 + 0,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.TOTEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.TOTEM,),
),
ZorkGrandInquisitorItems.TOTEM_GRIFF: ZorkGrandInquisitorItemData(
game_state_keys=(4315,),
archipelago_id=ITEM_OFFSET + 600 + 1,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.TOTEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.TOTEM,),
),
ZorkGrandInquisitorItems.TOTEM_LUCY: ZorkGrandInquisitorItemData(
game_state_keys=(5223,),
archipelago_id=ITEM_OFFSET + 600 + 2,
classification=ItemClassification.progression,
tags=(ZorkGrandInquisitorTags.TOTEM, ZorkGrandInquisitorTags.GO_MODE),
tags=(ZorkGrandInquisitorTags.TOTEM,),
),
# Filler
ZorkGrandInquisitorItems.FILLER_INQUISITION_PROPAGANDA_FLYER: ZorkGrandInquisitorItemData(
Expand Down
12 changes: 3 additions & 9 deletions worlds/zork_grand_inquisitor/data/location_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ZorkGrandInquisitorLocationData(NamedTuple):
tags=(ZorkGrandInquisitorTags.CORE,),
),
ZorkGrandInquisitorLocations.MAGIC_FOREVER: ZorkGrandInquisitorLocationData(
game_state_trigger=((10304, 1), (5221, 1)),
game_state_trigger=(("location", "pc1e"), (10304, 1), (5221, 1)),
archipelago_id=LOCATION_OFFSET + 6,
region=ZorkGrandInquisitorRegions.PORT_FOOZLE,
tags=(ZorkGrandInquisitorTags.CORE,),
Expand Down Expand Up @@ -299,7 +299,7 @@ class ZorkGrandInquisitorLocationData(NamedTuple):
),
),
ZorkGrandInquisitorLocations.PLANTS_ARE_MANS_BEST_FRIEND: ZorkGrandInquisitorLocationData(
game_state_trigger=((3765, 0), (3766, 0), (3767, 0), (3768, 0)),
game_state_trigger=((4224, 8),),
archipelago_id=LOCATION_OFFSET + 35,
region=ZorkGrandInquisitorRegions.DM_LAIR,
tags=(ZorkGrandInquisitorTags.CORE,),
Expand Down Expand Up @@ -369,7 +369,7 @@ class ZorkGrandInquisitorLocationData(NamedTuple):
tags=(ZorkGrandInquisitorTags.CORE,),
),
ZorkGrandInquisitorLocations.STRIP_GRUE_FIRE_WATER: ZorkGrandInquisitorLocationData(
game_state_trigger=((14511, 1), (14524, 1)),
game_state_trigger=((14511, 1), (14524, 5)),
archipelago_id=LOCATION_OFFSET + 44,
region=ZorkGrandInquisitorRegions.PORT_FOOZLE_PAST,
tags=(ZorkGrandInquisitorTags.CORE,),
Expand Down Expand Up @@ -465,12 +465,6 @@ class ZorkGrandInquisitorLocationData(NamedTuple):
region=ZorkGrandInquisitorRegions.DRAGON_ARCHIPELAGO,
tags=(ZorkGrandInquisitorTags.DEATHSANITY,),
),
ZorkGrandInquisitorLocations.DEATH_EATEN_BY_A_GRUE_AGAIN: ZorkGrandInquisitorLocationData(
game_state_trigger=(("location", "gjde"), (2201, 2)),
archipelago_id=LOCATION_OFFSET + 100 + 8,
region=ZorkGrandInquisitorRegions.WHITE_HOUSE,
tags=(ZorkGrandInquisitorTags.DEATHSANITY,),
),
ZorkGrandInquisitorLocations.DEATH_ZORK_ROCKS_EXPLODED: ZorkGrandInquisitorLocationData(
game_state_trigger=(("location", "gjde"), (2201, 19)),
archipelago_id=LOCATION_OFFSET + 100 + 9,
Expand Down
2 changes: 1 addition & 1 deletion worlds/zork_grand_inquisitor/data/region_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class ZorkGrandInquisitorRegionData(NamedTuple):
),
ZorkGrandInquisitorRegions.MONASTERY: ZorkGrandInquisitorRegionData(
exits=(
ZorkGrandInquisitorRegions.HADES,
ZorkGrandInquisitorRegions.HADES_SHORE,
ZorkGrandInquisitorRegions.PORT_FOOZLE_PAST,
ZorkGrandInquisitorRegions.SUBWAY_MONASTERY,
)
Expand Down
5 changes: 5 additions & 0 deletions worlds/zork_grand_inquisitor/data_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from .enums import (
ZorkGrandInquisitorEvents,
ZorkGrandInquisitorGoals,
ZorkGrandInquisitorItems,
ZorkGrandInquisitorLocations,
ZorkGrandInquisitorRegions,
Expand All @@ -23,6 +24,10 @@ def location_names_to_id():
}


def id_to_goals():
return {goal.value: goal for goal in ZorkGrandInquisitorGoals}


def id_to_items():
return {data.archipelago_id: item for item, data in item_data.items()}

Expand Down
6 changes: 4 additions & 2 deletions worlds/zork_grand_inquisitor/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class ZorkGrandInquisitorEvents(enum.Enum):
ZORK_ROCKS_SUCKABLE = "Event: Zork Rocks Suckable"


class ZorkGrandInquisitorGoals(enum.Enum):
THREE_ARTIFACTS = 0


class ZorkGrandInquisitorItems(enum.Enum):
FILLER_FROBOZZ_ELECTRIC_GADGET = "Frobozz Electric Gadget"
FILLER_INQUISITION_PROPAGANDA_FLYER = "Inquisition Propaganda Flyer"
Expand Down Expand Up @@ -91,7 +95,6 @@ class ZorkGrandInquisitorLocations(enum.Enum):
DEATH_ATTACKED_THE_QUELBEES = "Death: Attacked the Quelbees"
DEATH_CLIMBED_OUT_OF_THE_WELL = "Death: Climbed Out of the Well"
DEATH_EATEN_BY_A_GRUE = "Death: Eaten by a Grue"
DEATH_EATEN_BY_A_GRUE_AGAIN = "Death: Eaten by a Grue... Again"
DEATH_JUMPED_IN_BOTTOMLESS_PIT = "Death: Jumped in Bottomless Pit"
DEATH_LOST_GAME_OF_STRIP_GRUE_FIRE_WATER = "Death: Lost Game of Strip Grue, Fire, Water"
DEATH_LOST_SOUL_TO_OLD_SCRATCH = "Death: Lost Soul to Old Scratch"
Expand Down Expand Up @@ -178,7 +181,6 @@ class ZorkGrandInquisitorTags(enum.Enum):
CORE = "Core"
DEATHSANITY = "Deathsanity"
FILLER = "Filler"
GO_MODE = "Go Mode"
INVENTORY_ITEM = "Inventory Item"
REVEALED = "Revealed"
SPELL = "Spell"
Expand Down
Loading

0 comments on commit e870fec

Please sign in to comment.