Skip to content

Commit

Permalink
Push changes for making the Final Rest Door appear, few option fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gaithern committed May 3, 2024
1 parent 5390622 commit b7aaaff
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 155 deletions.
48 changes: 31 additions & 17 deletions worlds/kh1/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,40 @@ def on_package(self, cmd: str, args: dict):
f.close()

#Handle Slot Data
if "EXP Multiplier" in list(args['slot_data'].keys()):
xp_mult = args['slot_data']["EXP Multiplier"]
else:
xp_mult = 1.0
with open(os.path.join(self.game_communication_path, "xpmult.cfg"), 'w') as f:
f.write(str(xp_mult))
f.close()

if "Required Reports" in list(args['slot_data'].keys()):
####if "EXP Multiplier" in list(args['slot_data'].keys()):
#### xp_mult = args['slot_data']["EXP Multiplier"]
####else:
#### xp_mult = 1.0
####with open(os.path.join(self.game_communication_path, "xpmult.cfg"), 'w') as f:
#### f.write(str(xp_mult))
#### f.close()
####
####if "Required Reports" in list(args['slot_data'].keys()):
#### reports_required = args['slot_data']["Required Reports"]
####else:
#### reports_required = 4
####with open(os.path.join(self.game_communication_path, "required_reports.cfg"), 'w') as f:
#### f.write(str(reports_required))
#### f.close()
####if "Keyblade Stats" in list(args['slot_data'].keys()):
#### keyblade_stats = args['slot_data']["Keyblade Stats"]
#### with open(os.path.join(self.game_communication_path, "keyblade_stats.cfg"), 'w') as f:
#### f.write(str(keyblade_stats))
#### f.close()
for key in list(args['slot_data'].keys()):
with open(os.path.join(self.game_communication_path, key + ".cfg"), 'w') as f:
f.write(str(args['slot_data'][key]))
f.close()

###Support Legacy Games
if "Required Reports" in list(args['slot_data'].keys()) and "required_reports_eotw" not in list(args['slot_data'].keys()):
reports_required = args['slot_data']["Required Reports"]
else:
reports_required = 4
with open(os.path.join(self.game_communication_path, "required_reports.cfg"), 'w') as f:
f.write(str(reports_required))
f.close()
if "Keyblade Stats" in list(args['slot_data'].keys()):
keyblade_stats = args['slot_data']["Keyblade Stats"]
with open(os.path.join(self.game_communication_path, "keyblade_stats.cfg"), 'w') as f:
f.write(str(keyblade_stats))
with open(os.path.join(self.game_communication_path, "required_reports.cfg"), 'w') as f:
f.write(str(reports_required))
f.close()
###End Support Legacy Games

#End Handle Slot Data

if cmd in {"ReceivedItems"}:
Expand Down
2 changes: 1 addition & 1 deletion worlds/kh1/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def get_items_by_category(category: str, disclude: list) -> Dict[str, KH1ItemDat
"Atlantica": KH1ItemData("Worlds", code = 264_7007, classification = ItemClassification.progression, max_quantity = 1, weight = 10),
"Neverland": KH1ItemData("Worlds", code = 264_7008, classification = ItemClassification.progression, max_quantity = 1, weight = 10),
"Hollow Bastion": KH1ItemData("Worlds", code = 264_7009, classification = ItemClassification.progression, max_quantity = 1, weight = 10),
#"End of the World": KH1ItemData("Worlds", code = 264_7010, classification = ItemClassification.progression, max_quantity = 1, weight = 10),
"End of the World": KH1ItemData("Worlds", code = 264_7010, classification = ItemClassification.progression, max_quantity = 1, weight = 10),
"Monstro": KH1ItemData("Worlds", code = 264_7011, classification = ItemClassification.progression, max_quantity = 1, weight = 10),
"Blue Trinity": KH1ItemData("Trinities", code = 264_8001, classification = ItemClassification.progression, max_quantity = 1, weight = 10),
"Red Trinity": KH1ItemData("Trinities", code = 264_8002, classification = ItemClassification.progression, max_quantity = 1, weight = 10),
Expand Down
64 changes: 46 additions & 18 deletions worlds/kh1/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,37 +100,54 @@ class HundredAcreWood(Toggle):

class SuperBosses(Toggle):
"""
Toggle whether to include checks behind Super Bosses. This is ignored if Super Boss Hunt is your goal.
Toggle whether to include checks behind Super Bosses.
"""
display_name = "Super Bosses"

class Cups(Toggle):
"""
Toggle whether to include checks behind completing Phil, Pegasus, Hercules, or Hades cups. Please note that the items will still appear in the multiworld, as they are required to challenge Sephiroth.
"""
display_name = "Cups"

class Goal(Choice):
"""
Determines the goal of your playthrough.
Depending on your setting for Require Final Ansem, this will either yield Victory or required Ansem Reports to enter End of the World.
Note: If requiring Final Ansem, with more than 1 Ansem Report in the pool (or more than 5 if you are using the Super Boss Hunt goal), the goal(s) will not be required, but will remain a way to get a report.
Determines when victory is achieved in your playthrough.
Sephiroth: Defeat Sephiroth.
Unknown: Defeat Unknown.
Postcards: Turn in all 10 postcards in Traverse Town
Final Ansem: Enter End of the World and defeat Ansem as normal
Puppies: Rescue and return all 99 puppies in Traverse Town.
Super Boss Hunt: Ansem Reports are set to appear as rewards for defeating Phantom, Kurt Zisa, Sephiroth, Ice Titan, and Unknown. Forces require Final Ansem on.
"""
display_name = "Goal"
option_sephiroth = 0
option_unknown = 1
option_postcards = 2
option_final_ansem = 3
option_puppies = 4
option_super_boss_hunt = 5
default = 3

class RequireFinalAnsem(Toggle):
"""
Determines whether the Victory item is behind your goal or if your goal will provide an Ansem's Report to enter End of the World and defeat Ansem.
"""
display_name = "Require Final Ansem"
class EndoftheWorldUnlock(Choice):
"""Determines how End of the World is Unlocked"""
display_name = "End of the World Unlock"
option_item = 0
option_reports = 1
default = 1

class FinalRestDoor(Choice):
"""Determines what conditions need to be met to manifest the door in Final Rest, allowing the player to challenge Ansem
Reports: A certain number of Ansem's Reports are required. That number is defined in another setting.
Puppies: Having all 99 puppies is required.
Postcards: Turning in all 10 postcards is required.
Superbosses: Defeating Sephiroth, Unknown, Kurt Zisa, and Phantom are required.
"""
display_name = "Final Rest Door"
option_reports = 0
option_puppies = 1
option_postcards = 2
option_superbosses = 3

class Puppies(Choice):
"""
Expand All @@ -143,7 +160,7 @@ class Puppies(Choice):
option_full = 0
option_triplets = 1
option_individual = 2
default = 0
default = 1

class EXPMultiplier(NamedRange):
"""
Expand All @@ -152,7 +169,7 @@ class EXPMultiplier(NamedRange):
display_name = "EXP Multiplier"
default = 16
range_start = default / 4
range_end = 160
range_end = 128
special_range_names = {
"0.25x": default / 4,
"0.5x": default / 2,
Expand All @@ -161,17 +178,25 @@ class EXPMultiplier(NamedRange):
"3x": default * 3,
"4x": default * 4,
"8x": default * 8,
"10x": default * 10,
}

class RequiredReports(Range):
class RequiredReportsEotW(Range):
"""
Determines the number of Ansem's Reports needed to open End of the World
If End of the World Unlock is set to "Reports", determines the number of Ansem's Reports required to open End of the World.
"""
display_name = "Reports to Open End of the World"
default = 4
range_start = 1
range_end = 13

class RequiredReportsDoor(Range):
"""
If Final Rest Door is set to "Reports", determines the number of Ansem's Reports required to manifest the door in Final Rest to challenge Ansem.
"""
display_name = "Reports to Open Final Rest Door"
default = 4
range_start = 1
range_end = 13

class ReportsInPool(Range):
"""
Expand Down Expand Up @@ -257,12 +282,15 @@ class BadStartingWeapons(Toggle):
@dataclass
class KH1Options(PerGameCommonOptions):
goal: Goal
require_final_ansem: RequireFinalAnsem
required_reports: RequiredReports
end_of_the_world_unlock: EndoftheWorldUnlock
final_rest_door: FinalRestDoor
required_reports_eotw: RequiredReportsEotW
required_reports_door: RequiredReportsDoor
reports_in_pool: ReportsInPool
super_bosses: SuperBosses
atlantica: Atlantica
hundred_acre_wood: HundredAcreWood
cups: Cups
puppies: Puppies
exp_multiplier: EXPMultiplier
randomize_keyblade_stats: RandomizeKeybladeStats
Expand Down
67 changes: 35 additions & 32 deletions worlds/kh1/Regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def create_regions(multiworld: MultiWorld, player: int, options):
regions["Neverland"].locations.append("Neverland Seal Keyhole Fairy Harp Event")
regions["Neverland"].locations.append("Neverland Seal Keyhole Tinker Bell Event")
regions["Neverland"].locations.append("Neverland Seal Keyhole Glide Event")
if options.super_bosses or options.goal.current_key == "super_boss_hunt":
if options.super_bosses:
regions["Neverland"].locations.append("Neverland Defeat Phantom Stop Event")
regions["Neverland"].locations.append("Neverland Defeat Captain Hook Ars Arcanum Event")
regions["Hollow Bastion"].locations.append("Hollow Bastion Defeat Riku I White Trinity Event")
Expand Down Expand Up @@ -354,39 +354,40 @@ def create_regions(multiworld: MultiWorld, player: int, options):
regions["Hollow Bastion"].locations.append("Hollow Bastion Defeat Maleficent Ansem's Report 5")
#regions["Hollow Bastion"].locations.append("Hollow Bastion Speak with Aerith Ansem's Report 6")
regions["Halloween Town"].locations.append("Halloween Town Defeat Oogie Boogie Ansem's Report 7")
regions["Olympus Coliseum"].locations.append("Olympus Coliseum Defeat Hades Ansem's Report 8")
if options.cups:
regions["Olympus Coliseum"].locations.append("Olympus Coliseum Defeat Hades Ansem's Report 8")
regions["Neverland"].locations.append("Neverland Defeat Hook Ansem's Report 9")
#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":
if options.super_bosses:
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":
if options.super_bosses 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":
if options.super_bosses 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):
regions["Levels"].locations.append("Level " + str(i+1).rjust(3,'0'))


regions["Olympus Coliseum"].locations.append("Complete Phil Cup")
regions["Olympus Coliseum"].locations.append("Complete Phil Cup Solo")
regions["Olympus Coliseum"].locations.append("Complete Phil Cup Time Trial")
regions["Olympus Coliseum"].locations.append("Complete Pegasus Cup")
regions["Olympus Coliseum"].locations.append("Complete Pegasus Cup Solo")
regions["Olympus Coliseum"].locations.append("Complete Pegasus Cup Time Trial")
regions["Olympus Coliseum"].locations.append("Complete Hercules Cup")
regions["Olympus Coliseum"].locations.append("Complete Hercules Cup Solo")
regions["Olympus Coliseum"].locations.append("Complete Hercules Cup Time Trial")
regions["Olympus Coliseum"].locations.append("Complete Hades Cup")
regions["Olympus Coliseum"].locations.append("Complete Hades Cup Solo")
regions["Olympus Coliseum"].locations.append("Complete Hades Cup Time Trial")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Cloud and Leon Event")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Yuffie Event")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Cerberus Event")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Behemoth Event")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Hades Event")
regions["Olympus Coliseum"].locations.append("Hercules Cup Defeat Cloud Event")
regions["Olympus Coliseum"].locations.append("Hercules Cup Yellow Trinity Event")
if options.cups:
regions["Olympus Coliseum"].locations.append("Complete Phil Cup")
regions["Olympus Coliseum"].locations.append("Complete Phil Cup Solo")
regions["Olympus Coliseum"].locations.append("Complete Phil Cup Time Trial")
regions["Olympus Coliseum"].locations.append("Complete Pegasus Cup")
regions["Olympus Coliseum"].locations.append("Complete Pegasus Cup Solo")
regions["Olympus Coliseum"].locations.append("Complete Pegasus Cup Time Trial")
regions["Olympus Coliseum"].locations.append("Complete Hercules Cup")
regions["Olympus Coliseum"].locations.append("Complete Hercules Cup Solo")
regions["Olympus Coliseum"].locations.append("Complete Hercules Cup Time Trial")
regions["Olympus Coliseum"].locations.append("Complete Hades Cup")
regions["Olympus Coliseum"].locations.append("Complete Hades Cup Solo")
regions["Olympus Coliseum"].locations.append("Complete Hades Cup Time Trial")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Cloud and Leon Event")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Yuffie Event")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Cerberus Event")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Behemoth Event")
regions["Olympus Coliseum"].locations.append("Hades Cup Defeat Hades Event")
regions["Olympus Coliseum"].locations.append("Hercules Cup Defeat Cloud Event")
regions["Olympus Coliseum"].locations.append("Hercules Cup Yellow Trinity Event")

#regions["Traverse Town"].locations.append("Traverse Town Magician's Study Turn in Naturespark")
#regions["Traverse Town"].locations.append("Traverse Town Magician's Study Turn in Watergleam")
Expand All @@ -413,11 +414,12 @@ 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" or options.goal.current_key == "sephiroth":
if options.super_bosses 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":
if options.cups:
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")
if options.cups:
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")
#regions["Neverland"].locations.append("Neverland Clock Tower 01:00 Door")
#regions["Neverland"].locations.append("Neverland Clock Tower 02:00 Door")
Expand Down Expand Up @@ -459,7 +461,8 @@ def create_regions(multiworld: MultiWorld, player: int, options):
regions["Deep Jungle"].locations.append("Deep Jungle Camp Save Gorillas")
regions["Deep Jungle"].locations.append("Deep Jungle Bamboo Thicket Save Gorillas")
regions["Deep Jungle"].locations.append("Deep Jungle Climbing Trees Save Gorillas")
regions["Olympus Coliseum"].locations.append("Olympus Coliseum Olympia Chest")
if options.cups:
regions["Olympus Coliseum"].locations.append("Olympus Coliseum Olympia Chest")
regions["Deep Jungle"].locations.append("Deep Jungle Jungle Slider 10 Fruits")
regions["Deep Jungle"].locations.append("Deep Jungle Jungle Slider 20 Fruits")
regions["Deep Jungle"].locations.append("Deep Jungle Jungle Slider 30 Fruits")
Expand All @@ -468,9 +471,9 @@ def create_regions(multiworld: MultiWorld, player: int, options):
#regions["Traverse Town"].locations.append("Traverse Town 1st District Speak with Cid Event")
regions["Wonderland"].locations.append("Wonderland Bizarre Room Read Book")
regions["Olympus Coliseum"].locations.append("Olympus Coliseum Coliseum Gates Green Trinity")
if options.super_bosses or options.goal.current_key == "super_boss_hunt":
if options.super_bosses:
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":
if options.super_bosses 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 @@ -481,7 +484,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 or options.goal.current_key == "super_boss_hunt":
if options.goal.current_key == "final_ansem":
regions["End of the World"].locations.append("Final Ansem")

# Set up the regions correctly.
Expand Down
Loading

0 comments on commit b7aaaff

Please sign in to comment.