From 04b48129161c8284fc55123cc1516782f92afbcd Mon Sep 17 00:00:00 2001 From: gaithern Date: Wed, 24 Apr 2024 21:14:17 -0500 Subject: [PATCH] Fixes for PR --- worlds/kh1/Items.py | 4 ++-- worlds/kh1/Rules.py | 15 +++++++++------ worlds/kh1/__init__.py | 25 ++++++++++++++----------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/worlds/kh1/Items.py b/worlds/kh1/Items.py index 638b38ff1516..fa93045c9960 100644 --- a/worlds/kh1/Items.py +++ b/worlds/kh1/Items.py @@ -239,8 +239,8 @@ def get_items_by_category(category: str, disclude: list) -> Dict[str, KH1ItemDat #"Crystal Trident": KH1ItemData("Key", code = 264_1210, classification = ItemClassification.progression, max_quantity = 1, weight = 10), "Postcard": KH1ItemData("Key", code = 264_1211, classification = ItemClassification.progression, max_quantity = 3, weight = 10), #"Torn Page 1": KH1ItemData("Key", code = 264_1212, classification = ItemClassification.progression, max_quantity = 1, weight = 10), - "Torn Page 2": KH1ItemData("HAW", code = 264_1213, classification = ItemClassification.progression, max_quantity = 1, weight = 10), - "Torn Page 3": KH1ItemData("HAW", code = 264_1214, classification = ItemClassification.progression, max_quantity = 1, weight = 10), + "Torn Page 2": KH1ItemData("Torn Pages", code = 264_1213, classification = ItemClassification.progression, max_quantity = 1, weight = 10), + "Torn Page 3": KH1ItemData("Torn Pages", code = 264_1214, classification = ItemClassification.progression, max_quantity = 1, weight = 10), #"Torn Page 4": KH1ItemData("Key", code = 264_1215, classification = ItemClassification.progression, max_quantity = 1, weight = 10), #"Torn Page 5": KH1ItemData("Key", code = 264_1216, classification = ItemClassification.progression, max_quantity = 1, weight = 10), "Slide 1": KH1ItemData("Key", code = 264_1217, classification = ItemClassification.progression, max_quantity = 1, weight = 10), diff --git a/worlds/kh1/Rules.py b/worlds/kh1/Rules.py index 439a5947ebe1..b346bdd013d8 100644 --- a/worlds/kh1/Rules.py +++ b/worlds/kh1/Rules.py @@ -37,13 +37,16 @@ def has_postcards(state: CollectionState, player: int, postcards_required: int) return postcards_available >= postcards_required def has_puppies(state: CollectionState, player: int, puppies_required: int) -> bool: + puppies_available = 0 + for i in range(1,100): + if state.has("Puppy " + str(i).rjust(2,"0"), player): + puppies_available = puppies_available + 1 + for i in range(1,34): + if state.has("Puppies " + str(3*(i-1)+1).rjust(2, "0") + "-" + str(3*(i-1)+3).rjust(2, "0"), player): + puppies_available = puppies_available + 3 if state.has("All Puppies", player): - return True - if state.has_group("Puppies TRP", player, -(puppies_required//-3)): - return True - if state.has_group("Puppies IND", player, puppies_required): - return True - return False + puppies_available = puppies_available + 99 + return puppies_available >= puppies_required def has_torn_pages(state: CollectionState, player: int, pages_required: int) -> bool: pages_available = 0 diff --git a/worlds/kh1/__init__.py b/worlds/kh1/__init__.py index 8e31f3b28b3c..0079396ffeb0 100644 --- a/worlds/kh1/__init__.py +++ b/worlds/kh1/__init__.py @@ -90,24 +90,27 @@ def create_items(self): total_locations = total_locations - 5 elif self.options.goal.current_key != "final_ansem" and self.options.require_final_ansem: total_locations = total_locations - 1 - non_filler_item_categories = ["Key", "Magic", "Worlds", "Trinities", "Cups", "Summons", "Abilities", "Shared Abilities", "Keyblades", "Accessory", "Weapons"] - if self.options.puppies == "full": - non_filler_item_categories.append("Puppies ALL") - if self.options.puppies == "triplets": - non_filler_item_categories.append("Puppies TRP") - if self.options.puppies == "individual": - non_filler_item_categories.append("Puppies IND") - if self.options.atlantica: - non_filler_item_categories.append("AL") + non_filler_item_categories = ["Key", "Magic", "Worlds", "Trinities", "Cups", "Summons", "Abilities", "Shared Abilities", "Keyblades", "Accessory", "Weapons", "Puppies"] if self.options.hundred_acre_wood: - non_filler_item_categories.append("HAW") + non_filler_item_categories.append("Torn Pages") for name, data in item_table.items(): quantity = data.max_quantity # Ignore filler, it will be added in a later stage. if data.category not in non_filler_item_categories: continue - item_pool += [self.create_item(name) for _ in range(0, quantity)] + if data.category == "Puppies": + if self.options.puppies == "triplets" and "-" in name: + item_pool += [self.create_item(name) for _ in range(0, quantity)] + if self.options.puppies == "individual" and "Puppy" in name: + item_pool += [self.create_item(name) for _ in range(0, quantity)] + if self.options.puppies == "full" and name == "All Puppies": + item_pool += [self.create_item(name) for _ in range(0, quantity)] + elif name == "Atlantica" or name == "Mermaid Kick": + if self.options.atlantica: + item_pool += [self.create_item(name) for _ in range(0, quantity)] + else: + item_pool += [self.create_item(name) for _ in range(0, quantity)] reports_in_pool = max(int(self.options.required_reports), int(self.options.reports_in_pool)) if self.options.goal.current_key == "super_boss_hunt":