The Witness: Add more panels to the "doors: panels" mode (#2916)

* Add more panels that should be panels

* Make it so the caves panel items don't exist in early caves

* Remove unused import

* oops

* Remove Jungle to Monastery Garden from usefulification list

* Add a basic test

* ruff

---------

Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
This commit is contained in:
NewSoupVi
2024-12-10 21:13:45 +01:00
committed by GitHub
parent 54a0a5ac00
commit 9a37a136a1
8 changed files with 67 additions and 13 deletions

View File

@@ -82,6 +82,7 @@ class WitnessPlayerLogic:
self.PARENT_ITEM_COUNT_PER_BASE_ITEM: Dict[str, int] = defaultdict(lambda: 1)
self.PROGRESSIVE_LISTS: Dict[str, List[str]] = {}
self.DOOR_ITEMS_BY_ID: Dict[str, List[str]] = {}
self.FORBIDDEN_DOORS: Set[str] = set()
self.STARTING_INVENTORY: Set[str] = set()
@@ -192,8 +193,9 @@ class WitnessPlayerLogic:
for subset in these_items:
self.BASE_PROGESSION_ITEMS_ACTUALLY_IN_THE_GAME.update(subset)
# Handle door entities (door shuffle)
if entity_hex in self.DOOR_ITEMS_BY_ID:
# If this entity is opened by a door item that exists in the itempool, add that item to its requirements.
# Also, remove any original power requirements this entity might have had.
if entity_hex in self.DOOR_ITEMS_BY_ID and entity_hex not in self.FORBIDDEN_DOORS:
# If this entity is opened by a door item that exists in the itempool, add that item to its requirements.
door_items = frozenset({frozenset([item]) for item in self.DOOR_ITEMS_BY_ID[entity_hex]})
@@ -329,6 +331,10 @@ class WitnessPlayerLogic:
if entity_hex in self.DOOR_ITEMS_BY_ID and item_name in self.DOOR_ITEMS_BY_ID[entity_hex]:
self.DOOR_ITEMS_BY_ID[entity_hex].remove(item_name)
if adj_type == "Forbidden Doors":
entity_hex = line[:7]
self.FORBIDDEN_DOORS.add(entity_hex)
if adj_type == "Starting Inventory":
self.STARTING_INVENTORY.add(line)
@@ -704,7 +710,7 @@ class WitnessPlayerLogic:
self.make_single_adjustment(current_adjustment_type, line)
for entity_id in self.COMPLETELY_DISABLED_ENTITIES:
for entity_id in self.COMPLETELY_DISABLED_ENTITIES | self.FORBIDDEN_DOORS:
if entity_id in self.DOOR_ITEMS_BY_ID:
del self.DOOR_ITEMS_BY_ID[entity_id]