The Witness: Fix logic error with Symmetry Island Upper in doors: panels (broken seed reported) (#2565)

Door entities think they can be solved without any other panels needing to be solved.

Usually, this is true, because they no longer need to be "powered on" by a previous panel.
However, there are some entities that need another entity to be powered/solved for a different reason.
In this case, Symmetry Island Lower Left set opens the latches that block your ability to solve the panel. The panel itself actually starts on. Playing doors: panels does not change this, unlike usually where dependencies like this get removed by playing that mode.

In the long term, I want to somehow be able to "mark" dependencies as "environmental" or "power based" so I can distinguish them properly.
This commit is contained in:
NewSoupVi 2023-12-06 18:17:27 +01:00 committed by GitHub
parent a861ede8b3
commit 229a263131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -70,15 +70,19 @@ class WitnessPlayerLogic:
for items_option in these_items:
all_options.add(items_option.union(dependentItem))
# 0x28A0D depends on another entity for *non-power* reasons -> This dependency needs to be preserved...
if panel_hex != "0x28A0D":
return frozenset(all_options)
# ...except in Expert, where that dependency doesn't exist, but now there *is* a power dependency.
# 0x28A0D depends on another entity for *non-power* reasons -> This dependency needs to be preserved,
# except in Expert, where that dependency doesn't exist, but now there *is* a power dependency.
# In the future, it would be wise to make a distinction between "power dependencies" and other dependencies.
if any("0x28998" in option for option in these_panels):
return frozenset(all_options)
if panel_hex == "0x28A0D" and not any("0x28998" in option for option in these_panels):
these_items = all_options
these_items = all_options
# Another dependency that is not power-based: The Symmetry Island Upper Panel latches
elif panel_hex == 0x18269:
these_items = all_options
# For any other door entity, we just return a set with the item that opens it & disregard power dependencies
else:
return frozenset(all_options)
disabled_eps = {eHex for eHex in self.COMPLETELY_DISABLED_ENTITIES
if self.REFERENCE_LOGIC.ENTITIES_BY_HEX[eHex]["entityType"] == "EP"}