Faxanadu: Fix generations with itemlinks (#4395)
This commit is contained in:
parent
4cb8fa3cdd
commit
20119e3162
|
@ -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}
|
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):
|
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)
|
super().__init__(world, player)
|
||||||
|
|
||||||
def create_regions(self):
|
def create_regions(self):
|
||||||
|
@ -160,19 +165,13 @@ class FaxanaduWorld(World):
|
||||||
for i in range(item.progression_count):
|
for i in range(item.progression_count):
|
||||||
itempool.append(FaxanaduItem(item.name, ItemClassification.progression, item.id, self.player))
|
itempool.append(FaxanaduItem(item.name, ItemClassification.progression, item.id, self.player))
|
||||||
|
|
||||||
# Set up filler ratios
|
# Adjust filler ratios
|
||||||
self.filler_ratios = {
|
|
||||||
item.name: item.count
|
|
||||||
for item in Items.items
|
|
||||||
if item.classification in [ItemClassification.filler, ItemClassification.trap]
|
|
||||||
}
|
|
||||||
|
|
||||||
# If red potions are locked in shops, remove the count from the ratio.
|
# If red potions are locked in shops, remove the count from the ratio.
|
||||||
self.filler_ratios["Red Potion"] -= red_potion_in_shop_count
|
self.filler_ratios["Red Potion"] -= red_potion_in_shop_count
|
||||||
|
|
||||||
# Remove poisons if not desired
|
# Add poisons if desired
|
||||||
if not self.options.include_poisons:
|
if self.options.include_poisons:
|
||||||
self.filler_ratios["Poison"] = 0
|
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.
|
# Randomly add fillers to the pool with ratios based on og game occurrence counts.
|
||||||
filler_count = len(Locations.locations) - len(itempool) - prefilled_count
|
filler_count = len(Locations.locations) - len(itempool) - prefilled_count
|
||||||
|
|
Loading…
Reference in New Issue