From 27c3bfa7566f67dd6c03309513962b1d7787f9c4 Mon Sep 17 00:00:00 2001 From: SunnyBat Date: Sun, 5 May 2024 10:15:22 -0700 Subject: [PATCH 1/7] Move away from deprecated options reading --- worlds/yooka_laylee/__init__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/worlds/yooka_laylee/__init__.py b/worlds/yooka_laylee/__init__.py index 3b9bb99e8a47..5b9329f324e4 100644 --- a/worlds/yooka_laylee/__init__.py +++ b/worlds/yooka_laylee/__init__.py @@ -44,7 +44,7 @@ class YookaWorld(World): required_client_version = (1, 0, 0) def create_items(self): - if not self.multiworld.prevent_tropics_bk[self.player]: + if not self.options.prevent_tropics_bk: logging.warn("Yooka-Laylee: Prevent Tropics BK not enabled. World generation may fail with only Yooka-Laylee worlds.") # Set up prefill data for later @@ -54,22 +54,22 @@ def create_items(self): # Decide on which ability to prefill firstAbilityOptions = ["Tail Twirl", "Sonar 'Splosion", "Buddy Slam", "Flappy Flight"] - if self.multiworld.flappy_flight_location[self.player] == 1: + if self.options.flappy_flight_location == 1: firstAbilityOptions = ["Flappy Flight"] - elif self.multiworld.flappy_flight_location[self.player] == 2: + elif self.options.flappy_flight_location == 2: firstAbilityOptions.append("Flappy Flight") damagingAbilityToInsert = self.multiworld.random.choice(firstAbilityOptions) antiBkPagieLocationToUse = None antiBkLocationToUse = None antiBkItemNameToInsert = None - if not self.multiworld.force_local_first_item[self.player]: + if not self.options.force_local_first_item: self.multiworld.early_items[self.player][damagingAbilityToInsert] = 1 - if damagingAbilityToInsert != "Flappy Flight" and self.multiworld.prevent_tropics_bk[self.player]: + if damagingAbilityToInsert != "Flappy Flight" and self.options.prevent_tropics_bk: antiBkLocations = ["Trowzer's Reptile Roll", "On Top of Capital B Statue"] if damagingAbilityToInsert == "Buddy Slam": antiBkLocations.append("Hivory Towers Energy Booster") antiBkItems = ["Reptile Roll", "Reptile Roll", "Reptile Roll"] - if self.multiworld.flappy_flight_location[self.player] != 3: + if self.options.flappy_flight_location != 3: antiBkItems.append("Flappy Flight") # 25% chance for FF if allowed # Set up ability placement info antiBkLocationToUse = self.multiworld.random.choice(antiBkLocations) @@ -83,9 +83,9 @@ def create_items(self): for item in item_table: for _ in range(item["quantity"]): yooka_item = self.create_item(item["name"]) - if item["name"] == "Flappy Flight" and self.multiworld.flappy_flight_location[self.player] == 3: + if item["name"] == "Flappy Flight" and self.options.flappy_flight_location == 3: self.multiworld.yookaLaylee_prefillItems[self.player]["Trowzer's Flappy Flight"] = yooka_item - elif item["name"] == damagingAbilityToInsert and self.multiworld.force_local_first_item[self.player]: + elif item["name"] == damagingAbilityToInsert and self.options.force_local_first_item: self.multiworld.yookaLaylee_prefillItems[self.player]["Trowzer's Tail Twirl"] = yooka_item elif item["name"] == antiBkItemNameToInsert: self.multiworld.yookaLaylee_prefillItems[self.player][antiBkLocationToUse] = yooka_item @@ -129,9 +129,9 @@ def pre_fill(self): def fill_slot_data(self): return { - "CapitalBPagieCount": self.multiworld.capital_b_pagie_count[self.player].value, - "DisableQuizzes": bool(self.multiworld.disable_quizzes[self.player].value), - "DeathLink": bool(self.multiworld.death_link[self.player].value) + "CapitalBPagieCount": self.options.capital_b_pagie_count.value, + "DisableQuizzes": bool(self.options.disable_quizzes.value), + "DeathLink": bool(self.options.death_link.value) } def create_region(world: MultiWorld, player: int, name: str, locations=None, exits=None): From a95b224681a88855cf647d75a2a89b056276c3a4 Mon Sep 17 00:00:00 2001 From: SunnyBat Date: Sun, 5 May 2024 10:44:48 -0700 Subject: [PATCH 2/7] Small touchups, comments --- worlds/yooka_laylee/__init__.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/worlds/yooka_laylee/__init__.py b/worlds/yooka_laylee/__init__.py index 5b9329f324e4..4c19c782be60 100644 --- a/worlds/yooka_laylee/__init__.py +++ b/worlds/yooka_laylee/__init__.py @@ -44,33 +44,40 @@ class YookaWorld(World): required_client_version = (1, 0, 0) def create_items(self): - if not self.options.prevent_tropics_bk: - logging.warn("Yooka-Laylee: Prevent Tropics BK not enabled. World generation may fail with only Yooka-Laylee worlds.") - # Set up prefill data for later if not hasattr(self.multiworld, "yookaLaylee_prefillItems"): self.multiworld.yookaLaylee_prefillItems = {} self.multiworld.yookaLaylee_prefillItems[self.player] = {} # Decide on which ability to prefill - firstAbilityOptions = ["Tail Twirl", "Sonar 'Splosion", "Buddy Slam", "Flappy Flight"] + firstAbilityOptions = ["Tail Twirl", "Sonar 'Splosion", "Buddy Slam"] if self.options.flappy_flight_location == 1: firstAbilityOptions = ["Flappy Flight"] elif self.options.flappy_flight_location == 2: firstAbilityOptions.append("Flappy Flight") + # We decide on the damaging ability that we will be using for breaking the chests + # that contain quillies at the beginning of the game. This ability is guaranteed + # to show up very early. damagingAbilityToInsert = self.multiworld.random.choice(firstAbilityOptions) antiBkPagieLocationToUse = None antiBkLocationToUse = None antiBkItemNameToInsert = None + # If we're not forcing a local first item, we instead put a damaging ability in the + # early_items pool so we don't get completely stuck at the very beginning. + # If we are forcing a local first item, we don't need to worry about this, since + # we're guaranteed to not be stuck. if not self.options.force_local_first_item: self.multiworld.early_items[self.player][damagingAbilityToInsert] = 1 + # If we've selected FF for the first ability, we're unblocked from everything if damagingAbilityToInsert != "Flappy Flight" and self.options.prevent_tropics_bk: antiBkLocations = ["Trowzer's Reptile Roll", "On Top of Capital B Statue"] - if damagingAbilityToInsert == "Buddy Slam": + if damagingAbilityToInsert == "Buddy Slam": # Can Buddy Slam statue nose for Energy Booster antiBkLocations.append("Hivory Towers Energy Booster") - antiBkItems = ["Reptile Roll", "Reptile Roll", "Reptile Roll"] - if self.options.flappy_flight_location != 3: - antiBkItems.append("Flappy Flight") # 25% chance for FF if allowed + antiBkItems = ["Reptile Roll"] * 3 + if self.options.flappy_flight_location == 4: # If Anywhere, significantly decrease the odds of rolling FF + antiBkItems += ["Reptile Roll"] * 6 + if self.options.flappy_flight_location != 3: # As long as FF isn't forced vanilla, it's an option for anti-BK + antiBkItems.append("Flappy Flight") # Set up ability placement info antiBkLocationToUse = self.multiworld.random.choice(antiBkLocations) antiBkItemNameToInsert = self.multiworld.random.choice(antiBkItems) From 63652966b2044126a116e6fc5a1a6ea80cebb5b9 Mon Sep 17 00:00:00 2001 From: SunnyBat Date: Sun, 5 May 2024 10:57:25 -0700 Subject: [PATCH 3/7] Remove priority locations, use self.random --- worlds/yooka_laylee/Locations.py | 2 -- worlds/yooka_laylee/__init__.py | 24 ++++++++++++------------ worlds/yooka_laylee/locations.json | 3 +-- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/worlds/yooka_laylee/Locations.py b/worlds/yooka_laylee/Locations.py index 2de260d88b0d..e4813cd222f7 100644 --- a/worlds/yooka_laylee/Locations.py +++ b/worlds/yooka_laylee/Locations.py @@ -7,7 +7,5 @@ priority_locations = [] for item in location_table: lookup_name_to_id[item["name"]] = item["id"] - if "type" in item and item["type"] == "Priority": - priority_locations.append(item["name"]) lookup_name_to_id["Game Complete"] = None \ No newline at end of file diff --git a/worlds/yooka_laylee/__init__.py b/worlds/yooka_laylee/__init__.py index 4c19c782be60..3282632542ba 100644 --- a/worlds/yooka_laylee/__init__.py +++ b/worlds/yooka_laylee/__init__.py @@ -55,10 +55,10 @@ def create_items(self): firstAbilityOptions = ["Flappy Flight"] elif self.options.flappy_flight_location == 2: firstAbilityOptions.append("Flappy Flight") - # We decide on the damaging ability that we will be using for breaking the chests + # We decide on the first ability that we will be using for breaking the chests # that contain quillies at the beginning of the game. This ability is guaranteed # to show up very early. - damagingAbilityToInsert = self.multiworld.random.choice(firstAbilityOptions) + firstAbilityToInsert = self.random.choice(firstAbilityOptions) antiBkPagieLocationToUse = None antiBkLocationToUse = None antiBkItemNameToInsert = None @@ -67,11 +67,13 @@ def create_items(self): # If we are forcing a local first item, we don't need to worry about this, since # we're guaranteed to not be stuck. if not self.options.force_local_first_item: - self.multiworld.early_items[self.player][damagingAbilityToInsert] = 1 - # If we've selected FF for the first ability, we're unblocked from everything - if damagingAbilityToInsert != "Flappy Flight" and self.options.prevent_tropics_bk: + self.multiworld.early_items[self.player][firstAbilityToInsert] = 1 + # If we've selected FF for the first ability, we're unblocked from everything. + # Otherwise, if we want to prevent Tropics BK, we need to insert an ability that + # can get us to Tropics into a location we can reach. + if firstAbilityToInsert != "Flappy Flight" and self.options.prevent_tropics_bk: antiBkLocations = ["Trowzer's Reptile Roll", "On Top of Capital B Statue"] - if damagingAbilityToInsert == "Buddy Slam": # Can Buddy Slam statue nose for Energy Booster + if firstAbilityToInsert == "Buddy Slam": # Can Buddy Slam statue nose for Energy Booster antiBkLocations.append("Hivory Towers Energy Booster") antiBkItems = ["Reptile Roll"] * 3 if self.options.flappy_flight_location == 4: # If Anywhere, significantly decrease the odds of rolling FF @@ -79,11 +81,11 @@ def create_items(self): if self.options.flappy_flight_location != 3: # As long as FF isn't forced vanilla, it's an option for anti-BK antiBkItems.append("Flappy Flight") # Set up ability placement info - antiBkLocationToUse = self.multiworld.random.choice(antiBkLocations) - antiBkItemNameToInsert = self.multiworld.random.choice(antiBkItems) + antiBkLocationToUse = self.random.choice(antiBkLocations) + antiBkItemNameToInsert = self.random.choice(antiBkItems) # Set up pagie placement info antiBkLocations.remove(antiBkLocationToUse) - antiBkPagieLocationToUse = self.multiworld.random.choice(antiBkLocations) + antiBkPagieLocationToUse = self.random.choice(antiBkLocations) # Generate item pool pool = [] @@ -92,7 +94,7 @@ def create_items(self): yooka_item = self.create_item(item["name"]) if item["name"] == "Flappy Flight" and self.options.flappy_flight_location == 3: self.multiworld.yookaLaylee_prefillItems[self.player]["Trowzer's Flappy Flight"] = yooka_item - elif item["name"] == damagingAbilityToInsert and self.options.force_local_first_item: + elif item["name"] == firstAbilityToInsert and self.options.force_local_first_item: self.multiworld.yookaLaylee_prefillItems[self.player]["Trowzer's Tail Twirl"] = yooka_item elif item["name"] == antiBkItemNameToInsert: self.multiworld.yookaLaylee_prefillItems[self.player][antiBkLocationToUse] = yooka_item @@ -147,8 +149,6 @@ def create_region(world: MultiWorld, player: int, name: str, locations=None, exi for location in locations: loc_id = locations_lookup_name_to_id.get(location, 0) locationObj = YookaLocation(player, location, loc_id, ret) - if location in locations_priority_locations: - locationObj.progress_type = LocationProgressType.PRIORITY ret.locations.append(locationObj) if exits: for exit in exits: diff --git a/worlds/yooka_laylee/locations.json b/worlds/yooka_laylee/locations.json index b0cedab2208b..fdbbb43ee819 100644 --- a/worlds/yooka_laylee/locations.json +++ b/worlds/yooka_laylee/locations.json @@ -2750,8 +2750,7 @@ { "id": 625491500, "name": "Trowzer's Tail Twirl", - "region": "Shipwreck Creek", - "type": "Priority" + "region": "Shipwreck Creek" }, { "id": 625491501, From 80082425402420503ead7ca099cf8048fb07648f Mon Sep 17 00:00:00 2001 From: SunnyBat Date: Sun, 5 May 2024 11:01:48 -0700 Subject: [PATCH 4/7] Clean up imports --- worlds/yooka_laylee/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/worlds/yooka_laylee/__init__.py b/worlds/yooka_laylee/__init__.py index 3282632542ba..12b29a37d39a 100644 --- a/worlds/yooka_laylee/__init__.py +++ b/worlds/yooka_laylee/__init__.py @@ -1,15 +1,11 @@ -import typing -import random -import logging - -from .Locations import location_table, lookup_name_to_id as locations_lookup_name_to_id, priority_locations as locations_priority_locations +from .Locations import lookup_name_to_id as locations_lookup_name_to_id from .Items import (item_table, lookup_name_to_item, lookup_name_to_id as items_lookup_name_to_id) from .Regions import create_regions, getConnectionName from .Rules import set_rules from .Options import yooka_options -from BaseClasses import Region, Entrance, Location, MultiWorld, Item, ItemClassification, Tutorial, LocationProgressType +from BaseClasses import Region, Entrance, Location, MultiWorld, Item, ItemClassification, Tutorial from ..AutoWorld import World, WebWorld From ee7aedd04dd3aeb4f5b4eb07ada7877c108a68d6 Mon Sep 17 00:00:00 2001 From: SunnyBat Date: Sun, 19 May 2024 19:31:50 -0700 Subject: [PATCH 5/7] Rename doc --- worlds/yooka_laylee/docs/en_Yooka-Laylee.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worlds/yooka_laylee/docs/en_Yooka-Laylee.md b/worlds/yooka_laylee/docs/en_Yooka-Laylee.md index 53edc0ef386f..11a6818b8a4d 100644 --- a/worlds/yooka_laylee/docs/en_Yooka-Laylee.md +++ b/worlds/yooka_laylee/docs/en_Yooka-Laylee.md @@ -1,4 +1,4 @@ -# Raft +# Yooka-Laylee ## Where is the settings page? The player settings page for this game is located here. It contains all the options From 5190b1eb1d3d9ed1cb28a3531d0b85111a442f6b Mon Sep 17 00:00:00 2001 From: SunnyBat Date: Sat, 25 May 2024 19:09:17 -0700 Subject: [PATCH 6/7] Make Cashino token requirements work --- worlds/yooka_laylee/Rules.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worlds/yooka_laylee/Rules.py b/worlds/yooka_laylee/Rules.py index 3602ac3d3314..8f98d966ed11 100644 --- a/worlds/yooka_laylee/Rules.py +++ b/worlds/yooka_laylee/Rules.py @@ -101,8 +101,8 @@ def yookaLaylee_can_access_end(self, player): # Technically don't need Tail Twir def yookaLaylee_can_get_cashino_token_count(self, player, tokenCount): accessibleTokenCount = 0 for tokenGroup in cashinotokens_table: - if "abilityRequirements" in tokenGroup: - if self.yookaLaylee_has_requirements(tokenGroup["abilityRequirements"], player): + if "requiresAbilities" in tokenGroup: + if self.yookaLaylee_has_requirements(tokenGroup["requiresAbilities"], player): accessibleTokenCount += tokenGroup["count"] else: accessibleTokenCount += tokenGroup["count"] From 1955b3c7885d0751cb3df0fabd26319d03f9b0b8 Mon Sep 17 00:00:00 2001 From: SunnyBat Date: Sat, 25 May 2024 19:09:26 -0700 Subject: [PATCH 7/7] Fix ability requirements --- worlds/yooka_laylee/locations.json | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/worlds/yooka_laylee/locations.json b/worlds/yooka_laylee/locations.json index fdbbb43ee819..5b1dae7e50ed 100644 --- a/worlds/yooka_laylee/locations.json +++ b/worlds/yooka_laylee/locations.json @@ -214,7 +214,17 @@ "id": 625490520, "name": "Novel Puzzle", "region": "Hivory Towers Outside (NoFlight)", - "requiresAbilities": "Lizard Lash" + "requiresAbilities": { + "AND": [ + "Lizard Lash", + { + "OR": [ + "Camo Cloak", + "Flappy Flight" + ] + } + ] + } }, { "id": 625490536, @@ -730,6 +740,7 @@ "Flappy Flight" ] }, + "Slurp State", "Glacier Mollycool" ] } @@ -1731,7 +1742,7 @@ }, { "id": 625490627, - "name": "Rextro's Arcade (Hurdle Hijinx)", + "name": "Rextro's Hi-Score (Hurdle Hijinx)", "region": "Capital Cashino", "requiresAbilities": { "AND": [ @@ -1742,7 +1753,7 @@ }, { "id": 625490628, - "name": "Rextro's Hi-Score (Hurdle Hijinx)", + "name": "Rextro's Arcade (Hurdle Hijinx)", "region": "Capital Cashino", "requiresAbilities": { "AND": [ @@ -2502,9 +2513,14 @@ "Lizard Leap" ] }, + { + "OR": [ + "Sonar 'Splosion", + "Sonar Shot" + ] + }, "Reptile Roll", - "Slurp State", - "Sonar Shot" + "Slurp State" ] }, "Flappy Flight"