From 873b132c0f10a245d44ce44626a44f508ff06208 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:00:04 +0100 Subject: [PATCH 01/17] Refactor postgame code to be more readable --- worlds/witness/player_logic.py | 111 +++++++++++++++++++++++---------- 1 file changed, 78 insertions(+), 33 deletions(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index cfd36c09be24..76e999aea08a 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -248,51 +248,96 @@ def make_single_adjustment(self, adj_type: str, line: str): line = self.REFERENCE_LOGIC.ENTITIES_BY_HEX[line]["checkName"] self.ADDED_CHECKS.add(line) + @staticmethod + def handle_postgame(world: "WitnessWorld"): + # In shuffle_postgame, panels that become accessible "after or at the same time as the goal" are disabled. + # This has a lot of complicated considerations, which I'll try my best to explain. + postgame_adjustments = [] + + # Make some quick references to some options + doors = world.options.shuffle_doors >= 2 # "Panels" mode has no overarching region accessibility implications. + early_caves = world.options.early_caves > 0 + victory = world.options.victory_condition + mnt_lasers = world.options.mountain_lasers + chal_lasers = world.options.challenge_lasers + + # Goal is "short box" but short box requires more lasers than long box + reverse_shortbox_goal = (victory == "mountain_box_short" and mnt_lasers > chal_lasers) + + # Goal is "short box" and long box requires at least as many lasers as short box + proper_shortbox = (victory == "mountain_box_short" and mnt_lasers >= chal_lasers) + + # Goal is "long box" and long box requires more lasers than short box (as god intended) + reverse_longbox_goal = (victory == "mountain_box_long" and mnt_lasers > chal_lasers) + + # If goal is shortbox or "reverse longbox", you will never enter the mountain from the top before winning. + mountain_enterable_from_top = not (victory == "mountain_box_short" or reverse_longbox_goal) + + # Caves & Challenge should never have anything if doors are vanilla - definitionally "post-game" + # This is technically imprecise, but it matches player expectations better. + if not (early_caves or doors): + postgame_adjustments.append(get_caves_exclusion_list()) + postgame_adjustments.append(get_beyond_challenge_exclusion_list()) + + # If Challenge itself is the goal, some panels on the way to it need to be left on. + if not victory == "challenge": + postgame_adjustments.append(get_path_to_challenge_exclusion_list()) + postgame_adjustments.append(get_challenge_vault_box_exclusion_list()) + postgame_adjustments.append(get_beyond_challenge_exclusion_list()) + postgame_adjustments.append(get_challenge_vault_box_exclusion_list()) + + # Challenge can only have something if the goal is not challenge or longbox itself. + # In case of shortbox, it'd have to be a "reverse shortbox" situation where shortbox requires *more* lasers. + # In that case, it'd also have to be a doors mode, but that's already covered by the previous block. + if not (victory == "elevator" or reverse_shortbox_goal): + postgame_adjustments.append(get_beyond_challenge_exclusion_list()) + if not victory == "challenge": + postgame_adjustments.append(get_challenge_vault_box_exclusion_list()) + + # Mountain can't be reached if the goal is shortbox (or "reverse long box") + if not mountain_enterable_from_top: + postgame_adjustments.append(get_mountain_upper_exclusion_list()) + + # Same goes for lower mountain, but that one *can* be reached in remote doors modes. + if not doors: + postgame_adjustments.append(get_mountain_lower_exclusion_list()) + + # The Mountain Bottom Floor Discard is a bit complicated, so we handle it separately. ("it" == the Discard) + # In Elevator Goal, it is definitionally in the post-game, unless remote doors is played. + # In Challenge Goal, it is before the Challenge, so it is not post-game. + # In Short Box Goal, you can win before turning it on, UNLESS Short Box requires MORE lasers than long box. + # In Long Box Goal, it is always in the post-game because solving long box is what turns it on. + if not ((victory == "elevator" and doors) or victory == "challenge" or (reverse_shortbox_goal and doors)): + # We now know Bottom Floor Discard is in the post-game. + # This has different consequences depending on whether remote doors is being played. + # If doors are vanilla, Bottom Floor Discard locks a door to an area, which has to be disabled as well. + if doors: + postgame_adjustments.append(get_bottom_floor_discard_exclusion_list()) + else: + postgame_adjustments.append(get_bottom_floor_discard_nondoors_exclusion_list()) + + # If we have a proper short box goal, long box will never be activated first. + if proper_shortbox: + postgame_adjustments.append(["Disabled Locations:", "0xFFF00 (Mountain Box Long)"]) + + return postgame_adjustments + def make_options_adjustments(self, world: "WitnessWorld"): """Makes logic adjustments based on options""" adjustment_linesets_in_order = [] - # Postgame + # Make condensed references to some options - doors = world.options.shuffle_doors >= 2 + doors = world.options.shuffle_doors >= 2 # "Panels" mode has no overarching region accessibility implications. lasers = world.options.shuffle_lasers - early_caves = world.options.early_caves > 0 victory = world.options.victory_condition - mnt_lasers = world.options.mountain_lasers chal_lasers = world.options.challenge_lasers - mountain_enterable_from_top = victory == 0 or victory == 1 or (victory == 3 and chal_lasers > mnt_lasers) - + # Exclude panels from the post-game if shuffle_postgame is false. if not world.options.shuffle_postgame: - if not (early_caves or doors): - adjustment_linesets_in_order.append(get_caves_exclusion_list()) - if not victory == 1: - adjustment_linesets_in_order.append(get_path_to_challenge_exclusion_list()) - adjustment_linesets_in_order.append(get_challenge_vault_box_exclusion_list()) - adjustment_linesets_in_order.append(get_beyond_challenge_exclusion_list()) - - if not ((doors or early_caves) and (victory == 0 or (victory == 2 and mnt_lasers > chal_lasers))): - adjustment_linesets_in_order.append(get_beyond_challenge_exclusion_list()) - if not victory == 1: - adjustment_linesets_in_order.append(get_challenge_vault_box_exclusion_list()) - - if not (doors or mountain_enterable_from_top): - adjustment_linesets_in_order.append(get_mountain_lower_exclusion_list()) - - if not mountain_enterable_from_top: - adjustment_linesets_in_order.append(get_mountain_upper_exclusion_list()) - - if not ((victory == 0 and doors) or victory == 1 or (victory == 2 and mnt_lasers > chal_lasers and doors)): - if doors: - adjustment_linesets_in_order.append(get_bottom_floor_discard_exclusion_list()) - else: - adjustment_linesets_in_order.append(get_bottom_floor_discard_nondoors_exclusion_list()) - - if victory == 2 and chal_lasers >= mnt_lasers: - adjustment_linesets_in_order.append(["Disabled Locations:", "0xFFF00 (Mountain Box Long)"]) + adjustment_linesets_in_order += self.handle_postgame(world) # Exclude Discards / Vaults - if not world.options.shuffle_discarded_panels: # In disable_non_randomized, the discards are needed for alternate activation triggers, UNLESS both # (remote) doors and lasers are shuffled. From 960dad3114baab3c63e5580757e174e2cbfc73f0 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:08:10 +0100 Subject: [PATCH 02/17] Change all references to options to strings --- worlds/witness/__init__.py | 4 ++-- worlds/witness/items.py | 2 +- worlds/witness/locations.py | 4 ++-- worlds/witness/player_logic.py | 26 +++++++++++++------------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/worlds/witness/__init__.py b/worlds/witness/__init__.py index c2d2311c1537..e7b3bed26290 100644 --- a/worlds/witness/__init__.py +++ b/worlds/witness/__init__.py @@ -144,7 +144,7 @@ def create_regions(self): early_items = [item for item in self.items.get_early_items() if item in self.items.get_mandatory_items()] if early_items: random_early_item = self.multiworld.random.choice(early_items) - if self.options.puzzle_randomization == 1: + if self.options.puzzle_randomization == "sigma_expert": # In Expert, only tag the item as early, rather than forcing it onto the gate. self.multiworld.local_early_items[self.player][random_early_item] = 1 else: @@ -167,7 +167,7 @@ def create_regions(self): # Adjust the needed size for sphere 1 based on how restrictive the settings are in terms of items needed_size = 3 - needed_size += self.options.puzzle_randomization == 1 + needed_size += self.options.puzzle_randomization == "sigma_expert" needed_size += self.options.shuffle_symbols needed_size += self.options.shuffle_doors > 0 diff --git a/worlds/witness/items.py b/worlds/witness/items.py index 15c693b25dd4..6128e3d97a83 100644 --- a/worlds/witness/items.py +++ b/worlds/witness/items.py @@ -225,7 +225,7 @@ def get_early_items(self) -> List[str]: output = {"Dots", "Black/White Squares", "Symmetry", "Shapers", "Stars"} if self._world.options.shuffle_discarded_panels: - if self._world.options.puzzle_randomization == 1: + if self._world.options.puzzle_randomization == "sigma_expert": output.add("Arrows") else: output.add("Triangles") diff --git a/worlds/witness/locations.py b/worlds/witness/locations.py index d20be2794056..c5337d471e82 100644 --- a/worlds/witness/locations.py +++ b/worlds/witness/locations.py @@ -509,9 +509,9 @@ def __init__(self, world: "WitnessWorld", player_logic: WitnessPlayerLogic): if world.options.shuffle_vault_boxes: self.PANEL_TYPES_TO_SHUFFLE.add("Vault") - if world.options.shuffle_EPs == 1: + if world.options.shuffle_EPs == "individual": self.PANEL_TYPES_TO_SHUFFLE.add("EP") - elif world.options.shuffle_EPs == 2: + elif world.options.shuffle_EPs == "obelisk_sides": self.PANEL_TYPES_TO_SHUFFLE.add("Obelisk Side") for obelisk_loc in StaticWitnessLocations.OBELISK_SIDES: diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 76e999aea08a..2ddd38f00d32 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -375,36 +375,36 @@ def make_options_adjustments(self, world: "WitnessWorld"): if world.options.shuffle_symbols: adjustment_linesets_in_order.append(get_symbol_shuffle_list()) - if world.options.EP_difficulty == 0: + if world.options.EP_difficulty == "normal": adjustment_linesets_in_order.append(get_ep_easy()) - elif world.options.EP_difficulty == 1: + elif world.options.EP_difficulty == "tedious": adjustment_linesets_in_order.append(get_ep_no_eclipse()) - if world.options.door_groupings == 1: - if world.options.shuffle_doors == 1: + if world.options.door_groupings == "regional": + if world.options.shuffle_doors == "panels": adjustment_linesets_in_order.append(get_simple_panels()) - elif world.options.shuffle_doors == 2: + elif world.options.shuffle_doors == "doors": adjustment_linesets_in_order.append(get_simple_doors()) - elif world.options.shuffle_doors == 3: + elif world.options.shuffle_doors == "mixed": adjustment_linesets_in_order.append(get_simple_doors()) adjustment_linesets_in_order.append(get_simple_additional_panels()) else: - if world.options.shuffle_doors == 1: + if world.options.shuffle_doors == "panels": adjustment_linesets_in_order.append(get_complex_door_panels()) adjustment_linesets_in_order.append(get_complex_additional_panels()) - elif world.options.shuffle_doors == 2: + elif world.options.shuffle_doors == "doors": adjustment_linesets_in_order.append(get_complex_doors()) - elif world.options.shuffle_doors == 3: + elif world.options.shuffle_doors == "mixed": adjustment_linesets_in_order.append(get_complex_doors()) adjustment_linesets_in_order.append(get_complex_additional_panels()) if world.options.shuffle_boat: adjustment_linesets_in_order.append(get_boat()) - if world.options.early_caves == 2: + if world.options.early_caves == "starting_inventory": adjustment_linesets_in_order.append(get_early_caves_start_list()) - if world.options.early_caves == 1 and not doors: + if world.options.early_caves == "add_to_pool" and not doors: adjustment_linesets_in_order.append(get_early_caves_list()) if world.options.elevators_come_to_you: @@ -428,7 +428,7 @@ def make_options_adjustments(self, world: "WitnessWorld"): else: adjustment_linesets_in_order.append(["Disabled Locations:"] + get_ep_obelisks()[1:]) - if world.options.shuffle_EPs == 0: + if not world.options.shuffle_EPs: adjustment_linesets_in_order.append(["Irrelevant Locations:"] + get_ep_all_individual()[1:]) yaml_disabled_eps = [] @@ -439,7 +439,7 @@ def make_options_adjustments(self, world: "WitnessWorld"): loc_obj = self.REFERENCE_LOGIC.ENTITIES_BY_NAME[yaml_disabled_location] - if loc_obj["entityType"] == "EP" and world.options.shuffle_EPs != 0: + if loc_obj["entityType"] == "EP" and not world.options.shuffle_EPs: yaml_disabled_eps.append(loc_obj["entity_hex"]) if loc_obj["entityType"] in {"EP", "General", "Vault", "Discard"}: From e28ff3b61c545e929763956cf813e1e60ef1ae71 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:12:04 +0100 Subject: [PATCH 03/17] oops --- worlds/witness/player_logic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 2ddd38f00d32..28e08388b50a 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -262,13 +262,13 @@ def handle_postgame(world: "WitnessWorld"): chal_lasers = world.options.challenge_lasers # Goal is "short box" but short box requires more lasers than long box - reverse_shortbox_goal = (victory == "mountain_box_short" and mnt_lasers > chal_lasers) + reverse_shortbox_goal = victory == "mountain_box_short" and mnt_lasers > chal_lasers # Goal is "short box" and long box requires at least as many lasers as short box - proper_shortbox = (victory == "mountain_box_short" and mnt_lasers >= chal_lasers) + proper_shortbox = victory == "mountain_box_short" and chal_lasers >= mnt_lasers # Goal is "long box" and long box requires more lasers than short box (as god intended) - reverse_longbox_goal = (victory == "mountain_box_long" and mnt_lasers > chal_lasers) + reverse_longbox_goal = victory == "mountain_box_long" and mnt_lasers > chal_lasers # If goal is shortbox or "reverse longbox", you will never enter the mountain from the top before winning. mountain_enterable_from_top = not (victory == "mountain_box_short" or reverse_longbox_goal) From 62409dcebd6aa63905748e1462761418ece1b13c Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 16:48:24 +0100 Subject: [PATCH 04/17] Fix some outdated code related to yaml-disabled EPs --- worlds/witness/player_logic.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 28e08388b50a..8eaa8d88b1ef 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -431,22 +431,18 @@ def make_options_adjustments(self, world: "WitnessWorld"): if not world.options.shuffle_EPs: adjustment_linesets_in_order.append(["Irrelevant Locations:"] + get_ep_all_individual()[1:]) - yaml_disabled_eps = [] - for yaml_disabled_location in self.YAML_DISABLED_LOCATIONS: if yaml_disabled_location not in self.REFERENCE_LOGIC.ENTITIES_BY_NAME: continue loc_obj = self.REFERENCE_LOGIC.ENTITIES_BY_NAME[yaml_disabled_location] - if loc_obj["entityType"] == "EP" and not world.options.shuffle_EPs: - yaml_disabled_eps.append(loc_obj["entity_hex"]) + if loc_obj["entityType"] == "EP": + self.COMPLETELY_DISABLED_ENTITIES.add(loc_obj["entity_hex"]) - if loc_obj["entityType"] in {"EP", "General", "Vault", "Discard"}: + elif loc_obj["entityType"] in {"General", "Vault", "Discard"}: self.EXCLUDED_LOCATIONS.add(loc_obj["entity_hex"]) - adjustment_linesets_in_order.append(["Disabled Locations:"] + yaml_disabled_eps) - for adjustment_lineset in adjustment_linesets_in_order: current_adjustment_type = None From 088a1efe7e76c2e8b9a2ef51ad78c7eac5521192 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:03:37 +0100 Subject: [PATCH 05/17] Small fixes to short/longbox stuff (thanks Medic) --- worlds/witness/player_logic.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 8eaa8d88b1ef..522039458596 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -264,11 +264,11 @@ def handle_postgame(world: "WitnessWorld"): # Goal is "short box" but short box requires more lasers than long box reverse_shortbox_goal = victory == "mountain_box_short" and mnt_lasers > chal_lasers - # Goal is "short box" and long box requires at least as many lasers as short box - proper_shortbox = victory == "mountain_box_short" and chal_lasers >= mnt_lasers + # Goal is "short box", but long box requires at least as many lasers as short box + proper_shortbox_goal = victory == "mountain_box_short" and chal_lasers >= mnt_lasers - # Goal is "long box" and long box requires more lasers than short box (as god intended) - reverse_longbox_goal = victory == "mountain_box_long" and mnt_lasers > chal_lasers + # Goal is "long box", but short box requires at least as many lasers than long box. + reverse_longbox_goal = victory == "mountain_box_long" and mnt_lasers >= chal_lasers # If goal is shortbox or "reverse longbox", you will never enter the mountain from the top before winning. mountain_enterable_from_top = not (victory == "mountain_box_short" or reverse_longbox_goal) @@ -317,7 +317,7 @@ def handle_postgame(world: "WitnessWorld"): postgame_adjustments.append(get_bottom_floor_discard_nondoors_exclusion_list()) # If we have a proper short box goal, long box will never be activated first. - if proper_shortbox: + if proper_shortbox_goal: postgame_adjustments.append(["Disabled Locations:", "0xFFF00 (Mountain Box Long)"]) return postgame_adjustments From 19c1a616dd0537d56502bfc7eab8685db8c4be16 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:04:04 +0100 Subject: [PATCH 06/17] comment --- worlds/witness/player_logic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 522039458596..ad055bcc3fa9 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -264,7 +264,7 @@ def handle_postgame(world: "WitnessWorld"): # Goal is "short box" but short box requires more lasers than long box reverse_shortbox_goal = victory == "mountain_box_short" and mnt_lasers > chal_lasers - # Goal is "short box", but long box requires at least as many lasers as short box + # Goal is "short box", and long box requires at least as many lasers as short box (as god intended) proper_shortbox_goal = victory == "mountain_box_short" and chal_lasers >= mnt_lasers # Goal is "long box", but short box requires at least as many lasers than long box. From 8242f4f8a267ad8aa7da272f0b2ee9f1fc994b8b Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:13:51 +0100 Subject: [PATCH 07/17] fix duplicate --- worlds/witness/player_logic.py | 1 - 1 file changed, 1 deletion(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index ad055bcc3fa9..664fac691749 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -284,7 +284,6 @@ def handle_postgame(world: "WitnessWorld"): postgame_adjustments.append(get_path_to_challenge_exclusion_list()) postgame_adjustments.append(get_challenge_vault_box_exclusion_list()) postgame_adjustments.append(get_beyond_challenge_exclusion_list()) - postgame_adjustments.append(get_challenge_vault_box_exclusion_list()) # Challenge can only have something if the goal is not challenge or longbox itself. # In case of shortbox, it'd have to be a "reverse shortbox" situation where shortbox requires *more* lasers. From d5a82694629f2c18376eedfba869c5cbf8dce0ec Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:14:27 +0100 Subject: [PATCH 08/17] Removed triplicate lmfao --- worlds/witness/player_logic.py | 1 - 1 file changed, 1 deletion(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 664fac691749..85c486ccf702 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -283,7 +283,6 @@ def handle_postgame(world: "WitnessWorld"): if not victory == "challenge": postgame_adjustments.append(get_path_to_challenge_exclusion_list()) postgame_adjustments.append(get_challenge_vault_box_exclusion_list()) - postgame_adjustments.append(get_beyond_challenge_exclusion_list()) # Challenge can only have something if the goal is not challenge or longbox itself. # In case of shortbox, it'd have to be a "reverse shortbox" situation where shortbox requires *more* lasers. From 0b131187c9badf4458a1a357af8e152da9f5ced7 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 21:17:01 +0100 Subject: [PATCH 09/17] Better comment --- worlds/witness/player_logic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 85c486ccf702..10e617315a7f 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -279,7 +279,7 @@ def handle_postgame(world: "WitnessWorld"): postgame_adjustments.append(get_caves_exclusion_list()) postgame_adjustments.append(get_beyond_challenge_exclusion_list()) - # If Challenge itself is the goal, some panels on the way to it need to be left on. + # If Challenge is the goal, some panels on the way need to be left on, as well as Challenge Vault box itself if not victory == "challenge": postgame_adjustments.append(get_path_to_challenge_exclusion_list()) postgame_adjustments.append(get_challenge_vault_box_exclusion_list()) From 08e3e12bbc51a5816a7bdd6ef9a9cd6217a1d957 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 23:19:06 +0100 Subject: [PATCH 10/17] added another 'unfun' postgame consideration --- worlds/witness/player_logic.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 10e617315a7f..c8777e161fb2 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -314,6 +314,12 @@ def handle_postgame(world: "WitnessWorld"): else: postgame_adjustments.append(get_bottom_floor_discard_nondoors_exclusion_list()) + # Technically, in Challenge goal + early_caves, you could find something important on bottom floor Discard, + # including the Caves Shortcuts themselves if playing "early_caves: start_inventory". + # This is another thing that was deemed "unfun" more than fitting the actual definition of post-game. + if victory == "challenge" and early_caves and not doors: + postgame_adjustments.append(get_bottom_floor_discard_nondoors_exclusion_list()) + # If we have a proper short box goal, long box will never be activated first. if proper_shortbox_goal: postgame_adjustments.append(["Disabled Locations:", "0xFFF00 (Mountain Box Long)"]) From aa5169befb90a1991a3ab1855d01df47bca58f5a Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sat, 25 Nov 2023 23:20:34 +0100 Subject: [PATCH 11/17] comment --- worlds/witness/player_logic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index c8777e161fb2..8e8fbeac8164 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -314,7 +314,7 @@ def handle_postgame(world: "WitnessWorld"): else: postgame_adjustments.append(get_bottom_floor_discard_nondoors_exclusion_list()) - # Technically, in Challenge goal + early_caves, you could find something important on bottom floor Discard, + # In Challenge goal + early_caves + vanilla doors, you could find something important on Bottom Floor Discard, # including the Caves Shortcuts themselves if playing "early_caves: start_inventory". # This is another thing that was deemed "unfun" more than fitting the actual definition of post-game. if victory == "challenge" and early_caves and not doors: From d789ea3ec108f93c8b1ab965da8abf8944b3b96d Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sun, 26 Nov 2023 03:31:12 +0100 Subject: [PATCH 12/17] more option strings --- worlds/witness/__init__.py | 2 +- worlds/witness/hints.py | 6 +++--- worlds/witness/player_logic.py | 8 ++++---- worlds/witness/regions.py | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/worlds/witness/__init__.py b/worlds/witness/__init__.py index e7b3bed26290..c74061224fd6 100644 --- a/worlds/witness/__init__.py +++ b/worlds/witness/__init__.py @@ -266,7 +266,7 @@ def fill_slot_data(self) -> dict: audio_logs = get_audio_logs().copy() - if hint_amount != 0: + if hint_amount: generated_hints = make_hints(self, hint_amount, self.own_itempool) self.random.shuffle(audio_logs) diff --git a/worlds/witness/hints.py b/worlds/witness/hints.py index 1e54ec352cb6..ed7c8f3debe3 100644 --- a/worlds/witness/hints.py +++ b/worlds/witness/hints.py @@ -173,15 +173,15 @@ def get_always_hint_items(world: "WitnessWorld"): wincon = world.options.victory_condition if discards: - if difficulty == 1: + if difficulty == "sigma_expert": always.append("Arrows") else: always.append("Triangles") - if wincon == 0: + if wincon == "elevator": always += ["Mountain Bottom Floor Final Room Entry (Door)", "Mountain Bottom Floor Doors"] - if wincon == 1: + if wincon == "challenge": always += ["Challenge Entry (Panel)", "Caves Panels"] return always diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 8e8fbeac8164..8b284a437e6b 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -358,13 +358,13 @@ def make_options_adjustments(self, world: "WitnessWorld"): # Victory Condition - if victory == 0: + if victory == "elevator": self.VICTORY_LOCATION = "0x3D9A9" - elif victory == 1: + elif victory == "challenge": self.VICTORY_LOCATION = "0x0356B" - elif victory == 2: + elif victory == "mountain_box_short": self.VICTORY_LOCATION = "0x09F7F" - elif victory == 3: + elif victory == "mountain_box_long": self.VICTORY_LOCATION = "0xFFF00" if chal_lasers <= 7: diff --git a/worlds/witness/regions.py b/worlds/witness/regions.py index 2187010bac07..05fab3d97f14 100644 --- a/worlds/witness/regions.py +++ b/worlds/witness/regions.py @@ -136,11 +136,11 @@ def create_regions(self, world: "WitnessWorld", player_logic: WitnessPlayerLogic def __init__(self, locat: WitnessPlayerLocations, world: "WitnessWorld"): difficulty = world.options.puzzle_randomization.value - if difficulty == 0: + if difficulty == "sigma_normal": self.reference_logic = StaticWitnessLogic.sigma_normal - elif difficulty == 1: + elif difficulty == "sigma_expert": self.reference_logic = StaticWitnessLogic.sigma_expert - elif difficulty == 2: + elif difficulty == "none": self.reference_logic = StaticWitnessLogic.vanilla self.locat = locat From d0b3d784c4e54458b12a0af248fed68ce864a028 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sun, 26 Nov 2023 03:32:05 +0100 Subject: [PATCH 13/17] oops --- worlds/witness/regions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/regions.py b/worlds/witness/regions.py index 05fab3d97f14..48d4ed01d107 100644 --- a/worlds/witness/regions.py +++ b/worlds/witness/regions.py @@ -134,7 +134,7 @@ def create_regions(self, world: "WitnessWorld", player_logic: WitnessPlayerLogic world.multiworld.regions += final_regions_list def __init__(self, locat: WitnessPlayerLocations, world: "WitnessWorld"): - difficulty = world.options.puzzle_randomization.value + difficulty = world.options.puzzle_randomization if difficulty == "sigma_normal": self.reference_logic = StaticWitnessLogic.sigma_normal From 4e31372c5e861a91108b65b63f096792149f2a9d Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Fri, 1 Dec 2023 05:11:09 +0100 Subject: [PATCH 14/17] Remove an unnecessary comparison --- worlds/witness/player_logic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 8b284a437e6b..8d9f6c2d081b 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -256,7 +256,7 @@ def handle_postgame(world: "WitnessWorld"): # Make some quick references to some options doors = world.options.shuffle_doors >= 2 # "Panels" mode has no overarching region accessibility implications. - early_caves = world.options.early_caves > 0 + early_caves = world.options.early_caves victory = world.options.victory_condition mnt_lasers = world.options.mountain_lasers chal_lasers = world.options.challenge_lasers From 578ed780a10dfac56eb77662a598cd89c59ab815 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Fri, 1 Dec 2023 05:15:07 +0100 Subject: [PATCH 15/17] another string missed --- worlds/witness/player_logic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 8d9f6c2d081b..858fe67d8302 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -353,7 +353,7 @@ def make_options_adjustments(self, world: "WitnessWorld"): if not world.options.shuffle_vault_boxes: adjustment_linesets_in_order.append(get_vault_exclusion_list()) - if not victory == 1: + if not victory == "challenge": adjustment_linesets_in_order.append(get_challenge_vault_box_exclusion_list()) # Victory Condition From 1b774106719bd161279cf158fa7e0388a9d78c3f Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sun, 31 Dec 2023 16:59:46 +0100 Subject: [PATCH 16/17] Another was missed --- worlds/witness/player_logic.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index 63316779c42e..3b0dc22d8808 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -560,13 +560,13 @@ def __init__(self, world: "WitnessWorld", disabled_locations: Set[str], start_in self.DOOR_ITEMS_BY_ID: Dict[str, List[str]] = {} self.STARTING_INVENTORY = set() - self.DIFFICULTY = world.options.puzzle_randomization.value + self.DIFFICULTY = world.options.puzzle_randomization - if self.DIFFICULTY == 0: + if self.DIFFICULTY == "sigma_normal": self.REFERENCE_LOGIC = StaticWitnessLogic.sigma_normal - elif self.DIFFICULTY == 1: + elif self.DIFFICULTY == "sigma_expert": self.REFERENCE_LOGIC = StaticWitnessLogic.sigma_expert - elif self.DIFFICULTY == 2: + elif self.DIFFICULTY == "none": self.REFERENCE_LOGIC = StaticWitnessLogic.vanilla self.CONNECTIONS_BY_REGION_NAME = copy.copy(self.REFERENCE_LOGIC.STATIC_CONNECTIONS_BY_REGION_NAME) From 17e875399279d7f2341e9a69dd3d92fb87ead478 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Thu, 4 Jan 2024 02:20:01 +0100 Subject: [PATCH 17/17] This would create a really bad merge error --- worlds/witness/player_logic.py | 1 + 1 file changed, 1 insertion(+) diff --git a/worlds/witness/player_logic.py b/worlds/witness/player_logic.py index bbf93b4f230c..50debc6a6678 100644 --- a/worlds/witness/player_logic.py +++ b/worlds/witness/player_logic.py @@ -339,6 +339,7 @@ def make_options_adjustments(self, world: "WitnessWorld"): doors = world.options.shuffle_doors >= 2 # "Panels" mode has no overarching region accessibility implications. lasers = world.options.shuffle_lasers victory = world.options.victory_condition + mnt_lasers = world.options.mountain_lasers chal_lasers = world.options.challenge_lasers # Exclude panels from the post-game if shuffle_postgame is false.