From 3bb69ca73d24aa63832a5524aad2ab7b34cb210d Mon Sep 17 00:00:00 2001 From: gaithern Date: Tue, 16 Apr 2024 09:44:02 -0500 Subject: [PATCH] Fixes related to randomized keyblade stats and super bosses --- worlds/kh1/Regions.py | 8 ++++++-- worlds/kh1/Rules.py | 6 +++++- worlds/kh1/__init__.py | 10 +++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/worlds/kh1/Regions.py b/worlds/kh1/Regions.py index b14ba1887170..05ea92c0762e 100644 --- a/worlds/kh1/Regions.py +++ b/worlds/kh1/Regions.py @@ -359,7 +359,9 @@ def create_regions(multiworld: MultiWorld, player: int, options): #regions["Hollow Bastion"].locations.append("Hollow Bastion Speak with Aerith Ansem's Report 10") if options.super_bosses or options.goal.current_key == "super_boss_hunt": regions["Agrabah"].locations.append("Agrabah Defeat Kurt Zisa Ansem's Report 11") + if options.super_bosses or options.goal.current_key == "super_boss_hunt" or options.goal.current_key == "sephiroth": regions["Olympus Coliseum"].locations.append("Olympus Coliseum Defeat Sephiroth Ansem's Report 12") + if options.super_bosses or options.goal.current_key == "super_boss_hunt" or options.goal.current_key == "unknown": regions["Hollow Bastion"].locations.append("Hollow Bastion Defeat Unknown Ansem's Report 13") for i in range(options.level_checks): @@ -411,8 +413,9 @@ def create_regions(multiworld: MultiWorld, player: int, options): regions["Traverse Town"].locations.append("Traverse Town Piano Room Return 90 Puppies") regions["Traverse Town"].locations.append("Traverse Town Piano Room Return 99 Puppies Reward 1") regions["Traverse Town"].locations.append("Traverse Town Piano Room Return 99 Puppies Reward 2") - if options.super_bosses or options.goal.current_key == "super_boss_hunt": + if options.super_bosses or options.goal.current_key == "super_boss_hunt" or options.goal.current_key == "sephiroth": regions["Olympus Coliseum"].locations.append("Olympus Coliseum Defeat Sephiroth One-Winged Angel Event") + if options.super_bosses or options.goal.current_key == "super_boss_hunt": regions["Olympus Coliseum"].locations.append("Olympus Coliseum Defeat Ice Titan Diamond Dust Event") regions["Olympus Coliseum"].locations.append("Olympus Coliseum Gates Purple Jar After Defeating Hades") regions["Halloween Town"].locations.append("Halloween Town Guillotine Square Ring Jack's Doorbell 3 Times") @@ -467,6 +470,7 @@ def create_regions(multiworld: MultiWorld, player: int, options): regions["Olympus Coliseum"].locations.append("Olympus Coliseum Coliseum Gates Green Trinity") if options.super_bosses or options.goal.current_key == "super_boss_hunt": regions["Agrabah"].locations.append("Agrabah Defeat Kurt Zisa Zantetsuken Event") + if options.super_bosses or options.goal.current_key == "super_boss_hunt" or options.goal.current_key == "unknown": regions["Hollow Bastion"].locations.append("Hollow Bastion Defeat Unknown EXP Necklace Event") regions["Traverse Town"].locations.append("Traverse Town Synth Log") @@ -477,7 +481,7 @@ def create_regions(multiworld: MultiWorld, player: int, options): regions["Traverse Town"].locations.append("Traverse Town Synth Mushroom") - if options.goal.current_key == "final_ansem" or options.require_final_ansem: + if options.goal.current_key == "final_ansem" or options.require_final_ansem or options.goal.current_key == "super_boss_hunt": regions["End of the World"].locations.append("Final Ansem") # Set up the regions correctly. diff --git a/worlds/kh1/Rules.py b/worlds/kh1/Rules.py index a4fdc9d97728..ef9ebcb28753 100644 --- a/worlds/kh1/Rules.py +++ b/worlds/kh1/Rules.py @@ -412,7 +412,9 @@ def set_rules(multiworld: MultiWorld, player: int, options, required_reports): #multiworld.get_location("Hollow Bastion Speak with Aerith Ansem's Report 10" , player).access_rule = lambda state: has_emblems(state, player) if options.super_bosses or options.goal.current_key == "super_boss_hunt": multiworld.get_location("Agrabah Defeat Kurt Zisa Ansem's Report 11" , player).access_rule = lambda state: has_emblems(state, player) and has_x_worlds(state, player, 7) + if options.super_bosses or options.goal.current_key == "super_boss_hunt" or options.goal.current_key == "sephiroth": multiworld.get_location("Olympus Coliseum Defeat Sephiroth Ansem's 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") and has_x_worlds(state, player, 7) + if options.super_bosses or options.goal.current_key == "super_boss_hunt" or options.goal.current_key == "unknown": multiworld.get_location("Hollow Bastion Defeat Unknown Ansem's Report 13" , player).access_rule = lambda state: has_emblems(state, player) and has_x_worlds(state, player, 7) multiworld.get_location("Complete Phil Cup" , player).access_rule = lambda state: has_item(state, player, "Phil Cup") @@ -460,8 +462,9 @@ def set_rules(multiworld: MultiWorld, player: int, options, required_reports): multiworld.get_location("Traverse Town Piano Room Return 90 Puppies" , player).access_rule = lambda state: has_puppies(state, player, 90) multiworld.get_location("Traverse Town Piano Room Return 99 Puppies Reward 1" , player).access_rule = lambda state: has_puppies(state, player, 99) multiworld.get_location("Traverse Town Piano Room Return 99 Puppies Reward 2" , player).access_rule = lambda state: has_puppies(state, player, 99) - if options.super_bosses or options.goal.current_key == "super_boss_hunt": + if options.super_bosses or options.goal.current_key == "super_boss_hunt" or options.goal.current_key == "sephiroth": multiworld.get_location("Olympus Coliseum Defeat Sephiroth One-Winged Angel Event" , 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") and has_x_worlds(state, player, 7) + if options.super_bosses or options.goal.current_key == "super_boss_hunt": multiworld.get_location("Olympus Coliseum Defeat Ice Titan Diamond Dust Event" , 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") and has_x_worlds(state, player, 7) and has_item(state, player, "Guard") multiworld.get_location("Olympus Coliseum Gates Purple Jar After Defeating Hades" , 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") and has_x_worlds(state, player, 7) #multiworld.get_location("Halloween Town Guillotine Square Ring Jack's Doorbell 3 Times" , player).access_rule = lambda state: has_item(state, player, "") @@ -516,6 +519,7 @@ def set_rules(multiworld: MultiWorld, player: int, options, required_reports): multiworld.get_location("Olympus Coliseum Coliseum Gates Green Trinity" , player).access_rule = lambda state: has_item(state, player, "Green Trinity") if options.super_bosses or options.goal.current_key == "super_boss_hunt": multiworld.get_location("Agrabah Defeat Kurt Zisa Zantetsuken Event" , player).access_rule = lambda state: has_emblems(state, player) and has_x_worlds(state, player, 7) + if options.super_bosses or options.goal.current_key == "super_boss_hunt" or options.goal.current_key == "unknown": multiworld.get_location("Hollow Bastion Defeat Unknown EXP Necklace Event" , player).access_rule = lambda state: has_emblems(state, player) and has_x_worlds(state, player, 7) multiworld.get_location("Traverse Town Synth Log" , player).access_rule = lambda state: has_at_least(state, player, "Empty Bottle", 6) and has_item(state, player, "Green Trinity") diff --git a/worlds/kh1/__init__.py b/worlds/kh1/__init__.py index 569e800c09d5..0890006ff47d 100644 --- a/worlds/kh1/__init__.py +++ b/worlds/kh1/__init__.py @@ -195,7 +195,15 @@ def fill_slot_data(self) -> dict: if i < 4 and self.options.bad_starting_weapons: slot_data["Keyblade Stats"] = slot_data["Keyblade Stats"] + "1,0," else: - slot_data["Keyblade Stats"] = slot_data["Keyblade Stats"] + str(int(self.random.randrange(min_str_bonus,max_str_bonus))) + "," + str(int(self.random.randrange(min_mp_bonus,max_mp_bonus))) + "," + if min_str_bonus != max_str_bonus: + str_bonus = int(self.random.randrange(min_str_bonus,max_str_bonus)) + else: + str_bonus = int(min_str_bonus) + if min_mp_bonus != max_mp_bonus: + mp_bonus = int(self.random.randrange(min_mp_bonus,max_mp_bonus)) + else: + mp_bonus = int(min_mp_bonus) + slot_data["Keyblade Stats"] = slot_data["Keyblade Stats"] + str(str_bonus) + "," + str(mp_bonus) + "," slot_data["Keyblade Stats"] = slot_data["Keyblade Stats"][:-1] return slot_data