Skip to content

The Witness: Add "Town Desert Laser Redirect Control (Panel)" as an item #2669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions worlds/witness/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,13 @@ class ShufflePostgame(Toggle):


class VictoryCondition(Choice):
"""Change the victory condition from the original game's ending (elevator) to beating the Challenge
or solving the mountaintop box, either using the short solution
(7 lasers or whatever you've changed it to) or the long solution (11 lasers or whatever you've changed it to)."""
"""Set the victory condition for this world.
Elevator: Start the elevator at the bottom of the mountain (requires Mountain Lasers).
Challenge: Beat the secret Challenge (requires Challenge Lasers).
Mountain Box Short: Input the short solution to the Mountaintop Box (requires Mountain Lasers).
Mountain Box Long: Input the long solution to the Mountaintop Box (requires Challenge Lasers).
It is important to note that while the Mountain Box requires Desert Laser to be redirected in Town for that laser
to count, the laser locks on the Elevator and Challenge Timer panels do not."""
display_name = "Victory Condition"
option_elevator = 0
option_challenge = 1
Expand Down
4 changes: 3 additions & 1 deletion worlds/witness/WitnessItems.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Doors:
1167 - Town Maze Rooftop Bridge (Panel) - 0x2896A
1169 - Town Windmill Entry (Panel) - 0x17F5F
1172 - Town Cargo Box Entry (Panel) - 0x0A0C8
1173 - Town Desert Laser Redirect Control (Panel) - 0x09F98
1182 - Windmill Turn Control (Panel) - 0x17D02
1184 - Theater Entry (Panel) - 0x17F89
1185 - Theater Video Input (Panel) - 0x00815
Expand Down Expand Up @@ -234,7 +235,7 @@ Doors:
2000 - Desert Control Panels - 0x09FAA,0x1C2DF,0x1831E,0x1C260,0x1831C,0x1C2F3,0x1831D,0x1C2B1,0x1831B
2005 - Quarry Stoneworks Control Panels - 0x03678,0x03676,0x03679,0x03675
2010 - Quarry Boathouse Control Panels - 0x03852,0x03858,0x275FA
2015 - Town Control Panels - 0x2896A,0x334D8
2015 - Town Control Panels - 0x2896A,0x334D8,0x09F98
2020 - Windmill & Theater Control Panels - 0x17D02,0x00815
2025 - Bunker Control Panels - 0x34BC5,0x34BC6,0x0A079
2030 - Swamp Control Panels - 0x00609,0x18488,0x181F5,0x17E2B,0x17C0A,0x17E07
Expand All @@ -250,6 +251,7 @@ Doors:
2125 - Monastery Panels - 0x09D9B,0x00C92,0x00B10
2130 - Town Church & RGB House Panels - 0x28998,0x28A0D,0x334D8
2135 - Town Maze Panels - 0x2896A,0x28A79
2137 - Town Dockside House Panels - 0x0A0C8,0x09F98
2140 - Windmill & Theater Panels - 0x17D02,0x00815,0x17F5F,0x17F89,0x0A168,0x33AB2
2145 - Treehouse Panels - 0x0A182,0x0288C,0x02886,0x2700B,0x17CBC,0x037FF
2150 - Bunker Panels - 0x34BC5,0x34BC6,0x0A079,0x0A099,0x17C2E
Expand Down
6 changes: 3 additions & 3 deletions worlds/witness/WitnessLogic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ Town (Town) - Main Island - True - The Ocean - 0x0A054 - Town Maze Rooftop - 0x2
158218 - 0x0A054 (Boat Spawn) - 0x17CA6 | 0x17CDF | 0x09DB8 | 0x17C95 - Boat
158219 - 0x0A0C8 (Cargo Box Entry Panel) - True - Black/White Squares & Shapers
Door - 0x0A0C9 (Cargo Box Entry) - 0x0A0C8
158707 - 0x09F98 (Desert Laser Redirect) - True - True
158707 - 0x09F98 (Desert Laser Redirect Control) - True - True
158220 - 0x18590 (Transparent) - True - Symmetry
158221 - 0x28AE3 (Vines) - 0x18590 - True
158222 - 0x28938 (Apple Tree) - 0x28AE3 - True
Expand Down Expand Up @@ -895,9 +895,9 @@ Mountainside Vault (Mountainside):

Mountaintop (Mountaintop) - Mountain Top Layer - 0x17C34:
158405 - 0x0042D (River Shape) - True - True
158406 - 0x09F7F (Box Short) - 7 Lasers - True
158406 - 0x09F7F (Box Short) - 7 Lasers + Redirect - True
158407 - 0x17C34 (Mountain Entry Panel) - 0x09F7F - Stars & Black/White Squares & Stars + Same Colored Symbol
158800 - 0xFFF00 (Box Long) - 11 Lasers & 0x17C34 - True
158800 - 0xFFF00 (Box Long) - 11 Lasers + Redirect & 0x17C34 - True
159300 - 0x001A3 (River Shape EP) - True - True
159320 - 0x3370E (Arch Black EP) - True - True
159324 - 0x336C8 (Arch White Right EP) - True - True
Expand Down
6 changes: 3 additions & 3 deletions worlds/witness/WitnessLogicExpert.txt
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ Town (Town) - Main Island - True - The Ocean - 0x0A054 - Town Maze Rooftop - 0x2
158218 - 0x0A054 (Boat Spawn) - 0x17CA6 | 0x17CDF | 0x09DB8 | 0x17C95 - Boat
158219 - 0x0A0C8 (Cargo Box Entry Panel) - True - Squares & Black/White Squares & Shapers & Triangles
Door - 0x0A0C9 (Cargo Box Entry) - 0x0A0C8
158707 - 0x09F98 (Desert Laser Redirect) - True - True
158707 - 0x09F98 (Desert Laser Redirect Control) - True - True
158220 - 0x18590 (Transparent) - True - Symmetry
158221 - 0x28AE3 (Vines) - 0x18590 - True
158222 - 0x28938 (Apple Tree) - 0x28AE3 - True
Expand Down Expand Up @@ -895,9 +895,9 @@ Mountainside Vault (Mountainside):

Mountaintop (Mountaintop) - Mountain Top Layer - 0x17C34:
158405 - 0x0042D (River Shape) - True - True
158406 - 0x09F7F (Box Short) - 7 Lasers - True
158406 - 0x09F7F (Box Short) - 7 Lasers + Redirect - True
158407 - 0x17C34 (Mountain Entry Panel) - 0x09F7F - Stars & Black/White Squares & Stars + Same Colored Symbol & Triangles
158800 - 0xFFF00 (Box Long) - 11 Lasers & 0x17C34 - True
158800 - 0xFFF00 (Box Long) - 11 Lasers + Redirect & 0x17C34 - True
159300 - 0x001A3 (River Shape EP) - True - True
159320 - 0x3370E (Arch Black EP) - True - True
159324 - 0x336C8 (Arch White Right EP) - True - True
Expand Down
6 changes: 3 additions & 3 deletions worlds/witness/WitnessLogicVanilla.txt
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ Town (Town) - Main Island - True - The Ocean - 0x0A054 - Town Maze Rooftop - 0x2
158218 - 0x0A054 (Boat Spawn) - 0x17CA6 | 0x17CDF | 0x09DB8 | 0x17C95 - Boat
158219 - 0x0A0C8 (Cargo Box Entry Panel) - True - Black/White Squares & Shapers
Door - 0x0A0C9 (Cargo Box Entry) - 0x0A0C8
158707 - 0x09F98 (Desert Laser Redirect) - True - True
158707 - 0x09F98 (Desert Laser Redirect Control) - True - True
158220 - 0x18590 (Transparent) - True - Symmetry
158221 - 0x28AE3 (Vines) - 0x18590 - True
158222 - 0x28938 (Apple Tree) - 0x28AE3 - True
Expand Down Expand Up @@ -895,9 +895,9 @@ Mountainside Vault (Mountainside):

Mountaintop (Mountaintop) - Mountain Top Layer - 0x17C34:
158405 - 0x0042D (River Shape) - True - True
158406 - 0x09F7F (Box Short) - 7 Lasers - True
158406 - 0x09F7F (Box Short) - 7 Lasers + Redirect - True
158407 - 0x17C34 (Mountain Entry Panel) - 0x09F7F - Black/White Squares
158800 - 0xFFF00 (Box Long) - 11 Lasers & 0x17C34 - True
158800 - 0xFFF00 (Box Long) - 11 Lasers + Redirect & 0x17C34 - True
159300 - 0x001A3 (River Shape EP) - True - True
159320 - 0x3370E (Arch Black EP) - True - True
159324 - 0x336C8 (Arch White Right EP) - True - True
Expand Down
3 changes: 2 additions & 1 deletion worlds/witness/player_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def reduce_req_within_region(self, panel_hex: str) -> FrozenSet[FrozenSet[str]]:

if option_entity in self.EVENT_NAMES_BY_HEX:
new_items = frozenset({frozenset([option_entity])})
elif option_entity in {"7 Lasers", "11 Lasers", "PP2 Weirdness", "Theater to Tunnels"}:
elif option_entity in {"7 Lasers", "11 Lasers", "7 Lasers + Redirect", "11 Lasers + Redirect",
"PP2 Weirdness", "Theater to Tunnels"}:
new_items = frozenset({frozenset([option_entity])})
else:
new_items = self.reduce_req_within_region(option_entity)
Expand Down
19 changes: 13 additions & 6 deletions worlds/witness/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
]


def _has_laser(laser_hex: str, world: "WitnessWorld", player: int) -> Callable[[CollectionState], bool]:
if laser_hex == "0x012FB":
def _has_laser(laser_hex: str, world: "WitnessWorld", player: int,
redirect_required: bool) -> Callable[[CollectionState], bool]:
if laser_hex == "0x012FB" and redirect_required:
return lambda state: (
_can_solve_panel(laser_hex, world, world.player, world.player_logic, world.locat)(state)
and state.has("Desert Laser Redirection", player)
Expand All @@ -39,11 +40,11 @@ def _has_laser(laser_hex: str, world: "WitnessWorld", player: int) -> Callable[[
return _can_solve_panel(laser_hex, world, world.player, world.player_logic, world.locat)


def _has_lasers(amount: int, world: "WitnessWorld") -> Callable[[CollectionState], bool]:
def _has_lasers(amount: int, world: "WitnessWorld", redirect_required: bool) -> Callable[[CollectionState], bool]:
laser_lambdas = []

for laser_hex in laser_hexes:
has_laser_lambda = _has_laser(laser_hex, world, world.player)
has_laser_lambda = _has_laser(laser_hex, world, world.player, redirect_required)

laser_lambdas.append(has_laser_lambda)

Expand Down Expand Up @@ -155,10 +156,16 @@ def _has_item(item: str, world: "WitnessWorld", player: int,
return lambda state: state.can_reach(item, "Region", player)
if item == "7 Lasers":
laser_req = world.options.mountain_lasers.value
return _has_lasers(laser_req, world)
return _has_lasers(laser_req, world, False)
if item == "7 Lasers + Redirect":
laser_req = world.options.mountain_lasers.value
return _has_lasers(laser_req, world, True)
if item == "11 Lasers":
laser_req = world.options.challenge_lasers.value
return _has_lasers(laser_req, world)
return _has_lasers(laser_req, world, False)
if item == "11 Lasers + Redirect":
laser_req = world.options.challenge_lasers.value
return _has_lasers(laser_req, world, True)
elif item == "PP2 Weirdness":
return lambda state: _can_do_expert_pp2(state, world)
elif item == "Theater to Tunnels":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Quarry Boathouse Hook Control (Panel)
Monastery Shutters Control (Panel)
Town Maze Rooftop Bridge (Panel)
Town RGB Control (Panel)
Town Desert Laser Redirect Control (Panel)
Windmill Turn Control (Panel)
Theater Video Input (Panel)
Bunker Drop-Down Door Controls (Panel)
Expand Down
2 changes: 1 addition & 1 deletion worlds/witness/settings/Door_Shuffle/Simple_Panels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Monastery Panels
Town Church & RGB House Panels
Town Maze Panels
Windmill & Theater Panels
Town Cargo Box Entry (Panel)
Town Dockside House Panels
Treehouse Panels
Bunker Panels
Swamp Panels
Expand Down
1 change: 0 additions & 1 deletion worlds/witness/static_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def read_logic_file(self, lines):
"Laser",
"Laser Hedges",
"Laser Pressure Plates",
"Desert Laser Redirect"
}
is_vault_or_video = "Vault" in entity_name or "Video" in entity_name

Expand Down