Skip to content

Commit

Permalink
Lengthy debugging vs one >= boi
Browse files Browse the repository at this point in the history
  • Loading branch information
NewSoupVi committed Nov 5, 2023
1 parent 6cf527f commit 4afe4a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions worlds/witness/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
]


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

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

laser_lambdas.append(has_laser_lambda)

return lambda state: sum(laser_lambda(state) for laser_lambda in laser_lambdas) > amount
return lambda state: sum(laser_lambda(state) for laser_lambda in laser_lambdas) >= amount


def _can_solve_panel(panel: str, world: "WitnessWorld", player: int, player_logic: WitnessPlayerLogic,
Expand Down

0 comments on commit 4afe4a2

Please sign in to comment.