diff --git a/worlds/zork_grand_inquisitor/client.py b/worlds/zork_grand_inquisitor/client.py index 289aac10c418..d0576b703be5 100644 --- a/worlds/zork_grand_inquisitor/client.py +++ b/worlds/zork_grand_inquisitor/client.py @@ -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 @@ -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() @@ -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 diff --git a/worlds/zork_grand_inquisitor/data/entrance_rule_data.py b/worlds/zork_grand_inquisitor/data/entrance_rule_data.py index 14bd9a39a71c..2164e2acd48a 100644 --- a/worlds/zork_grand_inquisitor/data/entrance_rule_data.py +++ b/worlds/zork_grand_inquisitor/data/entrance_rule_data.py @@ -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, ), @@ -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, @@ -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, ), @@ -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, ), diff --git a/worlds/zork_grand_inquisitor/data/item_data.py b/worlds/zork_grand_inquisitor/data/item_data.py index 66e682c65f6a..86bf559cd1db 100644 --- a/worlds/zork_grand_inquisitor/data/item_data.py +++ b/worlds/zork_grand_inquisitor/data/item_data.py @@ -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,), @@ -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,), @@ -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,), @@ -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,), @@ -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,), @@ -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,), @@ -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( @@ -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,), @@ -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,), @@ -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 @@ -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( diff --git a/worlds/zork_grand_inquisitor/data/location_data.py b/worlds/zork_grand_inquisitor/data/location_data.py index 26b891aa6c29..fcb67badcbfc 100644 --- a/worlds/zork_grand_inquisitor/data/location_data.py +++ b/worlds/zork_grand_inquisitor/data/location_data.py @@ -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,), @@ -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,), @@ -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,), @@ -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, diff --git a/worlds/zork_grand_inquisitor/data/region_data.py b/worlds/zork_grand_inquisitor/data/region_data.py index b4eadc556718..1599111eeea7 100644 --- a/worlds/zork_grand_inquisitor/data/region_data.py +++ b/worlds/zork_grand_inquisitor/data/region_data.py @@ -88,7 +88,7 @@ class ZorkGrandInquisitorRegionData(NamedTuple): ), ZorkGrandInquisitorRegions.MONASTERY: ZorkGrandInquisitorRegionData( exits=( - ZorkGrandInquisitorRegions.HADES, + ZorkGrandInquisitorRegions.HADES_SHORE, ZorkGrandInquisitorRegions.PORT_FOOZLE_PAST, ZorkGrandInquisitorRegions.SUBWAY_MONASTERY, ) diff --git a/worlds/zork_grand_inquisitor/data_funcs.py b/worlds/zork_grand_inquisitor/data_funcs.py index 3662a4b93d82..ebcb366ea10d 100644 --- a/worlds/zork_grand_inquisitor/data_funcs.py +++ b/worlds/zork_grand_inquisitor/data_funcs.py @@ -4,6 +4,7 @@ from .enums import ( ZorkGrandInquisitorEvents, + ZorkGrandInquisitorGoals, ZorkGrandInquisitorItems, ZorkGrandInquisitorLocations, ZorkGrandInquisitorRegions, @@ -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()} diff --git a/worlds/zork_grand_inquisitor/enums.py b/worlds/zork_grand_inquisitor/enums.py index 9996c305f53e..e850a0b387bc 100644 --- a/worlds/zork_grand_inquisitor/enums.py +++ b/worlds/zork_grand_inquisitor/enums.py @@ -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" @@ -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" @@ -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" diff --git a/worlds/zork_grand_inquisitor/game_controller.py b/worlds/zork_grand_inquisitor/game_controller.py index 23ed9810d115..da6d62558528 100644 --- a/worlds/zork_grand_inquisitor/game_controller.py +++ b/worlds/zork_grand_inquisitor/game_controller.py @@ -5,18 +5,23 @@ from .data_funcs import game_id_to_items, items_with_tag -from .enums import ZorkGrandInquisitorItems, ZorkGrandInquisitorLocations, ZorkGrandInquisitorTags +from .enums import ( + ZorkGrandInquisitorGoals, + ZorkGrandInquisitorItems, + ZorkGrandInquisitorLocations, + ZorkGrandInquisitorTags, +) from .game_state_manager import GameStateManager ### PROBLEMS / TODO # Need Repro: Dying in Old Scratch caused Plants are mans best friend to be completed and game crash +# Maybe only when done on the surface without dalboz? Not reproduced in DML -# Detect when the game is not running and prompt to /zork again +# 2 Ropes sometimes... after messing with sword + rope? Minor? -# Alternate Goals: 3 artifacts placed, full spell book, totem hunt -# Same Logic for all, just different victory conditions +# Detect when the game is not running and prompt to /zork again class GameController: def __init__(self, logger=None): @@ -42,7 +47,7 @@ def __init__(self, logger=None): self.goal_completed = False - self.option_skip_old_scratch_minigame = False + self.option_goal = None self.option_deathsanity = False def log(self, message): @@ -178,25 +183,25 @@ def _apply_conditional_game_state(self): # Brog's Time Tunnel Items if self._player_has(ZorkGrandInquisitorItems.REVEALED_BROGS_TIME_TUNNEL_ITEMS): - self._write_game_state_value_for(15065, 1) - self._write_game_state_value_for(15088, 1) - self._write_game_state_value_for(2628, 4) - else: self._write_game_state_value_for(15065, 0) self._write_game_state_value_for(15088, 0) self._write_game_state_value_for(2628, 0) + else: + self._write_game_state_value_for(15065, 1) + self._write_game_state_value_for(15088, 1) + self._write_game_state_value_for(2628, 4) # Griff's Time Tunnel Items if self._player_has(ZorkGrandInquisitorItems.REVEALED_GRIFFS_TIME_TUNNEL_ITEMS): - self._write_game_state_value_for(1340, 1) - self._write_game_state_value_for(1341, 1) - self._write_game_state_value_for(1477, 1) - self._write_game_state_value_for(1814, 1) - else: self._write_game_state_value_for(1340, 0) self._write_game_state_value_for(1341, 0) self._write_game_state_value_for(1477, 0) self._write_game_state_value_for(1814, 0) + else: + self._write_game_state_value_for(1340, 1) + self._write_game_state_value_for(1341, 1) + self._write_game_state_value_for(1477, 1) + self._write_game_state_value_for(1814, 1) # Lucy's Time Tunnel Items if self._player_has(ZorkGrandInquisitorItems.REVEALED_LUCYS_TIME_TUNNEL_ITEMS): @@ -208,10 +213,9 @@ def _apply_conditional_game_state(self): if self._read_game_state_value_for(4115) == 1: self._write_game_state_value_for(4114, 1) - # Skip Old Scratch Minigame - if self.option_skip_old_scratch_minigame: - self._write_game_state_value_for(7833, 1) - self._write_game_state_value_for(7865, 41) + # Lower Volume of the Bees (SO LOUD!) + if self._read_game_state_value_for(19294) > 0: + self._write_game_state_value_for(19294, 35) def _check_for_completed_locations(self): for location, data in location_data.items(): @@ -256,13 +260,14 @@ def _manage_items(self): continue self.received_items.add(item) - # Manage Inventory Items if self._player_is_afgncaap(): self.available_inventory_slots = self._determine_available_inventory_slots() received_inventory_items = self.received_items & self.possible_inventory_items - received_inventory_items = self._filter_received_inventory_items(received_inventory_items) + received_inventory_items = self._filter_received_inventory_items( + received_inventory_items + ) game_state_inventory_items = self._determine_game_state_inventory() @@ -275,21 +280,20 @@ def _manage_items(self): for item in inventory_items_to_remove: self._remove_from_inventory(item) - # Remove Duplicate Inventory Items on Cursor - Unstable? - inventory_item_values = set() - - for i in range(151, 171): - inventory_item_values.add(self._read_game_state_value_for(i)) - - if self._read_game_state_value_for(9) in inventory_item_values: - self._write_game_state_value_for(9, 0) - def _apply_conditional_teleports(self): - if self._player_is_at("uw1k") and self._read_game_state_value_for(10304) == 1: + if self._player_is_at("uw1k") and self._read_game_state_value_for(13938) == 0: self.game_state_manager.set_game_location("pc10", 250) + if self._player_is_at("ej10"): + self.game_state_manager.set_game_location("uc10", 1200) + def _check_for_victory(self): - self.goal_completed = self._read_game_state_value_for(5582) == 1 + if self.option_goal == ZorkGrandInquisitorGoals.THREE_ARTIFACTS: + coconut_is_placed = self._read_game_state_value_for(2200) == 1 + cube_is_placed = self._read_game_state_value_for(2322) == 1 + skull_is_placed = self._read_game_state_value_for(2321) == 1 + + self.goal_completed = coconut_is_placed and cube_is_placed and skull_is_placed def _determine_game_state_inventory(self): game_state_inventory = set() @@ -339,6 +343,9 @@ def _determine_game_state_inventory(self): return game_state_inventory def _add_to_inventory(self, item): + if item == ZorkGrandInquisitorItems.POUCH_OF_ZORKMIDS: + return None + data = item_data[item] if ZorkGrandInquisitorTags.INVENTORY_ITEM in data.tags: @@ -350,6 +357,9 @@ def _add_to_inventory(self, item): self._write_game_state_value_for(data.game_state_keys[0], 1) def _remove_from_inventory(self, item): + if item == ZorkGrandInquisitorItems.POUCH_OF_ZORKMIDS: + return None + data = item_data[item] if ZorkGrandInquisitorTags.INVENTORY_ITEM in data.tags: @@ -413,13 +423,15 @@ def _filter_received_inventory_items(self, received_inventory_items): elif item == ZorkGrandInquisitorItems.HUNGUS_LARD: if self._read_game_state_value_for(4870) == 1: to_filter_inventory_items.add(item) - elif self._read_game_state_value_for(4244) == 1: + elif self._read_game_state_value_for(4309) == 0: to_filter_inventory_items.add(item) elif item == ZorkGrandInquisitorItems.JAR_OF_HOTBUGS: if self._read_game_state_value_for(4750) == 1: to_filter_inventory_items.add(item) elif item == ZorkGrandInquisitorItems.LANTERN: - if self._read_game_state_value_for(5221) == 1: + if self._read_game_state_value_for(10477) == 1: + to_filter_inventory_items.add(item) + elif self._read_game_state_value_for(5221) == 1: to_filter_inventory_items.add(item) elif item == ZorkGrandInquisitorItems.LARGE_TELEGRAPH_HAMMER: if self._read_game_state_value_for(9491) == 3: @@ -427,6 +439,8 @@ def _filter_received_inventory_items(self, received_inventory_items): elif item == ZorkGrandInquisitorItems.MEAD_LIGHT: if self._read_game_state_value_for(17620) > 0: to_filter_inventory_items.add(item) + elif self._read_game_state_value_for(4034) == 1: + to_filter_inventory_items.add(item) elif item == ZorkGrandInquisitorItems.MOSS_OF_MAREILON: if self._read_game_state_value_for(4763) == 1: to_filter_inventory_items.add(item) @@ -457,19 +471,24 @@ def _filter_received_inventory_items(self, received_inventory_items): to_filter_inventory_items.add(item) elif 111 in inventory_item_values: to_filter_inventory_items.add(item) - elif self._read_game_state_value_for(10304) == 1: + elif ( + self._read_game_state_value_for(10304) == 1 + and not self._read_game_state_value_for(13938) == 1 + ): to_filter_inventory_items.add(item) - elif self._read_game_state_value_for(15150) == 1: + elif self._read_game_state_value_for(15150) == 83: to_filter_inventory_items.add(item) elif item == ZorkGrandInquisitorItems.SNAPDRAGON: if self._read_game_state_value_for(4199) == 1: to_filter_inventory_items.add(item) elif item == ZorkGrandInquisitorItems.SUBWAY_TOKEN: - if self._read_game_state_value_for(13165) == 1: + if self._read_game_state_value_for(13163) == 2: to_filter_inventory_items.add(item) elif item == ZorkGrandInquisitorItems.ZIMDOR_SCROLL: if self._read_game_state_value_for(17620) == 3: to_filter_inventory_items.add(item) + elif self._read_game_state_value_for(4034) == 1: + to_filter_inventory_items.add(item) elif item == ZorkGrandInquisitorItems.ZORK_ROCKS: if self._read_game_state_value_for(12486) == 1: to_filter_inventory_items.add(item) @@ -479,6 +498,8 @@ def _filter_received_inventory_items(self, received_inventory_items): to_filter_inventory_items.add(item) elif self._read_game_state_value_for(11769) == 1: to_filter_inventory_items.add(item) + elif self._read_game_state_value_for(11840) == 1: + to_filter_inventory_items.add(item) return received_inventory_items - to_filter_inventory_items diff --git a/worlds/zork_grand_inquisitor/game_state_manager.py b/worlds/zork_grand_inquisitor/game_state_manager.py index c3c990e2f067..deaee0851b21 100644 --- a/worlds/zork_grand_inquisitor/game_state_manager.py +++ b/worlds/zork_grand_inquisitor/game_state_manager.py @@ -94,7 +94,7 @@ def get_game_state_address_offset_for(self, key): if offset_value > 1: if self.process.read_int(offset_value + 0x4) == key: break - else: + elif offset_value == 0: is_new_offset = True break diff --git a/worlds/zork_grand_inquisitor/options.py b/worlds/zork_grand_inquisitor/options.py index bd557bb4f988..739007e8cb64 100644 --- a/worlds/zork_grand_inquisitor/options.py +++ b/worlds/zork_grand_inquisitor/options.py @@ -1,29 +1,34 @@ from dataclasses import dataclass -from Options import Toggle, DefaultOnToggle, PerGameCommonOptions +from Options import Choice, DefaultOnToggle, PerGameCommonOptions, Toggle -class EarlyRopeAndLantern(DefaultOnToggle): - """If true, the rope and lantern will be found in early locations for a smoother early game""" +class Goal(Choice): + """ + Determines the victory condition - display_name = "Early Rope & Lantern" + Three Artifacts: Retrieve the three artifacts of magic and place them in the walking castle + """ + display_name = "Goal" + default = 0 + option_three_artifacts = 0 -class SkipOldScratchMinigame(Toggle): - """If true, allows the player to simply click on the winning square on the Old Scratch card instead of having to - find the correct path""" - display_name = "Skip Old Scratch Minigame" +class EarlyRopeAndLantern(DefaultOnToggle): + """If true, the rope and lantern will be found in early locations for a smoother early game""" + + display_name = "Early Rope & Lantern" class Deathsanity(Toggle): - """If true, adds 17 player death locations to the world""" + """If true, adds 16 player death locations to the world""" display_name = "Deathsanity" @dataclass class ZorkGrandInquisitorOptions(PerGameCommonOptions): + goal: Goal early_rope_and_lantern: EarlyRopeAndLantern - skip_old_scratch_minigame: SkipOldScratchMinigame deathsanity: Deathsanity diff --git a/worlds/zork_grand_inquisitor/world.py b/worlds/zork_grand_inquisitor/world.py index 483780e6b1fd..7e609e1578ee 100644 --- a/worlds/zork_grand_inquisitor/world.py +++ b/worlds/zork_grand_inquisitor/world.py @@ -152,8 +152,8 @@ def generate_basic(self): def fill_slot_data(self): return self.options.as_dict( + "goal", "early_rope_and_lantern", - "skip_old_scratch_minigame", "deathsanity", )