[RoR2] Classic mode logic fix ()

This commit is contained in:
kindasneaki 2023-04-29 01:07:42 -06:00 committed by GitHub
parent 41b59488e3
commit 91b60f2e21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 8 deletions
worlds/ror2

View File

@ -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: