Skip to content
Open
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
16 changes: 16 additions & 0 deletions cb_calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,17 @@ def relax_kong_requirement(requirement):
requirement.add(kong)


def conflicting_kong_requirements(requirement):
"""Determine if there are multiple 'is' kong requirements in a single requirement."""
count = 0
for kong in ["donkey", "diddy", "lanky", "tiny", "chunky"]:
if "is" + kong in requirement:
count += 1
if count >= 2:
return True
return False


def all_kongs_can_use(requirement):
"""Determine if a given requirement requires a specific kong, or can be used by all kongs."""
return requirement.isdisjoint(["isdonkey", "isdiddy", "islanky", "istiny", "ischunky"])
Expand Down Expand Up @@ -526,6 +537,10 @@ def traverse_graph(regions, entry_region):
# print(f"Attempted to use transition from {region.name} to {next_region.name} using requirement {exit_requirement}, but access to the region requires {region_requirement}")
continue

if conflicting_kong_requirements(exit_requirement | region_requirement):
# print(f"Attempted to use transition from {region.name} to {next_region.name} using requirement {exit_requirement}, but this would be a Tag Anywhere transition, since region access requires {region_requirement}")
continue

# If any of those products are new ways to reach next_region, then we do another loop afterwards
if region_requirements[next_region].add(exit_requirement | region_requirement):
# print(f"Found new transition from {region.name} to {next_region.name} using exit requirement {exit_requirement} and region requirement {region_requirement}")
Expand Down Expand Up @@ -560,6 +575,7 @@ def traverse_graph(regions, entry_region):
requirement = region_requirement | {"AllWarps"}
relax_kong_requirement(requirement)
if region_requirements[next_region].add(requirement):
# print(f"Found new transition from {region.name} to {next_region.name} using 'all warps' from {warp1.name} to {warp2.name}")
found_new_requirement = True

# Update any events based on new region requirements
Expand Down
8 changes: 1 addition & 7 deletions requirement_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,9 @@ const requirement_data = {
[Moves.Coconut, Moves.AllWarps],
[Moves.ClimbingCheck, Moves.Coconut, Moves.FactoryTesting],
]),
new Requirement(10, [ // 1 balloon in RandDUpper
[Moves.ClimbingCheck, Moves.Coconut, Moves.AllWarps],
[Moves.ClimbingCheck, Moves.Coconut, Moves.FactoryTesting],
]),
new Requirement(15, [ // 3 bunches in PowerHut
new Requirement(25, [ // 3 bunches in PowerHut; 1 balloon in RandDUpper
[Moves.ClimbingCheck, Moves.Coconut, Moves.AllWarps],
[Moves.ClimbingCheck, Moves.Coconut, Moves.FactoryTesting],
[Moves.Coconut, Moves.IsDiddy, Moves.AllWarps],
[Moves.Coconut, Moves.IsTiny, Moves.AllWarps],
]),
],
"Diddy": [
Expand Down
Loading