From 0bd97828bb2e4d2dcd315d544875fb7d90f34bdd Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sun, 16 Jun 2024 12:29:03 +0200 Subject: [PATCH 01/19] Add panel hunt plando option --- worlds/witness/options.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/worlds/witness/options.py b/worlds/witness/options.py index 6f7222d5f9b4..d1cf0326b085 100644 --- a/worlds/witness/options.py +++ b/worlds/witness/options.py @@ -2,10 +2,21 @@ from schema import And, Schema -from Options import Choice, DefaultOnToggle, OptionDict, OptionGroup, PerGameCommonOptions, Range, Toggle, Visibility +from Options import ( + Choice, + DefaultOnToggle, + LocationSet, + OptionDict, + OptionGroup, + PerGameCommonOptions, + Range, + Toggle, + Visibility, +) from .data import static_logic as static_witness_logic from .data.item_definition_classes import ItemCategory, WeightedItemDefinition +from .entity_hunt import ALL_HUNTABLE_PANELS class DisableNonRandomizedPuzzles(Toggle): @@ -241,6 +252,16 @@ class PanelHuntDiscourageSameAreaFactor(Range): default = 40 +class PanelHuntPlando(LocationSet): + """ + Specify specific hunt panels you want for your panel hunt game. + """ + + display = "Panel Hunt Plando" + + valid_keys = ALL_HUNTABLE_PANELS + + class PuzzleRandomization(Choice): """ Puzzles in this randomizer are randomly generated. This option changes the difficulty/types of puzzles. @@ -412,6 +433,7 @@ class TheWitnessOptions(PerGameCommonOptions): panel_hunt_required_percentage: PanelHuntRequiredPercentage panel_hunt_postgame: PanelHuntPostgame panel_hunt_discourage_same_area_factor: PanelHuntDiscourageSameAreaFactor + panel_hunt_plando: PanelHuntPlando early_caves: EarlyCaves early_symbol_item: EarlySymbolItem elevators_come_to_you: ElevatorsComeToYou @@ -438,6 +460,7 @@ class TheWitnessOptions(PerGameCommonOptions): PanelHuntTotal, PanelHuntPostgame, PanelHuntDiscourageSameAreaFactor, + PanelHuntPlando, ], start_collapsed=True), OptionGroup("Locations", [ ShuffleDiscardedPanels, From 89a16eb536c41125b1d9d3e6e4cb071927cb225a Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sun, 16 Jun 2024 12:36:43 +0200 Subject: [PATCH 02/19] Keys are strs --- worlds/witness/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/options.py b/worlds/witness/options.py index d1cf0326b085..eb41a8026406 100644 --- a/worlds/witness/options.py +++ b/worlds/witness/options.py @@ -259,7 +259,7 @@ class PanelHuntPlando(LocationSet): display = "Panel Hunt Plando" - valid_keys = ALL_HUNTABLE_PANELS + valid_keys = [static_witness_logic.ENTITIES_BY_HEX[panel_hex]["checkName"] for panel_hex in ALL_HUNTABLE_PANELS] class PuzzleRandomization(Choice): From fc8533daac333e3498414ddc4e7b8114d00f0b21 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sun, 16 Jun 2024 13:06:05 +0200 Subject: [PATCH 03/19] oops --- worlds/witness/entity_hunt.py | 39 ++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 29b914799fdb..65433115eaf4 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -1,5 +1,5 @@ from collections import defaultdict -from logging import debug +from logging import debug, warning from pprint import pformat from typing import TYPE_CHECKING, Dict, List, Set, Tuple @@ -69,23 +69,52 @@ def pick_panel_hunt_panels(self, total_amount: int) -> Set[str]: return self.HUNT_ENTITIES - def _entity_is_eligible(self, panel_hex: str) -> bool: + def _entity_is_eligible(self, panel_hex: str, plando: bool = False) -> bool: """ Determine whether an entity is eligible for entity hunt based on player options. """ panel_obj = static_witness_logic.ENTITIES_BY_HEX[panel_hex] + if plando: + if not self.player_logic.solvability_guaranteed(panel_hex): + warning(f"Panel {panel_obj['checkName']} is disabled and thus not eligible for panel hunt.") + return False + return True + return ( - self.player_logic.solvability_guaranteed(panel_hex) - and not ( # Due to an edge case, Discards have to be on in disable_non_randomized even if Discard Shuffle is off. # However, I don't think they should be hunt panels in this case. self.player_options.disable_non_randomized_puzzles and not self.player_options.shuffle_discarded_panels and panel_obj["locationType"] == "Discard" - ) ) + def _add_plandoed_hunt_panels_to_pre_picked(self): + """ + Add panels the player explicitly specified to be included in panel hunt to the pre picked hunt panels. + Output a warning if a panel could not be added for some reason. + """ + + # Plandoed hunt panels should be in random order, but deterministic by seed, so we sort, then shuffle + panels_to_plando = sorted(self.player_options.panel_hunt_plando.value) + self.random.shuffle(panels_to_plando) + + for location_name in panels_to_plando: + entity_hex = static_witness_logic.ENTITIES_BY_NAME[location_name]["entity_hex"] + + if entity_hex in self.PRE_PICKED_HUNT_ENTITIES: + continue + + if self._entity_is_eligible(entity_hex, plando=True): + if len(self.PRE_PICKED_HUNT_ENTITIES) == self.player_options.panel_hunt_total: + warning( + f"Panel {location_name} could not be plandoed for {self.player_name}'s world " + f"because it would exceed their panel hunt total." + ) + continue + + self.PRE_PICKED_HUNT_ENTITIES.add(entity_hex) + def _get_eligible_panels(self) -> Tuple[List[str], Dict[str, Set[str]]]: """ There are some entities that are not allowed for panel hunt for various technical of gameplay reasons. From 903846162924d44e0f9ade2baabb96dd8513e106 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sun, 16 Jun 2024 13:06:36 +0200 Subject: [PATCH 04/19] better message --- worlds/witness/entity_hunt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 65433115eaf4..ad4308c1704c 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -108,7 +108,7 @@ def _add_plandoed_hunt_panels_to_pre_picked(self): if self._entity_is_eligible(entity_hex, plando=True): if len(self.PRE_PICKED_HUNT_ENTITIES) == self.player_options.panel_hunt_total: warning( - f"Panel {location_name} could not be plandoed for {self.player_name}'s world " + f"Panel {location_name} could not be plandoed as a hunt panel for {self.player_name}'s world " f"because it would exceed their panel hunt total." ) continue From ef69526c2b81074ccd68ff5db4926aa411f6d1df Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Sun, 16 Jun 2024 13:07:04 +0200 Subject: [PATCH 05/19] , --- worlds/witness/entity_hunt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index ad4308c1704c..9b4012882d61 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -108,7 +108,7 @@ def _add_plandoed_hunt_panels_to_pre_picked(self): if self._entity_is_eligible(entity_hex, plando=True): if len(self.PRE_PICKED_HUNT_ENTITIES) == self.player_options.panel_hunt_total: warning( - f"Panel {location_name} could not be plandoed as a hunt panel for {self.player_name}'s world " + f"Panel {location_name} could not be plandoed as a hunt panel for {self.player_name}'s world, " f"because it would exceed their panel hunt total." ) continue From 96cb2f8eaa5f0402e3ab54e67e5d2e6fb0e49135 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:35:52 +0200 Subject: [PATCH 06/19] this doesn ot need to be here --- worlds/witness/entity_hunt.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 9b4012882d61..42cfc1b6fefd 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -121,10 +121,7 @@ def _get_eligible_panels(self) -> Tuple[List[str], Dict[str, Set[str]]]: Make a list of all the ones that *are* eligible, plus a lookup of eligible panels per area. """ - all_eligible_panels = [ - panel for panel in ALL_HUNTABLE_PANELS - if self._entity_is_eligible(panel) - ] + all_eligible_panels = [panel for panel in ALL_HUNTABLE_PANELS if self._entity_is_eligible(panel)] eligible_panels_by_area = defaultdict(set) for eligible_panel in all_eligible_panels: From 82bded2a9448dd0208ca30f4727fc0a63c4b0a3e Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Mon, 17 Jun 2024 16:40:08 +0200 Subject: [PATCH 07/19] don't replace pre picked panels --- worlds/witness/entity_hunt.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 42cfc1b6fefd..56a500b581d4 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -240,6 +240,10 @@ def _replace_unfair_hunt_entities_with_good_hunt_entities(self) -> None: if good_entity in self.HUNT_ENTITIES or good_entity not in self.ALL_ELIGIBLE_ENTITIES: continue + # ... and it's not a forced pick that should stay the same ... + if bad_entitiy in self.PRE_PICKED_HUNT_ENTITIES: + continue + # ... replace the bad entity with the good entity. self.HUNT_ENTITIES.remove(bad_entitiy) self.HUNT_ENTITIES.add(good_entity) From d751a768f3746076fe958eb477e6536471f8440b Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Fri, 28 Jun 2024 22:51:26 +0200 Subject: [PATCH 08/19] Update options.py --- worlds/witness/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/options.py b/worlds/witness/options.py index eb41a8026406..49fabbe196ec 100644 --- a/worlds/witness/options.py +++ b/worlds/witness/options.py @@ -257,7 +257,7 @@ class PanelHuntPlando(LocationSet): Specify specific hunt panels you want for your panel hunt game. """ - display = "Panel Hunt Plando" + display_name = "Panel Hunt Plando" valid_keys = [static_witness_logic.ENTITIES_BY_HEX[panel_hex]["checkName"] for panel_hex in ALL_HUNTABLE_PANELS] From 7f56c92aa6431c752fdfdda8942f45b25684d82b Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:10:46 +0200 Subject: [PATCH 09/19] rebase error --- worlds/witness/entity_hunt.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 56a500b581d4..b99473f737a1 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -46,7 +46,9 @@ def __init__(self, player_logic: "WitnessPlayerLogic", world: "WitnessWorld", self.random = world.random self.PRE_PICKED_HUNT_ENTITIES = pre_picked_entities.copy() - self.HUNT_ENTITIES: Set[str] = set() + self.HUNT_ENTITIES = set() + + self._add_plandoed_hunt_panels_to_pre_picked() self.ALL_ELIGIBLE_ENTITIES, self.ELIGIBLE_ENTITIES_PER_AREA = self._get_eligible_panels() From 4219014340db407a5e4555d3706225f1af4e0356 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:11:33 +0200 Subject: [PATCH 10/19] rebase error --- worlds/witness/entity_hunt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index b99473f737a1..0b6da1deecd8 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -46,7 +46,7 @@ def __init__(self, player_logic: "WitnessPlayerLogic", world: "WitnessWorld", self.random = world.random self.PRE_PICKED_HUNT_ENTITIES = pre_picked_entities.copy() - self.HUNT_ENTITIES = set() + self.HUNT_ENTITIES: Set[str] = set() self._add_plandoed_hunt_panels_to_pre_picked() From d6642b4119916ed0f14f46950c9b1bbafae78c1a Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:13:25 +0200 Subject: [PATCH 11/19] oops --- worlds/witness/entity_hunt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 0b6da1deecd8..914a4971dd25 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -83,7 +83,7 @@ def _entity_is_eligible(self, panel_hex: str, plando: bool = False) -> bool: return False return True - return ( + return not ( # Due to an edge case, Discards have to be on in disable_non_randomized even if Discard Shuffle is off. # However, I don't think they should be hunt panels in this case. self.player_options.disable_non_randomized_puzzles @@ -91,7 +91,7 @@ def _entity_is_eligible(self, panel_hex: str, plando: bool = False) -> bool: and panel_obj["locationType"] == "Discard" ) - def _add_plandoed_hunt_panels_to_pre_picked(self): + def _add_plandoed_hunt_panels_to_pre_picked(self) -> None: """ Add panels the player explicitly specified to be included in panel hunt to the pre picked hunt panels. Output a warning if a panel could not be added for some reason. From 4165173672a981506834665d1f80b894d7f8d7d0 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:14:07 +0200 Subject: [PATCH 12/19] Mypy --- worlds/witness/test/test_panel_hunt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worlds/witness/test/test_panel_hunt.py b/worlds/witness/test/test_panel_hunt.py index 2fc16f787e67..68c242f5cdeb 100644 --- a/worlds/witness/test/test_panel_hunt.py +++ b/worlds/witness/test/test_panel_hunt.py @@ -13,7 +13,7 @@ class TestMaxPanelHuntMinChecks(WitnessTestBase): "shuffle_vault_boxes": False, } - def test_correct_panels_were_picked(self): + def test_correct_panels_were_picked(self) -> None: with self.subTest("Check that 100 Hunt Panels were actually picked."): self.assertEqual(len(self.multiworld.find_item_locations("+1 Panel Hunt", self.player)), 100) @@ -63,7 +63,7 @@ class TestPanelHuntPostgame(WitnessMultiworldTestBase): "shuffle_discarded_panels": True, } - def test_panel_hunt_postgame(self): + def test_panel_hunt_postgame(self) -> None: for player_minus_one, options in enumerate(self.options_per_world): player = player_minus_one + 1 postgame_option = options["panel_hunt_postgame"] From 076f043fb8f0ecf39d2559604ec64d82f505c9d2 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:14:47 +0200 Subject: [PATCH 13/19] ruff --- worlds/witness/test/test_panel_hunt.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/worlds/witness/test/test_panel_hunt.py b/worlds/witness/test/test_panel_hunt.py index 68c242f5cdeb..c06b44c64b4d 100644 --- a/worlds/witness/test/test_panel_hunt.py +++ b/worlds/witness/test/test_panel_hunt.py @@ -1,5 +1,6 @@ -from BaseClasses import CollectionState, Item -from worlds.witness.test import WitnessTestBase, WitnessMultiworldTestBase +from BaseClasses import CollectionState + +from worlds.witness.test import WitnessMultiworldTestBase, WitnessTestBase class TestMaxPanelHuntMinChecks(WitnessTestBase): @@ -67,41 +68,41 @@ def test_panel_hunt_postgame(self) -> None: for player_minus_one, options in enumerate(self.options_per_world): player = player_minus_one + 1 postgame_option = options["panel_hunt_postgame"] - with self.subTest(f"Test that \"{postgame_option}\" results in 40 Hunt Panels."): + with self.subTest(f'Test that "{postgame_option}" results in 40 Hunt Panels.'): self.assertEqual(len(self.multiworld.find_item_locations("+1 Panel Hunt", player)), 40) # Test that the box gets extra checks from panel_hunt_postgame - with self.subTest("Test that \"everything_is_eligible\" has no Mountaintop Box Hunt Panels."): + with self.subTest('Test that "everything_is_eligible" has no Mountaintop Box Hunt Panels.'): self.assert_location_does_not_exist("Mountaintop Box Short (Panel Hunt)", 1, strict_check=False) self.assert_location_does_not_exist("Mountaintop Box Long (Panel Hunt)", 1, strict_check=False) - with self.subTest("Test that \"disable_mountain_lasers_locations\" has a Hunt Panel for Short, but not Long."): + with self.subTest('Test that "disable_mountain_lasers_locations" has a Hunt Panel for Short, but not Long.'): self.assert_location_exists("Mountaintop Box Short (Panel Hunt)", 2, strict_check=False) self.assert_location_does_not_exist("Mountaintop Box Long (Panel Hunt)", 2, strict_check=False) - with self.subTest("Test that \"disable_challenge_lasers_locations\" has a Hunt Panel for Long, but not Short."): + with self.subTest('Test that "disable_challenge_lasers_locations" has a Hunt Panel for Long, but not Short.'): self.assert_location_does_not_exist("Mountaintop Box Short (Panel Hunt)", 3, strict_check=False) self.assert_location_exists("Mountaintop Box Long (Panel Hunt)", 3, strict_check=False) - with self.subTest("Test that \"disable_anything_locked_by_lasers\" has both Mountaintop Box Hunt Panels."): + with self.subTest('Test that "disable_anything_locked_by_lasers" has both Mountaintop Box Hunt Panels.'): self.assert_location_exists("Mountaintop Box Short (Panel Hunt)", 4, strict_check=False) self.assert_location_exists("Mountaintop Box Long (Panel Hunt)", 4, strict_check=False) # Check panel_hunt_postgame locations get disabled - with self.subTest("Test that \"everything_is_eligible\" does not disable any locked-by-lasers panels."): + with self.subTest('Test that "everything_is_eligible" does not disable any locked-by-lasers panels.'): self.assert_location_exists("Mountain Floor 1 Right Row 5", 1) self.assert_location_exists("Mountain Bottom Floor Discard", 1) - with self.subTest("Test that \"disable_mountain_lasers_locations\" disables only Shortbox-Locked panels."): + with self.subTest('Test that "disable_mountain_lasers_locations" disables only Shortbox-Locked panels.'): self.assert_location_does_not_exist("Mountain Floor 1 Right Row 5", 2) self.assert_location_exists("Mountain Bottom Floor Discard", 2) - with self.subTest("Test that \"disable_challenge_lasers_locations\" disables only Longbox-Locked panels."): + with self.subTest('Test that "disable_challenge_lasers_locations" disables only Longbox-Locked panels.'): self.assert_location_exists("Mountain Floor 1 Right Row 5", 3) self.assert_location_does_not_exist("Mountain Bottom Floor Discard", 3) - with self.subTest("Test that \"everything_is_eligible\" disables only Shortbox-Locked panels."): + with self.subTest('Test that "everything_is_eligible" disables only Shortbox-Locked panels.'): self.assert_location_does_not_exist("Mountain Floor 1 Right Row 5", 4) self.assert_location_does_not_exist("Mountain Bottom Floor Discard", 4) From d74d8e60e68fd37e53bbf7c39be0e1cc6f1c3c42 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:16:39 +0200 Subject: [PATCH 14/19] another rebase error --- worlds/witness/entity_hunt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 914a4971dd25..1471cdae4308 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -83,12 +83,15 @@ def _entity_is_eligible(self, panel_hex: str, plando: bool = False) -> bool: return False return True - return not ( + return ( + self.player_logic.solvability_guaranteed(panel_hex) + and not ( # Due to an edge case, Discards have to be on in disable_non_randomized even if Discard Shuffle is off. # However, I don't think they should be hunt panels in this case. self.player_options.disable_non_randomized_puzzles and not self.player_options.shuffle_discarded_panels and panel_obj["locationType"] == "Discard" + ) ) def _add_plandoed_hunt_panels_to_pre_picked(self) -> None: From 16b18e20f019b5e9e8e4f4a9a7d06eaaf752b399 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:17:19 +0200 Subject: [PATCH 15/19] actually this is a stupid change too --- worlds/witness/entity_hunt.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 1471cdae4308..cb9c5d41f35b 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -126,7 +126,10 @@ def _get_eligible_panels(self) -> Tuple[List[str], Dict[str, Set[str]]]: Make a list of all the ones that *are* eligible, plus a lookup of eligible panels per area. """ - all_eligible_panels = [panel for panel in ALL_HUNTABLE_PANELS if self._entity_is_eligible(panel)] + all_eligible_panels = [ + panel for panel in ALL_HUNTABLE_PANELS + if self._entity_is_eligible(panel) + ] eligible_panels_by_area = defaultdict(set) for eligible_panel in all_eligible_panels: From 5f5f7bdb108969ad6a340de16fe021c27dc8a3ee Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:34:20 +0200 Subject: [PATCH 16/19] bring over that change:tm: --- worlds/witness/entity_hunt.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index cb9c5d41f35b..6d093b488f59 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -77,21 +77,17 @@ def _entity_is_eligible(self, panel_hex: str, plando: bool = False) -> bool: """ panel_obj = static_witness_logic.ENTITIES_BY_HEX[panel_hex] - if plando: - if not self.player_logic.solvability_guaranteed(panel_hex): - warning(f"Panel {panel_obj['checkName']} is disabled and thus not eligible for panel hunt.") - return False - return True - - return ( - self.player_logic.solvability_guaranteed(panel_hex) - and not ( + if not self.player_logic.solvability_guaranteed(panel_hex) or panel_hex in self.player_logic.EXCLUDED_LOCATIONS: + if plando: + warning(f"Panel {panel_obj['checkName']} is disabled / excluded and thus not eligible for panel hunt.") + return False + + return not ( # Due to an edge case, Discards have to be on in disable_non_randomized even if Discard Shuffle is off. # However, I don't think they should be hunt panels in this case. self.player_options.disable_non_randomized_puzzles and not self.player_options.shuffle_discarded_panels and panel_obj["locationType"] == "Discard" - ) ) def _add_plandoed_hunt_panels_to_pre_picked(self) -> None: From 6e7fc6abef9ee157da41126d4cac2475b80c9e33 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:41:31 +0200 Subject: [PATCH 17/19] Update entity_hunt.py --- worlds/witness/entity_hunt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index ef6f3e021f28..3939832acec7 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -82,14 +82,19 @@ def _entity_is_eligible(self, panel_hex: str, plando: bool = False) -> bool: warning(f"Panel {panel_obj['checkName']} is disabled / excluded and thus not eligible for panel hunt.") return False + if plando: + # For a plandoed panel, everything is eligible apart from disabled panels + return True + return ( - (plando or panel_hex not in self.player_logic.EXCLUDED_ENTITIES) + panel_hex not in self.player_logic.EXCLUDED_ENTITIES and not ( # Due to an edge case, Discards have to be on in disable_non_randomized even if Discard Shuffle is off. # However, I don't think they should be hunt panels in this case. self.player_options.disable_non_randomized_puzzles and not self.player_options.shuffle_discarded_panels and panel_obj["locationType"] == "Discard" + ) ) def _add_plandoed_hunt_panels_to_pre_picked(self) -> None: From 96951a28345357bdf767a02e6dbbfd5efd473c16 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:51:58 +0200 Subject: [PATCH 18/19] Update entity_hunt.py --- worlds/witness/entity_hunt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index 3939832acec7..e52bbce02012 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -77,7 +77,7 @@ def _entity_is_eligible(self, panel_hex: str, plando: bool = False) -> bool: """ panel_obj = static_witness_logic.ENTITIES_BY_HEX[panel_hex] - if not self.player_logic.solvability_guaranteed(panel_hex) or panel_hex in self.player_logic.EXCLUDED_LOCATIONS: + if not self.player_logic.solvability_guaranteed(panel_hex) or panel_hex in self.player_logic.EXCLUDED_ENTITIES: if plando: warning(f"Panel {panel_obj['checkName']} is disabled / excluded and thus not eligible for panel hunt.") return False From b52640559d84041b74773eb837a2bce1685f2006 Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Tue, 27 Aug 2024 21:23:53 +0200 Subject: [PATCH 19/19] Update entity_hunt.py --- worlds/witness/entity_hunt.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/worlds/witness/entity_hunt.py b/worlds/witness/entity_hunt.py index e52bbce02012..b7b138a44d55 100644 --- a/worlds/witness/entity_hunt.py +++ b/worlds/witness/entity_hunt.py @@ -82,19 +82,12 @@ def _entity_is_eligible(self, panel_hex: str, plando: bool = False) -> bool: warning(f"Panel {panel_obj['checkName']} is disabled / excluded and thus not eligible for panel hunt.") return False - if plando: - # For a plandoed panel, everything is eligible apart from disabled panels - return True - - return ( - panel_hex not in self.player_logic.EXCLUDED_ENTITIES - and not ( - # Due to an edge case, Discards have to be on in disable_non_randomized even if Discard Shuffle is off. - # However, I don't think they should be hunt panels in this case. - self.player_options.disable_non_randomized_puzzles - and not self.player_options.shuffle_discarded_panels - and panel_obj["locationType"] == "Discard" - ) + return plando or not ( + # Due to an edge case, Discards have to be on in disable_non_randomized even if Discard Shuffle is off. + # However, I don't think they should be hunt panels in this case. + self.player_options.disable_non_randomized_puzzles + and not self.player_options.shuffle_discarded_panels + and panel_obj["locationType"] == "Discard" ) def _add_plandoed_hunt_panels_to_pre_picked(self) -> None: