From 11ebc523a9e96838206bde95e2b15abb3192d4e2 Mon Sep 17 00:00:00 2001 From: Trevor L <80716066+TRPG0@users.noreply.github.com> Date: Wed, 18 Oct 2023 13:50:57 -0600 Subject: [PATCH] Hylics 2: Various fixes and APWorld support (#2324) - Fix generation failing with certain gesture shuffle options - Fixed passing ItemDict to multidata instead of item code - Don't allow CHARGE UP to be placed at Foglast: TV - APWorld support by removing LogicMixin from Rules.py --- setup.py | 1 - worlds/hylics2/Rules.py | 550 +++++++++++++++++++++++-------------- worlds/hylics2/__init__.py | 12 +- 3 files changed, 349 insertions(+), 214 deletions(-) diff --git a/setup.py b/setup.py index 6d4d947d..cea60dab 100644 --- a/setup.py +++ b/setup.py @@ -71,7 +71,6 @@ non_apworlds: set = { "Clique", "DLCQuest", "Final Fantasy", - "Hylics 2", "Kingdom Hearts 2", "Lufia II Ancient Cave", "Meritous", diff --git a/worlds/hylics2/Rules.py b/worlds/hylics2/Rules.py index 12c22e01..6c55c874 100644 --- a/worlds/hylics2/Rules.py +++ b/worlds/hylics2/Rules.py @@ -1,91 +1,128 @@ from worlds.generic.Rules import add_rule -from ..AutoWorld import LogicMixin +from BaseClasses import CollectionState -class Hylics2Logic(LogicMixin): +def air_dash(state: CollectionState, player: int) -> bool: + return state.has("PNEUMATOPHORE", player) - def _hylics2_can_air_dash(self, player): - return self.has("PNEUMATOPHORE", player) - def _hylics2_has_airship(self, player): - return self.has("DOCK KEY", player) +def airship(state: CollectionState, player: int) -> bool: + return state.has("DOCK KEY", player) - def _hylics2_has_jail_key(self, player): - return self.has("JAIL KEY", player) - def _hylics2_has_paddle(self, player): - return self.has("PADDLE", player) +def jail_key(state: CollectionState, player: int) -> bool: + return state.has("JAIL KEY", player) - def _hylics2_has_worm_room_key(self, player): - return self.has("WORM ROOM KEY", player) - def _hylics2_has_bridge_key(self, player): - return self.has("BRIDGE KEY", player) +def paddle(state: CollectionState, player: int) -> bool: + return state.has("PADDLE", player) - def _hylics2_has_upper_chamber_key(self, player): - return self.has("UPPER CHAMBER KEY", player) - def _hylics2_has_vessel_room_key(self, player): - return self.has("VESSEL ROOM KEY", player) +def worm_room_key(state: CollectionState, player: int) -> bool: + return state.has("WORM ROOM KEY", player) - def _hylics2_has_house_key(self, player): - return self.has("HOUSE KEY", player) - def _hylics2_has_cave_key(self, player): - return self.has("CAVE KEY", player) +def bridge_key(state: CollectionState, player: int) -> bool: + return state.has("BRIDGE KEY", player) - def _hylics2_has_skull_bomb(self, player): - return self.has("SKULL BOMB", player) - def _hylics2_has_tower_key(self, player): - return self.has("TOWER KEY", player) +def upper_chamber_key(state: CollectionState, player: int) -> bool: + return state.has("UPPER CHAMBER KEY", player) - def _hylics2_has_deep_key(self, player): - return self.has("DEEP KEY", player) - def _hylics2_has_upper_house_key(self, player): - return self.has("UPPER HOUSE KEY", player) +def vessel_room_key(state: CollectionState, player: int) -> bool: + return state.has("VESSEL ROOM KEY", player) - def _hylics2_has_clicker(self, player): - return self.has("CLICKER", player) - def _hylics2_has_tokens(self, player): - return self.has("SAGE TOKEN", player, 3) +def house_key(state: CollectionState, player: int) -> bool: + return state.has("HOUSE KEY", player) - def _hylics2_has_charge_up(self, player): - return self.has("CHARGE UP", player) - def _hylics2_has_cup(self, player): - return self.has("PAPER CUP", player, 1) +def cave_key(state: CollectionState, player: int) -> bool: + return state.has("CAVE KEY", player) - def _hylics2_has_1_member(self, player): - return self.has("Pongorma", player) or self.has("Dedusmuln", player) or self.has("Somsnosa", player) - def _hylics2_has_2_members(self, player): - return (self.has("Pongorma", player) and self.has("Dedusmuln", player)) or\ - (self.has("Pongorma", player) and self.has("Somsnosa", player)) or\ - (self.has("Dedusmuln", player) and self.has("Somsnosa", player)) +def skull_bomb(state: CollectionState, player: int) -> bool: + return state.has("SKULL BOMB", player) - def _hylics2_has_3_members(self, player): - return self.has("Pongorma", player) and self.has("Dedusmuln", player) and self.has("Somsnosa", player) - def _hylics2_enter_arcade2(self, player): - return self._hylics2_can_air_dash(player) and self._hylics2_has_airship(player) +def tower_key(state: CollectionState, player: int) -> bool: + return state.has("TOWER KEY", player) - def _hylics2_enter_wormpod(self, player): - return self._hylics2_has_airship(player) and self._hylics2_has_worm_room_key(player) and\ - self._hylics2_has_paddle(player) - def _hylics2_enter_sageship(self, player): - return self._hylics2_has_skull_bomb(player) and self._hylics2_has_airship(player) and\ - self._hylics2_has_paddle(player) +def deep_key(state: CollectionState, player: int) -> bool: + return state.has("DEEP KEY", player) - def _hylics2_enter_foglast(self, player): - return self._hylics2_enter_wormpod(player) - def _hylics2_enter_hylemxylem(self, player): - return self._hylics2_can_air_dash(player) and self._hylics2_enter_foglast(player) and\ - self._hylics2_has_bridge_key(player) +def upper_house_key(state: CollectionState, player: int) -> bool: + return state.has("UPPER HOUSE KEY", player) + + +def clicker(state: CollectionState, player: int) -> bool: + return state.has("CLICKER", player) + + +def all_tokens(state: CollectionState, player: int) -> bool: + return state.has("SAGE TOKEN", player, 3) + + +def charge_up(state: CollectionState, player: int) -> bool: + return state.has("CHARGE UP", player) + + +def paper_cup(state: CollectionState, player: int) -> bool: + return state.has("PAPER CUP", player) + + +def party_1(state: CollectionState, player: int) -> bool: + return state.has_any({"Pongorma", "Dedusmuln", "Somsnosa"}, player) + + +def party_2(state: CollectionState, player: int) -> bool: + return ( + state.has_all({"Pongorma", "Dedusmuln"}, player) + or state.has_all({"Pongorma", "Somsnosa"}, player) + or state.has_all({"Dedusmuln", "Somsnosa"}, player) + ) + + +def party_3(state: CollectionState, player: int) -> bool: + return state.has_all({"Pongorma", "Dedusmuln", "Somsnosa"}, player) + + +def enter_arcade2(state: CollectionState, player: int) -> bool: + return ( + air_dash(state, player) + and airship(state, player) + ) + + +def enter_wormpod(state: CollectionState, player: int) -> bool: + return ( + airship(state, player) + and worm_room_key(state, player) + and paddle(state, player) + ) + + +def enter_sageship(state: CollectionState, player: int) -> bool: + return ( + skull_bomb(state, player) + and airship(state, player) + and paddle(state, player) + ) + + +def enter_foglast(state: CollectionState, player: int) -> bool: + return enter_wormpod(state, player) + + +def enter_hylemxylem(state: CollectionState, player: int) -> bool: + return ( + air_dash(state, player) + and enter_foglast(state, player) + and bridge_key(state, player) + ) def set_rules(hylics2world): @@ -94,342 +131,439 @@ def set_rules(hylics2world): # Afterlife add_rule(world.get_location("Afterlife: TV", player), - lambda state: state._hylics2_has_cave_key(player)) + lambda state: cave_key(state, player)) # New Muldul add_rule(world.get_location("New Muldul: Underground Chest", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("New Muldul: TV", player), - lambda state: state._hylics2_has_house_key(player)) + lambda state: house_key(state, player)) add_rule(world.get_location("New Muldul: Upper House Chest 1", player), - lambda state: state._hylics2_has_upper_house_key(player)) + lambda state: upper_house_key(state, player)) add_rule(world.get_location("New Muldul: Upper House Chest 2", player), - lambda state: state._hylics2_has_upper_house_key(player)) + lambda state: upper_house_key(state, player)) add_rule(world.get_location("New Muldul: Pot above Vault", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) # New Muldul Vault add_rule(world.get_location("New Muldul: Rescued Blerol 1", player), - lambda state: ((state._hylics2_has_jail_key(player) and state._hylics2_has_paddle(player)) and\ - (state._hylics2_can_air_dash(player) or state._hylics2_has_airship(player))) or\ - state._hylics2_enter_hylemxylem(player)) + lambda state: ( + ( + ( + jail_key(state, player) + and paddle(state, player) + ) + and ( + air_dash(state, player) + or airship(state, player) + ) + ) + or enter_hylemxylem(state, player) + )) add_rule(world.get_location("New Muldul: Rescued Blerol 2", player), - lambda state: ((state._hylics2_has_jail_key(player) and state._hylics2_has_paddle(player)) and\ - (state._hylics2_can_air_dash(player) or state._hylics2_has_airship(player))) or\ - state._hylics2_enter_hylemxylem(player)) + lambda state: ( + ( + ( + jail_key(state, player) + and paddle(state, player) + ) + and ( + air_dash(state, player) + or airship(state, player) + ) + ) + or enter_hylemxylem(state, player) + )) add_rule(world.get_location("New Muldul: Vault Left Chest", player), - lambda state: state._hylics2_enter_hylemxylem(player)) + lambda state: enter_hylemxylem(state, player)) add_rule(world.get_location("New Muldul: Vault Right Chest", player), - lambda state: state._hylics2_enter_hylemxylem(player)) + lambda state: enter_hylemxylem(state, player)) add_rule(world.get_location("New Muldul: Vault Bomb", player), - lambda state: state._hylics2_enter_hylemxylem(player)) + lambda state: enter_hylemxylem(state, player)) # Viewax's Edifice add_rule(world.get_location("Viewax's Edifice: Canopic Jar", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Cave Sarcophagus", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Shielded Key", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Shielded Key", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Tower Pot", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Tower Jar", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Tower Chest", player), - lambda state: state._hylics2_has_paddle(player) and state._hylics2_has_tower_key(player)) + lambda state: ( + paddle(state, player) + and tower_key(state, player) + )) add_rule(world.get_location("Viewax's Edifice: Viewax Pot", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Defeat Viewax", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: TV", player), - lambda state: state._hylics2_has_paddle(player) and state._hylics2_has_jail_key(player)) + lambda state: ( + paddle(state, player) + and jail_key(state, player) + )) add_rule(world.get_location("Viewax's Edifice: Sage Fridge", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Viewax's Edifice: Sage Item 1", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Viewax's Edifice: Sage Item 2", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) # Arcade 1 add_rule(world.get_location("Arcade 1: Key", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Arcade 1: Coin Dash", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Arcade 1: Burrito Alcove 1", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Arcade 1: Burrito Alcove 2", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Arcade 1: Behind Spikes Banana", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Arcade 1: Pyramid Banana", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Arcade 1: Moving Platforms Muscle Applique", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Arcade 1: Bed Banana", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) # Airship add_rule(world.get_location("Airship: Talk to Somsnosa", player), - lambda state: state._hylics2_has_worm_room_key(player)) + lambda state: worm_room_key(state, player)) # Foglast add_rule(world.get_location("Foglast: Underground Sarcophagus", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Foglast: Shielded Key", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Foglast: TV", player), - lambda state: state._hylics2_can_air_dash(player) and state._hylics2_has_clicker(player)) + lambda state: ( + air_dash(state, player) + and clicker(state, player) + )) add_rule(world.get_location("Foglast: Buy Clicker", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Foglast: Shielded Chest", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Foglast: Cave Fridge", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Foglast: Roof Sarcophagus", player), - lambda state: state._hylics2_can_air_dash(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + air_dash(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("Foglast: Under Lair Sarcophagus 1", player), - lambda state: state._hylics2_can_air_dash(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + air_dash(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("Foglast: Under Lair Sarcophagus 2", player), - lambda state: state._hylics2_can_air_dash(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + air_dash(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("Foglast: Under Lair Sarcophagus 3", player), - lambda state: state._hylics2_can_air_dash(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + air_dash(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("Foglast: Sage Sarcophagus", player), - lambda state: state._hylics2_can_air_dash(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + air_dash(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("Foglast: Sage Item 1", player), - lambda state: state._hylics2_can_air_dash(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + air_dash(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("Foglast: Sage Item 2", player), - lambda state: state._hylics2_can_air_dash(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + air_dash(state, player) + and bridge_key(state, player) + )) # Drill Castle add_rule(world.get_location("Drill Castle: Island Banana", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Drill Castle: Island Pot", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Drill Castle: Cave Sarcophagus", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Drill Castle: TV", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) # Sage Labyrinth add_rule(world.get_location("Sage Labyrinth: Sage Item 1", player), - lambda state: state._hylics2_has_deep_key(player)) + lambda state: deep_key(state, player)) add_rule(world.get_location("Sage Labyrinth: Sage Item 2", player), - lambda state: state._hylics2_has_deep_key(player)) + lambda state: deep_key(state, player)) add_rule(world.get_location("Sage Labyrinth: Sage Left Arm", player), - lambda state: state._hylics2_has_deep_key(player)) + lambda state: deep_key(state, player)) add_rule(world.get_location("Sage Labyrinth: Sage Right Arm", player), - lambda state: state._hylics2_has_deep_key(player)) + lambda state: deep_key(state, player)) add_rule(world.get_location("Sage Labyrinth: Sage Left Leg", player), - lambda state: state._hylics2_has_deep_key(player)) + lambda state: deep_key(state, player)) add_rule(world.get_location("Sage Labyrinth: Sage Right Leg", player), - lambda state: state._hylics2_has_deep_key(player)) + lambda state: deep_key(state, player)) # Sage Airship add_rule(world.get_location("Sage Airship: TV", player), - lambda state: state._hylics2_has_tokens(player)) + lambda state: all_tokens(state, player)) # Hylemxylem add_rule(world.get_location("Hylemxylem: Upper Chamber Banana", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Across Upper Reservoir Chest", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Drained Lower Reservoir Chest", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Drained Lower Reservoir Burrito 1", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Drained Lower Reservoir Burrito 2", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Lower Reservoir Hole Pot 1", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Lower Reservoir Hole Pot 2", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Lower Reservoir Hole Pot 3", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Lower Reservoir Hole Sarcophagus", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Drained Upper Reservoir Burrito 1", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Drained Upper Reservoir Burrito 2", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Drained Upper Reservoir Burrito 3", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) add_rule(world.get_location("Hylemxylem: Upper Reservoir Hole Key", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) # extra rules if Extra Items in Logic is enabled if world.extra_items_in_logic[player]: for i in world.get_region("Foglast", player).entrances: - add_rule(i, lambda state: state._hylics2_has_charge_up(player)) + add_rule(i, lambda state: charge_up(state, player)) for i in world.get_region("Sage Airship", player).entrances: - add_rule(i, lambda state: state._hylics2_has_charge_up(player) and state._hylics2_has_cup(player) and\ - state._hylics2_has_worm_room_key(player)) + add_rule(i, lambda state: ( + charge_up(state, player) + and paper_cup(state, player) + and worm_room_key(state, player) + )) for i in world.get_region("Hylemxylem", player).entrances: - add_rule(i, lambda state: state._hylics2_has_charge_up(player) and state._hylics2_has_cup(player)) + add_rule(i, lambda state: ( + charge_up(state, player) + and paper_cup(state, player) + )) add_rule(world.get_location("Sage Labyrinth: Motor Hunter Sarcophagus", player), - lambda state: state._hylics2_has_charge_up(player) and state._hylics2_has_cup(player)) + lambda state: ( + charge_up(state, player) + and paper_cup(state, player) + )) # extra rules if Shuffle Party Members is enabled if world.party_shuffle[player]: for i in world.get_region("Arcade Island", player).entrances: - add_rule(i, lambda state: state._hylics2_has_3_members(player)) + add_rule(i, lambda state: party_3(state, player)) for i in world.get_region("Foglast", player).entrances: - add_rule(i, lambda state: state._hylics2_has_3_members(player) or\ - (state._hylics2_has_2_members(player) and state._hylics2_has_jail_key(player))) + add_rule(i, lambda state: ( + party_3(state, player) + or ( + party_2(state, player) + and jail_key(state, player) + ) + )) for i in world.get_region("Sage Airship", player).entrances: - add_rule(i, lambda state: state._hylics2_has_3_members(player)) + add_rule(i, lambda state: party_3(state, player)) for i in world.get_region("Hylemxylem", player).entrances: - add_rule(i, lambda state: state._hylics2_has_3_members(player)) + add_rule(i, lambda state: party_3(state, player)) add_rule(world.get_location("Viewax's Edifice: Defeat Viewax", player), - lambda state: state._hylics2_has_2_members(player)) + lambda state: party_2(state, player)) add_rule(world.get_location("New Muldul: Rescued Blerol 1", player), - lambda state: state._hylics2_has_2_members(player)) + lambda state: party_2(state, player)) add_rule(world.get_location("New Muldul: Rescued Blerol 2", player), - lambda state: state._hylics2_has_2_members(player)) + lambda state: party_2(state, player)) add_rule(world.get_location("New Muldul: Vault Left Chest", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) add_rule(world.get_location("New Muldul: Vault Right Chest", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) add_rule(world.get_location("New Muldul: Vault Bomb", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) add_rule(world.get_location("Juice Ranch: Battle with Somsnosa", player), - lambda state: state._hylics2_has_2_members(player)) + lambda state: party_2(state, player)) add_rule(world.get_location("Juice Ranch: Somsnosa Joins", player), - lambda state: state._hylics2_has_2_members(player)) + lambda state: party_2(state, player)) add_rule(world.get_location("Airship: Talk to Somsnosa", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) add_rule(world.get_location("Sage Labyrinth: Motor Hunter Sarcophagus", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) # extra rules if Shuffle Red Medallions is enabled if world.medallion_shuffle[player]: add_rule(world.get_location("New Muldul: Upper House Medallion", player), - lambda state: state._hylics2_has_upper_house_key(player)) + lambda state: upper_house_key(state, player)) add_rule(world.get_location("New Muldul: Vault Rear Left Medallion", player), - lambda state: state._hylics2_enter_foglast(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + enter_foglast(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("New Muldul: Vault Rear Right Medallion", player), - lambda state: state._hylics2_enter_foglast(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + enter_foglast(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("New Muldul: Vault Center Medallion", player), - lambda state: state._hylics2_enter_foglast(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + enter_foglast(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("New Muldul: Vault Front Left Medallion", player), - lambda state: state._hylics2_enter_foglast(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + enter_foglast(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("New Muldul: Vault Front Right Medallion", player), - lambda state: state._hylics2_enter_foglast(player) and state._hylics2_has_bridge_key(player)) + lambda state: ( + enter_foglast(state, player) + and bridge_key(state, player) + )) add_rule(world.get_location("Viewax's Edifice: Fort Wall Medallion", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Jar Medallion", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Viewax's Edifice: Sage Chair Medallion", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Arcade 1: Lonely Medallion", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Arcade 1: Alcove Medallion", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Foglast: Under Lair Medallion", player), - lambda state: state._hylics2_has_bridge_key(player)) + lambda state: bridge_key(state, player)) add_rule(world.get_location("Foglast: Mid-Air Medallion", player), - lambda state: state._hylics2_can_air_dash(player)) + lambda state: air_dash(state, player)) add_rule(world.get_location("Foglast: Top of Tower Medallion", player), - lambda state: state._hylics2_has_paddle(player)) + lambda state: paddle(state, player)) add_rule(world.get_location("Hylemxylem: Lower Reservoir Hole Medallion", player), - lambda state: state._hylics2_has_upper_chamber_key(player)) + lambda state: upper_chamber_key(state, player)) - # extra rules is Shuffle Red Medallions and Party Shuffle are enabled + # extra rules if Shuffle Red Medallions and Party Shuffle are enabled if world.party_shuffle[player] and world.medallion_shuffle[player]: add_rule(world.get_location("New Muldul: Vault Rear Left Medallion", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) add_rule(world.get_location("New Muldul: Vault Rear Right Medallion", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) add_rule(world.get_location("New Muldul: Vault Center Medallion", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) add_rule(world.get_location("New Muldul: Vault Front Left Medallion", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) add_rule(world.get_location("New Muldul: Vault Front Right Medallion", player), - lambda state: state._hylics2_has_3_members(player)) + lambda state: party_3(state, player)) # entrances for i in world.get_region("Airship", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Arcade Island", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player) and state._hylics2_can_air_dash(player)) + add_rule(i, lambda state: ( + airship(state, player) + and air_dash(state, player) + )) for i in world.get_region("Worm Pod", player).entrances: - add_rule(i, lambda state: state._hylics2_enter_wormpod(player)) + add_rule(i, lambda state: enter_wormpod(state, player)) for i in world.get_region("Foglast", player).entrances: - add_rule(i, lambda state: state._hylics2_enter_foglast(player)) + add_rule(i, lambda state: enter_foglast(state, player)) for i in world.get_region("Sage Labyrinth", player).entrances: - add_rule(i, lambda state: state._hylics2_has_skull_bomb(player)) + add_rule(i, lambda state: skull_bomb(state, player)) for i in world.get_region("Sage Airship", player).entrances: - add_rule(i, lambda state: state._hylics2_enter_sageship(player)) + add_rule(i, lambda state: enter_sageship(state, player)) for i in world.get_region("Hylemxylem", player).entrances: - add_rule(i, lambda state: state._hylics2_enter_hylemxylem(player)) + add_rule(i, lambda state: enter_hylemxylem(state, player)) # random start logic (default) if ((not world.random_start[player]) or \ (world.random_start[player] and hylics2world.start_location == "Waynehouse")): # entrances for i in world.get_region("Viewax", player).entrances: - add_rule(i, lambda state: state._hylics2_can_air_dash(player) or state._hylics2_has_airship(player)) + add_rule(i, lambda state: ( + air_dash(state, player) + and airship(state, player) + )) for i in world.get_region("TV Island", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Shield Facility", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Juice Ranch", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) # random start logic (Viewax's Edifice) elif (world.random_start[player] and hylics2world.start_location == "Viewax's Edifice"): for i in world.get_region("Waynehouse", player).entrances: - add_rule(i, lambda state: state._hylics2_can_air_dash(player) or state._hylics2_has_airship(player)) + add_rule(i, lambda state: ( + air_dash(state, player) + or airship(state, player) + )) for i in world.get_region("New Muldul", player).entrances: - add_rule(i, lambda state: state._hylics2_can_air_dash(player) or state._hylics2_has_airship(player)) + add_rule(i, lambda state: ( + air_dash(state, player) + or airship(state, player) + )) for i in world.get_region("New Muldul Vault", player).entrances: - add_rule(i, lambda state: state._hylics2_can_air_dash(player) or state._hylics2_has_airship(player)) + add_rule(i, lambda state: ( + air_dash(state, player) + or airship(state, player) + )) for i in world.get_region("Drill Castle", player).entrances: - add_rule(i, lambda state: state._hylics2_can_air_dash(player) or state._hylics2_has_airship(player)) + add_rule(i, lambda state: ( + air_dash(state, player) + or airship(state, player) + )) for i in world.get_region("TV Island", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Shield Facility", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Juice Ranch", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Sage Labyrinth", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) # random start logic (TV Island) elif (world.random_start[player] and hylics2world.start_location == "TV Island"): for i in world.get_region("Waynehouse", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("New Muldul", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("New Muldul Vault", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Drill Castle", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Viewax", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Shield Facility", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Juice Ranch", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Sage Labyrinth", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) # random start logic (Shield Facility) elif (world.random_start[player] and hylics2world.start_location == "Shield Facility"): for i in world.get_region("Waynehouse", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("New Muldul", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("New Muldul Vault", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Drill Castle", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Viewax", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("TV Island", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) for i in world.get_region("Sage Labyrinth", player).entrances: - add_rule(i, lambda state: state._hylics2_has_airship(player)) + add_rule(i, lambda state: airship(state, player)) \ No newline at end of file diff --git a/worlds/hylics2/__init__.py b/worlds/hylics2/__init__.py index f721fb47..19d901bf 100644 --- a/worlds/hylics2/__init__.py +++ b/worlds/hylics2/__init__.py @@ -130,11 +130,11 @@ class Hylics2World(World): tvs = list(Locations.tv_location_table.items()) # if Extra Items in Logic is enabled place CHARGE UP first and make sure it doesn't get - # placed at Sage Airship: TV + # placed at Sage Airship: TV or Foglast: TV if self.multiworld.extra_items_in_logic[self.player]: tv = self.multiworld.random.choice(tvs) gest = gestures.index((200681, Items.gesture_item_table[200681])) - while tv[1]["name"] == "Sage Airship: TV": + while tv[1]["name"] == "Sage Airship: TV" or tv[1]["name"] == "Foglast: TV": tv = self.multiworld.random.choice(tvs) self.multiworld.get_location(tv[1]["name"], self.player)\ .place_locked_item(self.add_item(gestures[gest][1]["name"], gestures[gest][1]["classification"], @@ -146,7 +146,7 @@ class Hylics2World(World): gest = self.multiworld.random.choice(gestures) tv = self.multiworld.random.choice(tvs) self.multiworld.get_location(tv[1]["name"], self.player)\ - .place_locked_item(self.add_item(gest[1]["name"], gest[1]["classification"], gest[1])) + .place_locked_item(self.add_item(gest[1]["name"], gest[1]["classification"], gest[0])) gestures.remove(gest) tvs.remove(tv) @@ -232,8 +232,10 @@ class Hylics2World(World): # create location for beating the game and place Victory event there loc = Location(self.player, "Defeat Gibby", None, self.multiworld.get_region("Hylemxylem", self.player)) loc.place_locked_item(self.create_event("Victory")) - set_rule(loc, lambda state: state._hylics2_has_upper_chamber_key(self.player) - and state._hylics2_has_vessel_room_key(self.player)) + set_rule(loc, lambda state: ( + state.has("UPPER CHAMBER KEY", self.player) + and state.has("VESSEL ROOM KEY", self.player) + )) self.multiworld.get_region("Hylemxylem", self.player).locations.append(loc) self.multiworld.completion_condition[self.player] = lambda state: state.has("Victory", self.player)