Skip to content

Commit

Permalink
Fixes related to randomized keyblade stats and super bosses
Browse files Browse the repository at this point in the history
  • Loading branch information
gaithern committed Apr 16, 2024
1 parent 823a022 commit 3bb69ca
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
8 changes: 6 additions & 2 deletions worlds/kh1/Regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion worlds/kh1/Rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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, "")
Expand Down Expand Up @@ -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")
Expand Down
10 changes: 9 additions & 1 deletion worlds/kh1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3bb69ca

Please sign in to comment.