Skip to content

Commit

Permalink
Rewrite traversal reqs thing per Vi's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ScipioWright committed May 18, 2024
1 parent ce9eadb commit d0d13ab
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions worlds/tunic/er_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,27 +474,22 @@ def update_reachable_regions(connected_regions: Set[str], traversal_reqs: Dict[s
met_traversal_reqs = False
if len(req_lists) == 0:
met_traversal_reqs = True
# loop through each set of possible requirements
# loop through each set of possible requirements, with a fancy for else loop
for reqs in req_lists:
if len(reqs) == 0:
met_traversal_reqs = True
for req in reqs:
if req == "Hyperdash":
if not has_laurels:
break
elif req == "NMG":
if not logic:
break
elif req == "UR":
if logic < 2:
break
elif req not in connected_regions:
break
else:
met_count = 0
for req in reqs:
# will need to change this if item plando gets evaluated earlier
if req == "Hyperdash" and has_laurels:
met_count += 1
if req == "NMG" and logic:
met_count += 1
if req == "UR" and logic == 2:
met_count += 1
# check if we have the regions required for traversal
if req in connected_regions:
met_count += 1
if met_count == len(reqs):
met_traversal_reqs = True
# if we met one set of requirements, no need to check the next set
if met_traversal_reqs:
met_traversal_reqs = True
break
if met_traversal_reqs:
connected_regions.add(destination)
Expand Down

0 comments on commit d0d13ab

Please sign in to comment.