Skip to content

Commit

Permalink
Reset
Browse files Browse the repository at this point in the history
  • Loading branch information
gaithern committed Dec 3, 2024
1 parent 6f2e1c2 commit 24dbd09
Show file tree
Hide file tree
Showing 5 changed files with 241 additions and 54 deletions.
22 changes: 20 additions & 2 deletions worlds/kh1/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def _cmd_goal(self):

def _cmd_eotw_unlock(self):
"""Prints End of the World Unlock setting"""
if "required_reports_door" in self.ctx.slot_data.keys():
if self.ctx.slot_data["required_reports_door"] > 13:
if "required_reports_eotw" in self.ctx.slot_data.keys():
if self.ctx.slot_data["required_reports_eotw"] > 13:
self.output("Item")
else:
self.output(str(self.ctx.slot_data["required_reports_eotw"]) + " reports")
Expand All @@ -77,6 +77,20 @@ def _cmd_advanced_logic(self):
self.output(str(self.ctx.slot_data["advanced_logic"]))
else:
self.output("Unknown")

def _cmd_required_postcards(self):
"""Prints the number of postcards required if goal is set to postcards"""
if "required_postcards" in self.ctx.slot_data.keys():
self.output(str(self.ctx.slot_data["required_postcards"]))
else:
self.output("Unknown")

def _cmd_required_puppies(self):
"""Prints the number of puppies required if goal is set to puppies"""
if "required_puppies" in self.ctx.slot_data.keys():
self.output(str(self.ctx.slot_data["required_puppies"]))
else:
self.output("Unknown")

class KH1Context(CommonContext):
command_processor: int = KH1ClientCommandProcessor
Expand All @@ -103,6 +117,10 @@ def __init__(self, server_address, password):
os.remove(root+"/"+file)

async def server_auth(self, password_requested: bool = False):
for root, dirs, files in os.walk(self.game_communication_path):
for file in files:
if file.find("obtain") <= -1:
os.remove(root+"/"+file)
if password_requested and not self.password:
await super(KH1Context, self).server_auth(password_requested)
await self.get_username()
Expand Down
65 changes: 58 additions & 7 deletions worlds/kh1/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ class Goal(Choice):
Sephiroth: Defeat Sephiroth
Unknown: Defeat Unknown
Postcards: Turn in all 10 postcards in Traverse Town
Postcards: Turn in an amount of 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
Puppies: Rescue and return an amount of puppies in Traverse Town
Final Rest: Open the chest in End of the World Final Rest
"""
display_name = "Goal"
Expand Down Expand Up @@ -155,6 +155,32 @@ class FinalRestDoor(Choice):
option_postcards = 2
option_superbosses = 3

class RequiredPostcards(Range):
"""
If your goal is set to "Postcards", defines how many postcards are needed to achieve victory.
"""
display_name = "Required Postcards"
default = 10
range_start = 1
range_end = 10

class RequiredPuppies(Choice):
"""
If your goal is set to "Puppies", defines how many puppies are needed to achieve victory.
"""
display_name = "Required Puppies"
default = 99
option_10 = 10
option_20 = 20
option_30 = 30
option_40 = 40
option_50 = 50
option_60 = 60
option_70 = 70
option_80 = 80
option_90 = 90
option_99 = 99

class Puppies(Choice):
"""
Determines how dalmatian puppies are shuffled into the pool.
Expand Down Expand Up @@ -213,11 +239,17 @@ class ReportsInPool(Range):
range_start = 0
range_end = 13

class RandomizeKeybladeStats(DefaultOnToggle):
class KeybladeStats(Choice):
"""
Determines whether Keyblade stats should be randomized.
Randomize: Randomly generates STR and MP bonuses for each keyblade between the defined minimums and maximums
Shuffle: Shuffles the stats of the vanilla keyblade amongst each other.
Vanilla: Keyblade stats are unchanged.
"""
display_name = "Randomize Keyblade Stats"
display_name = "Keyblade Stats"
option_randomize = 0
option_shuffle = 1
option_vanilla = 2

class KeybladeMinStrength(Range):
"""
Expand Down Expand Up @@ -281,7 +313,7 @@ class ForceStatsOnLevels(NamedRange):

class BadStartingWeapons(Toggle):
"""
Forces Kingdom Key, Dream Sword, Dream Shield, and Dream Staff to have bad stats.
Forces Kingdom Key, Dream Sword, Dream Shield, and Dream Staff to have vanilla stats.
"""
display_name = "Bad Starting Weapons"

Expand Down Expand Up @@ -346,6 +378,19 @@ class VanillaEmblemPieces(DefaultOnToggle):
"""
display_name = "Vanilla Emblem Pieces"

class RandomizePostcards(Choice):
"""
Determines how Postcards are randomized
All: All Postcards are randomized
Chests: Only the 3 Postcards in chests are randomized
Vanilla: Postcards are in their original location
"""
display_name = "Randomize Postcards"
option_all = 0
option_chests = 1
option_vanilla = 2

class StartingWorlds(Range):
"""
Number of random worlds to start with in addition to Traverse Town, which is always available. Will only consider Atlantica if toggled, and will only consider End of the World if its unlock is set to "Item".
Expand All @@ -363,6 +408,8 @@ class KH1Options(PerGameCommonOptions):
required_reports_eotw: RequiredReportsEotW
required_reports_door: RequiredReportsDoor
reports_in_pool: ReportsInPool
required_postcards: RequiredPostcards
required_puppies: RequiredPuppies
super_bosses: SuperBosses
atlantica: Atlantica
hundred_acre_wood: HundredAcreWood
Expand All @@ -376,9 +423,10 @@ class KH1Options(PerGameCommonOptions):
extra_shared_abilities: ExtraSharedAbilities
exp_zero_in_pool: EXPZeroInPool
vanilla_emblem_pieces: VanillaEmblemPieces
randomize_postcards: RandomizePostcards
donald_death_link: DonaldDeathLink
goofy_death_link: GoofyDeathLink
randomize_keyblade_stats: RandomizeKeybladeStats
keyblade_stats: KeybladeStats
bad_starting_weapons: BadStartingWeapons
keyblade_min_str: KeybladeMinStrength
keyblade_max_str: KeybladeMaxStrength
Expand All @@ -403,13 +451,16 @@ class KH1Options(PerGameCommonOptions):
RequiredReportsDoor,
RequiredReportsEotW,
ReportsInPool,
RequiredPostcards,
RequiredPuppies,
]),
OptionGroup("Locations", [
SuperBosses,
Atlantica,
Cups,
HundredAcreWood,
VanillaEmblemPieces,
RandomizePostcards,
]),
OptionGroup("Levels", [
EXPMultiplier,
Expand All @@ -425,7 +476,7 @@ class KH1Options(PerGameCommonOptions):
]),
OptionGroup("Keyblades", [
KeybladesUnlockChests,
RandomizeKeybladeStats,
KeybladeStats,
BadStartingWeapons,
KeybladeMaxStrength,
KeybladeMinStrength,
Expand Down
20 changes: 16 additions & 4 deletions worlds/kh1/Presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
"required_reports_eotw": 7,
"required_reports_door": 10,
"reports_in_pool": 13,
"required_postcards": 10,
"required_puppies": 99,

"super_bosses": False,
"atlantica": False,
"hundred_acre_wood": False,
"cups": False,
"vanilla_emblem_pieces": True,
"randomize_postcards": RandomizePostcards.option_all,

"exp_multiplier": 48,
"level_checks": 100,
Expand All @@ -30,7 +33,7 @@
"item_slot_increase": 3,

"keyblades_unlock_chests": False,
"randomize_keyblade_stats": True,
"keyblade_stats": KeybladeStats.option_randomize,
"bad_starting_weapons": False,
"keyblade_max_str": 14,
"keyblade_min_str": 3,
Expand All @@ -54,12 +57,15 @@
"required_reports_eotw": 13,
"required_reports_door": 13,
"reports_in_pool": 13,
"required_postcards": 10,
"required_puppies": 99,

"super_bosses": False,
"atlantica": False,
"hundred_acre_wood": False,
"cups": False,
"vanilla_emblem_pieces": True,
"randomize_postcards": RandomizePostcards.option_all,

"exp_multiplier": 48,
"level_checks": 100,
Expand All @@ -73,7 +79,7 @@
"item_slot_increase": 3,

"keyblades_unlock_chests": False,
"randomize_keyblade_stats": True,
"keyblade_stats": KeybladeStats.option_randomize,
"bad_starting_weapons": False,
"keyblade_max_str": 14,
"keyblade_min_str": 3,
Expand All @@ -97,12 +103,15 @@
"required_reports_eotw": 7,
"required_reports_door": 10,
"reports_in_pool": 13,
"required_postcards": 10,
"required_puppies": 99,

"super_bosses": True,
"atlantica": True,
"hundred_acre_wood": True,
"cups": True,
"vanilla_emblem_pieces": False,
"randomize_postcards": RandomizePostcards.option_all,

"exp_multiplier": 48,
"level_checks": 100,
Expand All @@ -116,7 +125,7 @@
"item_slot_increase": 3,

"keyblades_unlock_chests": True,
"randomize_keyblade_stats": True,
"keyblade_stats": KeybladeStats.option_randomize,
"bad_starting_weapons": True,
"keyblade_max_str": 14,
"keyblade_min_str": 3,
Expand All @@ -140,12 +149,15 @@
"required_reports_eotw": 7,
"required_reports_door": 10,
"reports_in_pool": 13,
"required_postcards": 10,
"required_puppies": 99,

"super_bosses": False,
"atlantica": False,
"hundred_acre_wood": False,
"cups": False,
"vanilla_emblem_pieces": True,
"randomize_postcards": RandomizePostcards.option_all,

"exp_multiplier": 16,
"level_checks": 0,
Expand All @@ -158,7 +170,7 @@
"item_slot_increase": 5,

"keyblades_unlock_chests": False,
"randomize_keyblade_stats": True,
"keyblade_stats": KeybladeStats.option_randomize,
"bad_starting_weapons": False,
"keyblade_max_str": 14,
"keyblade_min_str": 3,
Expand Down
Loading

0 comments on commit 24dbd09

Please sign in to comment.