From 20119e3162f17d8af060377986921cee54836e59 Mon Sep 17 00:00:00 2001 From: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:35:01 -0500 Subject: [PATCH] Faxanadu: Fix generations with itemlinks (#4395) --- worlds/faxanadu/__init__.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/worlds/faxanadu/__init__.py b/worlds/faxanadu/__init__.py index c4ae1cca..ca17c067 100644 --- a/worlds/faxanadu/__init__.py +++ b/worlds/faxanadu/__init__.py @@ -44,8 +44,13 @@ class FaxanaduWorld(World): location_name_to_id = {loc.name: loc.id for loc in Locations.locations if loc.id is not None} def __init__(self, world: MultiWorld, player: int): - self.filler_ratios: Dict[str, int] = {} - + self.filler_ratios: Dict[str, int] = { + item.name: item.count + for item in Items.items + if item.classification in [ItemClassification.filler, ItemClassification.trap] + } + # Remove poison by default to respect itemlinking + self.filler_ratios["Poison"] = 0 super().__init__(world, player) def create_regions(self): @@ -160,19 +165,13 @@ class FaxanaduWorld(World): for i in range(item.progression_count): itempool.append(FaxanaduItem(item.name, ItemClassification.progression, item.id, self.player)) - # Set up filler ratios - self.filler_ratios = { - item.name: item.count - for item in Items.items - if item.classification in [ItemClassification.filler, ItemClassification.trap] - } - + # Adjust filler ratios # If red potions are locked in shops, remove the count from the ratio. self.filler_ratios["Red Potion"] -= red_potion_in_shop_count - # Remove poisons if not desired - if not self.options.include_poisons: - self.filler_ratios["Poison"] = 0 + # Add poisons if desired + if self.options.include_poisons: + self.filler_ratios["Poison"] = self.item_name_to_item["Poison"].count # Randomly add fillers to the pool with ratios based on og game occurrence counts. filler_count = len(Locations.locations) - len(itempool) - prefilled_count