From c5b811336ffbead131197b57c6a48ba64b9d15c0 Mon Sep 17 00:00:00 2001 From: CookieCat Date: Sat, 9 Sep 2023 18:23:33 -0400 Subject: [PATCH] Fixes --- worlds/ahit/DeathWishLocations.py | 25 +++++++++++++++++- worlds/ahit/DeathWishRules.py | 42 ++++++++++++++++++++----------- worlds/ahit/Options.py | 3 +-- worlds/ahit/Regions.py | 22 ++++++++-------- worlds/ahit/__init__.py | 7 +++++- 5 files changed, 71 insertions(+), 28 deletions(-) diff --git a/worlds/ahit/DeathWishLocations.py b/worlds/ahit/DeathWishLocations.py index b764690dc5..0fa4884b13 100644 --- a/worlds/ahit/DeathWishLocations.py +++ b/worlds/ahit/DeathWishLocations.py @@ -1,6 +1,7 @@ from .Locations import HatInTimeLocation, death_wishes +from .Items import HatInTimeItem from .Regions import connect_regions, create_region -from BaseClasses import Region, LocationProgressType +from BaseClasses import Region, LocationProgressType, ItemClassification from worlds.generic.Rules import add_rule from worlds.AutoWorld import World from typing import List @@ -202,6 +203,17 @@ def create_dw_regions(world: World): loc_id = death_wishes[name] main_objective = HatInTimeLocation(world.player, f"{name} - Main Objective", loc_id, dw) full_clear = HatInTimeLocation(world.player, f"{name} - All Clear", loc_id + 1, dw) + main_stamp = HatInTimeLocation(world.player, f"Main Stamp - {name}", None, dw) + bonus_stamps = HatInTimeLocation(world.player, f"Bonus Stamps - {name}", None, dw) + main_stamp.show_in_spoiler = False + bonus_stamps.show_in_spoiler = False + dw.locations.append(main_stamp) + dw.locations.append(bonus_stamps) + + main_stamp.place_locked_item(HatInTimeItem(f"1 Stamp - {name}", + ItemClassification.progression, None, world.player)) + bonus_stamps.place_locked_item(HatInTimeItem(f"2 Stamps - {name}", + ItemClassification.progression, None, world.player)) if name in world.get_excluded_bonuses(): main_objective.progress_type = LocationProgressType.EXCLUDED @@ -229,6 +241,17 @@ def create_dw_regions(world: World): main_objective = HatInTimeLocation(world.player, f"{key} - Main Objective", loc_id, dw) full_clear = HatInTimeLocation(world.player, f"{key} - All Clear", loc_id+1, dw) + main_stamp = HatInTimeLocation(world.player, f"Main Stamp - {key}", None, dw) + bonus_stamps = HatInTimeLocation(world.player, f"Bonus Stamps - {key}", None, dw) + main_stamp.show_in_spoiler = False + bonus_stamps.show_in_spoiler = False + dw.locations.append(main_stamp) + dw.locations.append(bonus_stamps) + + main_stamp.place_locked_item(HatInTimeItem(f"1 Stamp - {key}", + ItemClassification.progression, None, world.player)) + bonus_stamps.place_locked_item(HatInTimeItem(f"2 Stamps - {key}", + ItemClassification.progression, None, world.player)) if key in world.get_excluded_bonuses(): main_objective.progress_type = LocationProgressType.EXCLUDED diff --git a/worlds/ahit/DeathWishRules.py b/worlds/ahit/DeathWishRules.py index 8b51e9be03..be27bc37cc 100644 --- a/worlds/ahit/DeathWishRules.py +++ b/worlds/ahit/DeathWishRules.py @@ -83,7 +83,7 @@ dw_stamp_costs = { def set_dw_rules(world: World): if "Snatcher's Hit List" not in world.get_excluded_dws() \ or "Camera Tourist" not in world.get_excluded_dws(): - create_enemy_events(world) + set_enemy_rules(world) dw_list: List[str] = [] if world.multiworld.DWShuffle[world.player].value > 0: @@ -100,6 +100,8 @@ def set_dw_rules(world: World): temp_list: List[Location] = [] main_objective = world.multiworld.get_location(f"{name} - Main Objective", world.player) full_clear = world.multiworld.get_location(f"{name} - All Clear", world.player) + main_stamp = world.multiworld.get_location(f"Main Stamp - {name}", world.player) + bonus_stamps = world.multiworld.get_location(f"Bonus Stamps - {name}", world.player) temp_list.append(main_objective) temp_list.append(full_clear) @@ -114,19 +116,6 @@ def set_dw_rules(world: World): full_clear.place_locked_item(HatInTimeItem("Nothing", ItemClassification.filler, None, world.player)) full_clear.show_in_spoiler = False - # Stamps are event locations - main_stamp = HatInTimeLocation(world.player, f"Main Stamp - {name}", None, dw) - bonus_stamps = HatInTimeLocation(world.player, f"Bonus Stamps - {name}", None, dw) - main_stamp.show_in_spoiler = False - bonus_stamps.show_in_spoiler = False - dw.locations.append(main_stamp) - dw.locations.append(bonus_stamps) - - main_stamp.place_locked_item(HatInTimeItem(f"1 Stamp - {name}", - ItemClassification.progression, None, world.player)) - bonus_stamps.place_locked_item(HatInTimeItem(f"2 Stamps - {name}", - ItemClassification.progression, None, world.player)) - # No need for rules if excluded - stamps will be auto-granted if world.is_dw_excluded(name): continue @@ -394,6 +383,31 @@ def create_enemy_events(world: World): region.locations.append(event) event.show_in_spoiler = False + +def set_enemy_rules(world: World): + no_tourist = "Camera Tourist" in world.get_excluded_dws() or "Camera Tourist" in world.get_excluded_bonuses() + + for enemy, regions in hit_list.items(): + if no_tourist and enemy in bosses: + continue + + for area in regions: + if (area == "Bon Voyage!" or area == "Time Rift - Deep Sea") and not world.is_dlc1(): + continue + + if area == "Time Rift - Tour" and (not world.is_dlc1() + or world.multiworld.ExcludeTour[world.player].value > 0): + continue + + if area == "Bluefin Tunnel" and not world.is_dlc2(): + continue + + if world.multiworld.DWShuffle[world.player].value > 0 and area in death_wishes \ + and area not in world.get_dw_shuffle(): + continue + + event = world.multiworld.get_location(f"{enemy} - {area}", world.player) + if enemy == "Toxic Flower": add_rule(event, lambda state: can_use_hookshot(state, world)) diff --git a/worlds/ahit/Options.py b/worlds/ahit/Options.py index 2356302913..9edb7e3ab5 100644 --- a/worlds/ahit/Options.py +++ b/worlds/ahit/Options.py @@ -63,7 +63,6 @@ def adjust_options(world: World): world.multiworld.LogicDifficulty[world.player].value = 0 world.multiworld.KnowledgeChecks[world.player].value = 0 world.multiworld.DWTimePieceRequirement[world.player].value = 0 - world.multiworld.progression_balancing[world.player].value = 0 def get_total_time_pieces(world: World) -> int: @@ -308,7 +307,7 @@ class MinExtraYarn(Range): For example, if this option's value is 10, and the total yarn needed to craft all hats is 40, there must be at least 50 yarn in the pool.""" display_name = "Max Extra Yarn" - range_start = 0 + range_start = 5 range_end = 15 default = 10 diff --git a/worlds/ahit/Regions.py b/worlds/ahit/Regions.py index 4dc0e3acec..62e089e3cc 100644 --- a/worlds/ahit/Regions.py +++ b/worlds/ahit/Regions.py @@ -254,16 +254,18 @@ blacklisted_acts = { # Blacklisted act shuffle combinations to help prevent impossible layouts. Mostly for free roam acts. blacklisted_combos = { - "The Illness has Spread": ["Nyakuza Free Roam", "Alpine Free Roam"], - "Rush Hour": ["Nyakuza Free Roam", "Alpine Free Roam"], - "Time Rift - The Owl Express": ["Alpine Free Roam", "Nyakuza Free Roam", "Bon Voyage!"], - "Time Rift - The Moon": ["Alpine Free Roam", "Nyakuza Free Roam"], - "Time Rift - Dead Bird Studio": ["Alpine Free Roam", "Nyakuza Free Roam"], - "Time Rift - Curly Tail Trail": ["Nyakuza Free Roam"], - "Time Rift - The Twilight Bell": ["Nyakuza Free Roam"], - "Time Rift - Alpine Skyline": ["Nyakuza Free Roam"], - "Time Rift - Rumbi Factory": ["Alpine Free Roam"], - "Time Rift - Deep Sea": ["Alpine Free Roam", "Nyakuza Free Roam"], + "The Illness has Spread": ["Nyakuza Free Roam", "Alpine Free Roam", "Contractual Obligations"], + "Rush Hour": ["Nyakuza Free Roam", "Alpine Free Roam", "Contractual Obligations"], + "Time Rift - The Owl Express": ["Alpine Free Roam", "Nyakuza Free Roam", "Bon Voyage!", + "Contractual Obligations"], + + "Time Rift - The Moon": ["Alpine Free Roam", "Nyakuza Free Roam", "Contractual Obligations"], + "Time Rift - Dead Bird Studio": ["Alpine Free Roam", "Nyakuza Free Roam", "Contractual Obligations"], + "Time Rift - Curly Tail Trail": ["Nyakuza Free Roam", "Contractual Obligations"], + "Time Rift - The Twilight Bell": ["Nyakuza Free Roam", "Contractual Obligations"], + "Time Rift - Alpine Skyline": ["Nyakuza Free Roam", "Contractual Obligations"], + "Time Rift - Rumbi Factory": ["Alpine Free Roam", "Contractual Obligations"], + "Time Rift - Deep Sea": ["Alpine Free Roam", "Nyakuza Free Roam", "Contractual Obligations"], } diff --git a/worlds/ahit/__init__.py b/worlds/ahit/__init__.py index 20a63d455a..9c251e902c 100644 --- a/worlds/ahit/__init__.py +++ b/worlds/ahit/__init__.py @@ -6,7 +6,7 @@ from .Rules import set_rules from .Options import ahit_options, slot_data_options, adjust_options from .Types import HatType, ChapterIndex from .DeathWishLocations import create_dw_regions, dw_classes, death_wishes -from .DeathWishRules import set_dw_rules +from .DeathWishRules import set_dw_rules, create_enemy_events from worlds.AutoWorld import World, WebWorld from typing import List, Dict, TextIO @@ -18,6 +18,7 @@ excluded_bonuses: Dict[int, List[str]] = {} dw_shuffle: Dict[int, List[str]] = {} nyakuza_thug_items: Dict[int, Dict[str, int]] = {} badge_seller_count: Dict[int, int] = {} +badge_seller_count: Dict[int, int] = {} class AWebInTime(WebWorld): @@ -89,6 +90,10 @@ class HatInTimeWorld(World): return create_events(self) + if self.is_dw(): + if "Snatcher's Hit List" not in self.get_excluded_dws() \ + or "Camera Tourist" not in self.get_excluded_dws(): + create_enemy_events(self) # place default contract locations if contract shuffle is off so logic can still utilize them if self.multiworld.ShuffleActContracts[self.player].value == 0: