Skip to content

Commit

Permalink
[RoR2] Classic mode logic fix (ArchipelagoMW#1775)
Browse files Browse the repository at this point in the history
  • Loading branch information
kindasneaki authored Apr 29, 2023
1 parent 41b5948 commit 91b60f2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions worlds/ror2/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ def set_rules(multiworld: MultiWorld, player: int) -> None:
if multiworld.goal[player] == "classic":
# classic mode
if divisions:
for i in range(1, divisions): # since divisions is the floor of total_locations / 25
event_loc = multiworld.get_location(f"Pickup{i * event_location_step}", player)
set_rule(event_loc,
lambda state, i=i: state.can_reach(f"ItemPickup{i * event_location_step - 1}", "Location", player))
for n in range(i * event_location_step, (i + 1) * event_location_step): # we want to create a rule for each of the 25 locations per division
for i in range(1, divisions + 1): # since divisions is the floor of total_locations / 25
if i * event_location_step != total_locations:
event_loc = multiworld.get_location(f"Pickup{i * event_location_step}", player)
set_rule(event_loc,
lambda state, i=i: state.can_reach(f"ItemPickup{i * event_location_step - 1}", "Location", player))
for n in range(i * event_location_step, (i + 1) * event_location_step + 1): # we want to create a rule for each of the 25 locations per division
if n > total_locations:
break
if n == i * event_location_step:
set_rule(multiworld.get_location(f"ItemPickup{n}", player),
lambda state, event_item=event_loc.item.name: state.has(event_item, player))
else:
set_rule(multiworld.get_location(f"ItemPickup{n}", player),
lambda state, n=n: state.can_reach(f"ItemPickup{n - 1}", "Location", player))
for i in range(divisions * event_location_step, total_locations+1):
set_rule(multiworld.get_location(f"ItemPickup{i}", player),
lambda state, i=i: state.can_reach(f"ItemPickup{i - 1}", "Location", player))
set_rule(multiworld.get_location("Victory", player),
lambda state: state.can_reach(f"ItemPickup{total_locations}", "Location", player))
if total_revivals or multiworld.start_with_revive[player].value:
Expand Down

0 comments on commit 91b60f2

Please sign in to comment.