From fab891d072ffaa8a9f3fd66f58d63c7f89c299f7 Mon Sep 17 00:00:00 2001 From: gaithern Date: Thu, 11 Jan 2024 12:51:17 -0600 Subject: [PATCH] Setting additions and fixes Added leading 0's to level locations to make the alphabetical Fixed chronicles logic, changed name to world_complete Added Unknown win condition --- worlds/kh1/Locations.py | 200 ++++++++++++++++++++-------------------- worlds/kh1/Options.py | 22 +++-- worlds/kh1/Regions.py | 9 +- worlds/kh1/Rules.py | 7 +- worlds/kh1/__init__.py | 17 ++-- 5 files changed, 134 insertions(+), 121 deletions(-) diff --git a/worlds/kh1/Locations.py b/worlds/kh1/Locations.py index 237bff7d9477..92bc46924136 100644 --- a/worlds/kh1/Locations.py +++ b/worlds/kh1/Locations.py @@ -271,106 +271,106 @@ def get_locations_by_category(category: str) -> Dict[str, KH1LocationData]: "Ansem's Secret Report 10": KH1LocationData("Reports", 265_7027), #"Ansem's Secret Report 11": KH1LocationData("Reports", 265_7026), "Ansem's Secret Report 12": KH1LocationData("Reports", 265_7025), - #"Ansem's Secret Report 13": KH1LocationData("Reports", 265_7024), - "Level 1": KH1LocationData("Levels", 265_8001), - "Level 2": KH1LocationData("Levels", 265_8002), - "Level 3": KH1LocationData("Levels", 265_8003), - "Level 4": KH1LocationData("Levels", 265_8004), - "Level 5": KH1LocationData("Levels", 265_8005), - "Level 6": KH1LocationData("Levels", 265_8006), - "Level 7": KH1LocationData("Levels", 265_8007), - "Level 8": KH1LocationData("Levels", 265_8008), - "Level 9": KH1LocationData("Levels", 265_8009), - "Level 10": KH1LocationData("Levels", 265_8010), - "Level 11": KH1LocationData("Levels", 265_8011), - "Level 12": KH1LocationData("Levels", 265_8012), - "Level 13": KH1LocationData("Levels", 265_8013), - "Level 14": KH1LocationData("Levels", 265_8014), - "Level 15": KH1LocationData("Levels", 265_8015), - "Level 16": KH1LocationData("Levels", 265_8016), - "Level 17": KH1LocationData("Levels", 265_8017), - "Level 18": KH1LocationData("Levels", 265_8018), - "Level 19": KH1LocationData("Levels", 265_8019), - "Level 20": KH1LocationData("Levels", 265_8020), - "Level 21": KH1LocationData("Levels", 265_8021), - "Level 22": KH1LocationData("Levels", 265_8022), - "Level 23": KH1LocationData("Levels", 265_8023), - "Level 24": KH1LocationData("Levels", 265_8024), - "Level 25": KH1LocationData("Levels", 265_8025), - "Level 26": KH1LocationData("Levels", 265_8026), - "Level 27": KH1LocationData("Levels", 265_8027), - "Level 28": KH1LocationData("Levels", 265_8028), - "Level 29": KH1LocationData("Levels", 265_8029), - "Level 30": KH1LocationData("Levels", 265_8030), - "Level 31": KH1LocationData("Levels", 265_8031), - "Level 32": KH1LocationData("Levels", 265_8032), - "Level 33": KH1LocationData("Levels", 265_8033), - "Level 34": KH1LocationData("Levels", 265_8034), - "Level 35": KH1LocationData("Levels", 265_8035), - "Level 36": KH1LocationData("Levels", 265_8036), - "Level 37": KH1LocationData("Levels", 265_8037), - "Level 38": KH1LocationData("Levels", 265_8038), - "Level 39": KH1LocationData("Levels", 265_8039), - "Level 40": KH1LocationData("Levels", 265_8040), - "Level 41": KH1LocationData("Levels", 265_8041), - "Level 42": KH1LocationData("Levels", 265_8042), - "Level 43": KH1LocationData("Levels", 265_8043), - "Level 44": KH1LocationData("Levels", 265_8044), - "Level 45": KH1LocationData("Levels", 265_8045), - "Level 46": KH1LocationData("Levels", 265_8046), - "Level 47": KH1LocationData("Levels", 265_8047), - "Level 48": KH1LocationData("Levels", 265_8048), - "Level 49": KH1LocationData("Levels", 265_8049), - "Level 50": KH1LocationData("Levels", 265_8050), - "Level 51": KH1LocationData("Levels", 265_8051), - "Level 52": KH1LocationData("Levels", 265_8052), - "Level 53": KH1LocationData("Levels", 265_8053), - "Level 54": KH1LocationData("Levels", 265_8054), - "Level 55": KH1LocationData("Levels", 265_8055), - "Level 56": KH1LocationData("Levels", 265_8056), - "Level 57": KH1LocationData("Levels", 265_8057), - "Level 58": KH1LocationData("Levels", 265_8058), - "Level 59": KH1LocationData("Levels", 265_8059), - "Level 60": KH1LocationData("Levels", 265_8060), - "Level 61": KH1LocationData("Levels", 265_8061), - "Level 62": KH1LocationData("Levels", 265_8062), - "Level 63": KH1LocationData("Levels", 265_8063), - "Level 64": KH1LocationData("Levels", 265_8064), - "Level 65": KH1LocationData("Levels", 265_8065), - "Level 66": KH1LocationData("Levels", 265_8066), - "Level 67": KH1LocationData("Levels", 265_8067), - "Level 68": KH1LocationData("Levels", 265_8068), - "Level 69": KH1LocationData("Levels", 265_8069), - "Level 70": KH1LocationData("Levels", 265_8070), - "Level 71": KH1LocationData("Levels", 265_8071), - "Level 72": KH1LocationData("Levels", 265_8072), - "Level 73": KH1LocationData("Levels", 265_8073), - "Level 74": KH1LocationData("Levels", 265_8074), - "Level 75": KH1LocationData("Levels", 265_8075), - "Level 76": KH1LocationData("Levels", 265_8076), - "Level 77": KH1LocationData("Levels", 265_8077), - "Level 78": KH1LocationData("Levels", 265_8078), - "Level 79": KH1LocationData("Levels", 265_8079), - "Level 80": KH1LocationData("Levels", 265_8080), - "Level 81": KH1LocationData("Levels", 265_8081), - "Level 82": KH1LocationData("Levels", 265_8082), - "Level 83": KH1LocationData("Levels", 265_8083), - "Level 84": KH1LocationData("Levels", 265_8084), - "Level 85": KH1LocationData("Levels", 265_8085), - "Level 86": KH1LocationData("Levels", 265_8086), - "Level 87": KH1LocationData("Levels", 265_8087), - "Level 88": KH1LocationData("Levels", 265_8088), - "Level 89": KH1LocationData("Levels", 265_8089), - "Level 90": KH1LocationData("Levels", 265_8090), - "Level 91": KH1LocationData("Levels", 265_8091), - "Level 92": KH1LocationData("Levels", 265_8092), - "Level 93": KH1LocationData("Levels", 265_8093), - "Level 94": KH1LocationData("Levels", 265_8094), - "Level 95": KH1LocationData("Levels", 265_8095), - "Level 96": KH1LocationData("Levels", 265_8096), - "Level 97": KH1LocationData("Levels", 265_8097), - "Level 98": KH1LocationData("Levels", 265_8098), - "Level 99": KH1LocationData("Levels", 265_8099), + "Ansem's Secret Report 13": KH1LocationData("Reports", 265_7024), + "Level 001": KH1LocationData("Levels", 265_8001), + "Level 002": KH1LocationData("Levels", 265_8002), + "Level 003": KH1LocationData("Levels", 265_8003), + "Level 004": KH1LocationData("Levels", 265_8004), + "Level 005": KH1LocationData("Levels", 265_8005), + "Level 006": KH1LocationData("Levels", 265_8006), + "Level 007": KH1LocationData("Levels", 265_8007), + "Level 008": KH1LocationData("Levels", 265_8008), + "Level 009": KH1LocationData("Levels", 265_8009), + "Level 010": KH1LocationData("Levels", 265_8010), + "Level 011": KH1LocationData("Levels", 265_8011), + "Level 012": KH1LocationData("Levels", 265_8012), + "Level 013": KH1LocationData("Levels", 265_8013), + "Level 014": KH1LocationData("Levels", 265_8014), + "Level 015": KH1LocationData("Levels", 265_8015), + "Level 016": KH1LocationData("Levels", 265_8016), + "Level 017": KH1LocationData("Levels", 265_8017), + "Level 018": KH1LocationData("Levels", 265_8018), + "Level 019": KH1LocationData("Levels", 265_8019), + "Level 020": KH1LocationData("Levels", 265_8020), + "Level 021": KH1LocationData("Levels", 265_8021), + "Level 022": KH1LocationData("Levels", 265_8022), + "Level 023": KH1LocationData("Levels", 265_8023), + "Level 024": KH1LocationData("Levels", 265_8024), + "Level 025": KH1LocationData("Levels", 265_8025), + "Level 026": KH1LocationData("Levels", 265_8026), + "Level 027": KH1LocationData("Levels", 265_8027), + "Level 028": KH1LocationData("Levels", 265_8028), + "Level 029": KH1LocationData("Levels", 265_8029), + "Level 030": KH1LocationData("Levels", 265_8030), + "Level 031": KH1LocationData("Levels", 265_8031), + "Level 032": KH1LocationData("Levels", 265_8032), + "Level 033": KH1LocationData("Levels", 265_8033), + "Level 034": KH1LocationData("Levels", 265_8034), + "Level 035": KH1LocationData("Levels", 265_8035), + "Level 036": KH1LocationData("Levels", 265_8036), + "Level 037": KH1LocationData("Levels", 265_8037), + "Level 038": KH1LocationData("Levels", 265_8038), + "Level 039": KH1LocationData("Levels", 265_8039), + "Level 040": KH1LocationData("Levels", 265_8040), + "Level 041": KH1LocationData("Levels", 265_8041), + "Level 042": KH1LocationData("Levels", 265_8042), + "Level 043": KH1LocationData("Levels", 265_8043), + "Level 044": KH1LocationData("Levels", 265_8044), + "Level 045": KH1LocationData("Levels", 265_8045), + "Level 046": KH1LocationData("Levels", 265_8046), + "Level 047": KH1LocationData("Levels", 265_8047), + "Level 048": KH1LocationData("Levels", 265_8048), + "Level 049": KH1LocationData("Levels", 265_8049), + "Level 050": KH1LocationData("Levels", 265_8050), + "Level 051": KH1LocationData("Levels", 265_8051), + "Level 052": KH1LocationData("Levels", 265_8052), + "Level 053": KH1LocationData("Levels", 265_8053), + "Level 054": KH1LocationData("Levels", 265_8054), + "Level 055": KH1LocationData("Levels", 265_8055), + "Level 056": KH1LocationData("Levels", 265_8056), + "Level 057": KH1LocationData("Levels", 265_8057), + "Level 058": KH1LocationData("Levels", 265_8058), + "Level 059": KH1LocationData("Levels", 265_8059), + "Level 060": KH1LocationData("Levels", 265_8060), + "Level 061": KH1LocationData("Levels", 265_8061), + "Level 062": KH1LocationData("Levels", 265_8062), + "Level 063": KH1LocationData("Levels", 265_8063), + "Level 064": KH1LocationData("Levels", 265_8064), + "Level 065": KH1LocationData("Levels", 265_8065), + "Level 066": KH1LocationData("Levels", 265_8066), + "Level 067": KH1LocationData("Levels", 265_8067), + "Level 068": KH1LocationData("Levels", 265_8068), + "Level 069": KH1LocationData("Levels", 265_8069), + "Level 070": KH1LocationData("Levels", 265_8070), + "Level 071": KH1LocationData("Levels", 265_8071), + "Level 072": KH1LocationData("Levels", 265_8072), + "Level 073": KH1LocationData("Levels", 265_8073), + "Level 074": KH1LocationData("Levels", 265_8074), + "Level 075": KH1LocationData("Levels", 265_8075), + "Level 076": KH1LocationData("Levels", 265_8076), + "Level 077": KH1LocationData("Levels", 265_8077), + "Level 078": KH1LocationData("Levels", 265_8078), + "Level 079": KH1LocationData("Levels", 265_8079), + "Level 080": KH1LocationData("Levels", 265_8080), + "Level 081": KH1LocationData("Levels", 265_8081), + "Level 082": KH1LocationData("Levels", 265_8082), + "Level 083": KH1LocationData("Levels", 265_8083), + "Level 084": KH1LocationData("Levels", 265_8084), + "Level 085": KH1LocationData("Levels", 265_8085), + "Level 086": KH1LocationData("Levels", 265_8086), + "Level 087": KH1LocationData("Levels", 265_8087), + "Level 088": KH1LocationData("Levels", 265_8088), + "Level 089": KH1LocationData("Levels", 265_8089), + "Level 090": KH1LocationData("Levels", 265_8090), + "Level 091": KH1LocationData("Levels", 265_8091), + "Level 092": KH1LocationData("Levels", 265_8092), + "Level 093": KH1LocationData("Levels", 265_8093), + "Level 094": KH1LocationData("Levels", 265_8094), + "Level 095": KH1LocationData("Levels", 265_8095), + "Level 096": KH1LocationData("Levels", 265_8096), + "Level 097": KH1LocationData("Levels", 265_8097), + "Level 098": KH1LocationData("Levels", 265_8098), + "Level 099": KH1LocationData("Levels", 265_8099), "Level 100": KH1LocationData("Levels", 265_8100), "Complete Phil Cup": KH1LocationData("Cups", 265_9001), "Complete Pegasus Cup": KH1LocationData("Cups", 265_9002), diff --git a/worlds/kh1/Options.py b/worlds/kh1/Options.py index e4fb3276fe27..4174311373cc 100644 --- a/worlds/kh1/Options.py +++ b/worlds/kh1/Options.py @@ -64,23 +64,31 @@ class Sephiroth(Toggle): """ display_name = "Sephiroth" -class Atlantica(Toggle): +class WorldComplete(Toggle): """ - Toggle whether Atlantica locations/items should be included. + Toggle whether the win condition should be placed behind a random world completion. + This could be that works Chronicles or Secret Report location. Better for fast games. """ - display_name = "Atlantica" + display_name = "World Complete" -class Chronicles(Toggle): +class Unknown(Toggle): """ - Toggle whether the win condition should be placed behind a random chronicle. Better for fast games. + Toggle whether the win condition should be changed to defeating Unknown. """ - display_name = "Chronicles" + display_name = "Unknown" + +class Atlantica(Toggle): + """ + Toggle whether Atlantica locations/items should be included. + """ + display_name = "Atlantica" @dataclass class KH1Options(PerGameCommonOptions): sephiroth: Sephiroth + world_complete: WorldComplete + unknown: Unknown atlantica: Atlantica - chronicles: Chronicles strength_increase: StrengthIncrease defense_increase: DefenseIncrease hp_increase: HPIncrease diff --git a/worlds/kh1/Regions.py b/worlds/kh1/Regions.py index 602007d25846..0bcec32f03db 100644 --- a/worlds/kh1/Regions.py +++ b/worlds/kh1/Regions.py @@ -9,7 +9,7 @@ class KH1RegionData(NamedTuple): region_exits: Optional[List[str]] -def create_regions(multiworld: MultiWorld, player: int, sephiroth: bool, atlantica: bool, levels: int): +def create_regions(multiworld: MultiWorld, player: int, sephiroth: bool, world_complete: bool, unknown:bool, atlantica: bool, levels: int): regions: Dict[str, KH1RegionData] = { "Menu": KH1RegionData(None, ["Awakening", "Levels"]), "Awakening": KH1RegionData([], ["Destiny Islands"]), @@ -261,7 +261,7 @@ def create_regions(multiworld: MultiWorld, player: int, sephiroth: bool, atlanti #regions["Awakening"].locations.append("Awakening Chest"), missable #regions["End of the World"].locations.append("Chronicles Sora's Story") - if not sephiroth: #Not possible if HB is complete, could interefere with other win cons if 4 emblems is not go-mode + if not sephiroth and not world_complete: #Not possible if HB is complete, could interefere with other win cons if 4 emblems is not go-mode regions["Wonderland"].locations.append("Chronicles Wonderland") regions["Olympus Coliseum"].locations.append("Chronicles Olympus Coliseum") regions["Deep Jungle"].locations.append("Chronicles Deep Jungle") @@ -287,10 +287,11 @@ def create_regions(multiworld: MultiWorld, player: int, sephiroth: bool, atlanti #regions["Agrabah"].locations.append("Ansem's Secret Report 11") if sephiroth: regions["Olympus Coliseum"].locations.append("Ansem's Secret Report 12") - #regions["Hollow Bastion"].locations.append("Ansem's Secret Report 13") + if unknown: + regions["Hollow Bastion"].locations.append("Ansem's Secret Report 13") for i in range(levels): - regions["Levels"].locations.append("Level " + str(i+1)) + regions["Levels"].locations.append("Level " + str(i+1).rjust(3,'0')) regions["Olympus Coliseum"].locations.append("Complete Phil Cup") diff --git a/worlds/kh1/Rules.py b/worlds/kh1/Rules.py index f4432951e5b7..3208d827b90e 100644 --- a/worlds/kh1/Rules.py +++ b/worlds/kh1/Rules.py @@ -47,7 +47,7 @@ def has_item(state: CollectionState, player: int, item) -> bool: def has_at_least(state: CollectionState, player: int, item, x) -> bool: return state.count(item, player) >= x -def set_rules(multiworld: MultiWorld, player: int, sephiroth: bool, atlantica: bool): +def set_rules(multiworld: MultiWorld, player: int, sephiroth: bool, world_complete: bool, unknown: bool, atlantica: bool): #Location rules. #Keys #multiworld.get_location("Destiny Islands Chest" , player).access_rule = lambda state: has_item(state, player, "") @@ -278,7 +278,7 @@ def set_rules(multiworld: MultiWorld, player: int, sephiroth: bool, atlantica: b #multiworld.get_location("Awakening Chest" , player).access_rule = lambda state: has_item(state, player, "") #multiworld.get_location("Chronicles Sora's Story" , player).access_rule = lambda state: has_item(state, player,"Hollow Bastion") and has_x_worlds(state, player, 7) and has_item(state, player, "High Jump") and has_item(state, player, "Glide") and has_emblems(state, player) - if not sephiroth: #Not possible if HB is complete, could interefere with other win cons if 4 emblems is not go-mode + if not sephiroth and not world_complete: #Not possible if HB is complete, could interefere with other win cons if 4 emblems is not go-mode multiworld.get_location("Chronicles Wonderland" , player).access_rule = lambda state: has_evidence(state, player) #multiworld.get_location("Chronicles Olympus Coliseum" , player).access_rule = lambda state: has_item(state, player, "") multiworld.get_location("Chronicles Deep Jungle" , player).access_rule = lambda state: has_slides(state, player) @@ -303,7 +303,8 @@ def set_rules(multiworld: MultiWorld, player: int, sephiroth: bool, atlantica: b #multiworld.get_location("Ansem's Secret Report 11" , player).access_rule = lambda state: has_item(state, player, "") if sephiroth: multiworld.get_location("Ansem's Secret Report 12" , player).access_rule = lambda state: has_item(state, player, "Phil Cup") and has_item(state, player, "Pegasus Cup") and has_item(state, player, "Hercules Cup") - #multiworld.get_location("Ansem's Secret Report 13" , player).access_rule = lambda state: has_item(state, player, "") + if unknown: + multiworld.get_location("Ansem's Secret Report 13" , player).access_rule = lambda state: has_emblems(state, player) multiworld.get_location("Complete Phil Cup" , player).access_rule = lambda state: has_item(state, player, "Phil Cup") multiworld.get_location("Complete Pegasus Cup" , player).access_rule = lambda state: has_item(state, player, "Pegasus Cup") diff --git a/worlds/kh1/__init__.py b/worlds/kh1/__init__.py index 84012313bfa7..ada2a9bdd7eb 100644 --- a/worlds/kh1/__init__.py +++ b/worlds/kh1/__init__.py @@ -80,19 +80,22 @@ def create_items(self): while i < len(level_up_item_pool): self.multiworld.get_location(level_up_locations[i], self.player).place_locked_item(self.create_item(level_up_item_pool[i])) i = i + 1 - if self.options.sephiroth or self.options.chronicles: + if self.options.sephiroth or self.options.world_complete or self.options.unknown: possible_win_locations = [] if self.options.sephiroth: possible_win_locations.append("Ansem's Secret Report 12") - if self.options.chronicles: - possible_win_locations.append("Chronicles Wonderland") - possible_win_locations.append("Chronicles Olympus Coliseum") + if self.options.unknown: + possible_win_locations.append("Ansem's Secret Report 13") + if self.options.world_complete: + #possible_win_locations.append("Chronicles Wonderland") If completing HB1, becomes inaccessible + #possible_win_locations.append("Chronicles Olympus Coliseum") Removing, the world is just too short possible_win_locations.append("Chronicles Deep Jungle") possible_win_locations.append("Chronicles Agrabah") possible_win_locations.append("Chronicles Monstro") if self.options.atlantica: - possible_win_locations.append("Chronicles Atlantica") + possible_win_locations.append("Ansem's Secret Report 3") #Replaces Chronicles Atlantica as it requires world completion possible_win_locations.append("Chronicles Halloween Town") + possible_win_locations.append("Ansem's Secret Report 9") #Complete Neverland, Chronicles Neverland is not a location self.multiworld.get_location(random.choice(possible_win_locations), self.player).place_locked_item(self.create_item("Victory")) else: self.multiworld.get_location("End of the World Final Rest Chest", self.player).place_locked_item(self.create_item("Victory")) @@ -145,9 +148,9 @@ def create_event(self, name: str) -> KH1Item: return KH1Item(name, data.classification, data.code, self.player) def set_rules(self): - set_rules(self.multiworld, self.player, self.options.sephiroth, self.options.atlantica) + set_rules(self.multiworld, self.player, self.options.sephiroth, self.options.world_complete, self.options.unknown, self.options.atlantica) def create_regions(self): - create_regions(self.multiworld, self.player, self.options.sephiroth, self.options.atlantica\ + create_regions(self.multiworld, self.player, self.options.sephiroth, self.options.world_complete, self.options.unknown, self.options.atlantica\ , min((self.options.strength_increase + self.options.defense_increase + self.options.hp_increase + self.options.mp_increase\ + self.options.ap_increase + self.options.accessory_slot_increase + self.options.item_slot_increase), 100)) \ No newline at end of file