This commit is contained in:
CookieCat
2023-08-29 12:38:29 -04:00
parent 1fd2a21e5b
commit b5475ac242
5 changed files with 21 additions and 10 deletions

View File

@@ -34,6 +34,9 @@ def get_total_time_pieces(world: World) -> int:
if world.multiworld.EnableDLC1[world.player].value > 0:
count += 6
if world.multiworld.EnableDLC2[world.player].value > 0:
count += 10
return min(40+world.multiworld.MaxExtraTimePieces[world.player].value, count)

View File

@@ -33,9 +33,15 @@ def adjust_options(world: World):
if world.multiworld.HighestChapterCost[world.player].value > total_tps-5:
world.multiworld.HighestChapterCost[world.player].value = min(45, total_tps-5)
if world.multiworld.LowestChapterCost[world.player].value > total_tps-5:
world.multiworld.LowestChapterCost[world.player].value = min(45, total_tps-5)
if world.multiworld.FinalChapterMaxCost[world.player].value > total_tps:
world.multiworld.FinalChapterMaxCost[world.player].value = min(50, total_tps)
if world.multiworld.FinalChapterMinCost[world.player].value > total_tps:
world.multiworld.FinalChapterMinCost[world.player].value = min(50, total_tps-5)
# Don't allow Rush Hour goal if DLC2 content is disabled
if world.multiworld.EndGoal[world.player].value == 2 and world.multiworld.EnableDLC2[world.player].value == 0:
world.multiworld.EndGoal[world.player].value = 1

View File

@@ -152,7 +152,7 @@ rift_access_regions = {
"Time Rift - Tour": ["Time's End"],
"Time Rift - Balcony": ["Cruise Ship"],
"Time Rift - Deep Sea": ["Cruise Ship"],
"Time Rift - Deep Sea": ["Bon Voyage!"],
"Time Rift - Rumbi Factory": ["Nyakuza Free Roam"],
}
@@ -481,11 +481,6 @@ def randomize_act_entrances(world: World):
candidate_list.append(region)
break
if world.multiworld.NoFreeRoamFinale[world.player].value > 0 and "Free Roam" in candidate.name:
# CTR entrance isn't a finale, but has a fuck ton of unlock requirements
if region.name in chapter_finales or region.name == "Cheating the Race":
continue
if region.name == "Rush Hour":
if world.multiworld.EndGoal[world.player].value == 2 or \
world.multiworld.VanillaMetro[world.player].value == 2:
@@ -537,6 +532,12 @@ def randomize_act_entrances(world: World):
if region.name == "Rush Hour" and candidate.name == "Nyakuza Free Roam":
continue
# CTR entrance and Tour aren't a finale, but have a fuck ton of unlock requirements
if world.multiworld.NoFreeRoamFinale[world.player].value > 0 and "Free Roam" in candidate.name:
if region.name in chapter_finales or region.name == "Cheating the Race" \
or world.multiworld.EndGoal[world.player].value == 1 and region.name == "Time Rift - Tour":
continue
if region.name in rift_access_regions and candidate.name in rift_access_regions[region.name]:
continue

View File

@@ -32,17 +32,17 @@ act_connections = {
def can_use_hat(state: CollectionState, world: World, hat: HatType) -> bool:
return get_remaining_hat_cost(state, world, hat) <= 0
return state.count("Yarn", world.player) >= get_hat_cost(world, hat)
def get_remaining_hat_cost(state: CollectionState, world: World, hat: HatType) -> int:
def get_hat_cost(world: World, hat: HatType) -> int:
cost: int = 0
for h in world.get_hat_craft_order():
cost += world.get_hat_yarn_costs().get(h)
if h == hat:
break
return max(cost - state.count("Yarn", world.player), 0)
return cost
def can_sdj(state: CollectionState, world: World):

View File

@@ -48,7 +48,8 @@ class HatInTimeWorld(World):
start_chapter: int = self.multiworld.StartingChapter[self.player].value
if start_chapter == 4 or start_chapter == 3:
if self.multiworld.ActRandomizer[self.player].value == 0:
if self.multiworld.ActRandomizer[self.player].value == 0 \
or self.multiworld.VanillaAlpine[self.player].value > 0:
if start_chapter == 4:
self.multiworld.push_precollected(self.create_item("Hookshot Badge"))