diff --git a/worlds/ahit/Items.py b/worlds/ahit/Items.py index c2082c2e33..93b3d2bb9d 100644 --- a/worlds/ahit/Items.py +++ b/worlds/ahit/Items.py @@ -85,9 +85,19 @@ def calculate_yarn_costs(world: "HatInTimeWorld"): max_cost = 0 for i in range(5): - cost: int = world.random.randint(min_yarn_cost, max_yarn_cost) - world.hat_yarn_costs[HatType(i)] = cost - max_cost += cost + precollected: bool = False + hat: HatType = HatType(i) + for item in world.multiworld.precollected_items[world.player]: + if item.name == hat_type_to_item[hat]: + precollected = True + break + + if not precollected: + cost: int = world.random.randint(min_yarn_cost, max_yarn_cost) + world.hat_yarn_costs[hat] = cost + max_cost += cost + else: + world.hat_yarn_costs[hat] = 0 available_yarn: int = world.options.YarnAvailable.value if max_cost > available_yarn: diff --git a/worlds/ahit/Rules.py b/worlds/ahit/Rules.py index 94306b5d27..797a5a71d0 100644 --- a/worlds/ahit/Rules.py +++ b/worlds/ahit/Rules.py @@ -39,6 +39,9 @@ def can_use_hat(state: CollectionState, world: "HatInTimeWorld", hat: HatType) - if world.options.HatItems: return state.has(hat_type_to_item[hat], world.player) + if world.hat_yarn_costs[hat] <= 0: # this means the hat was put into starting inventory + return True + return state.has("Yarn", world.player, get_hat_cost(world, hat)) @@ -52,10 +55,6 @@ def get_hat_cost(world: "HatInTimeWorld", hat: HatType) -> int: return cost -def can_sdj(state: CollectionState, world: "HatInTimeWorld"): - return can_use_hat(state, world, HatType.SPRINT) - - def painting_logic(world: "HatInTimeWorld") -> bool: return bool(world.options.ShuffleSubconPaintings) @@ -358,9 +357,6 @@ def set_specific_rules(world: "HatInTimeWorld"): lambda state: state.has("Time Piece", world.player, 12) and state.has("Time Piece", world.player, world.chapter_timepiece_costs[ChapterIndex.BIRDS])) - add_rule(world.multiworld.get_location("Spaceship - Rumbi Abuse", world.player), - lambda state: state.has("Time Piece", world.player, 4)) - set_mafia_town_rules(world) set_botb_rules(world) set_subcon_rules(world) @@ -500,13 +496,13 @@ def set_hard_rules(world: "HatInTimeWorld"): # SDJ add_rule(world.multiworld.get_location("Subcon Forest - Long Tree Climb Chest", world.player), - lambda state: can_sdj(state, world) and has_paintings(state, world, 2), "or") + lambda state: can_use_hat(state, world, HatType.SPRINT) and has_paintings(state, world, 2), "or") add_rule(world.multiworld.get_location("Subcon Forest - Dweller Platforming Tree B", world.player), - lambda state: has_paintings(state, world, 3) and can_sdj(state, world), "or") + lambda state: has_paintings(state, world, 3) and can_use_hat(state, world, HatType.SPRINT), "or") add_rule(world.multiworld.get_location("Act Completion (Time Rift - Curly Tail Trail)", world.player), - lambda state: can_sdj(state, world), "or") + lambda state: can_use_hat(state, world, HatType.SPRINT), "or") # Hard: Goat Refinery from TIHS with nothing add_rule(world.multiworld.get_location("Alpine Skyline - Goat Refinery", world.player), diff --git a/worlds/ahit/docs/setup_en.md b/worlds/ahit/docs/setup_en.md index fe4157a496..509869fc25 100644 --- a/worlds/ahit/docs/setup_en.md +++ b/worlds/ahit/docs/setup_en.md @@ -6,6 +6,10 @@ - [Archipelago Workshop Mod for A Hat in Time](https://steamcommunity.com/sharedfiles/filedetails/?id=3026842601) +## Optional Software +- [A Hat in Time Archipelago Map Tracker](https://github.com/Mysteryem/ahit-poptracker/releases), for use with [PopTracker](https://github.com/black-sliver/PopTracker/releases) + + ## Instructions 1. Have Steam running. Open the Steam console with this link: [steam://open/console](steam://open/console)