mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Factorio: cleanup and optimize some requirement graph functions
This commit is contained in:
@@ -131,6 +131,7 @@ class Recipe(FactorioElement):
|
||||
base = {technology_table[tech_name] for tech_name in recipe_sources.get(self.name, ())}
|
||||
for ingredient in self.ingredients:
|
||||
base |= required_technologies[ingredient]
|
||||
base |= required_technologies[self.crafting_machine]
|
||||
return base
|
||||
|
||||
@property
|
||||
@@ -472,7 +473,7 @@ def get_science_pack_pools() -> Dict[str, Set[str]]:
|
||||
cost += rel_cost.get(ingredient_name, 1) * amount
|
||||
return cost
|
||||
|
||||
science_pack_pools = {}
|
||||
science_pack_pools: Dict[str, Set[str]] = {}
|
||||
already_taken = blacklist.copy()
|
||||
current_difficulty = 5
|
||||
for science_pack in Options.MaxSciencePack.get_ordered_science_packs():
|
||||
@@ -483,7 +484,8 @@ def get_science_pack_pools() -> Dict[str, Set[str]]:
|
||||
current |= set(recipe.products)
|
||||
if science_pack == "automation-science-pack":
|
||||
current |= {"iron-ore", "copper-ore", "coal", "stone"}
|
||||
current -= liquids # Can't hand craft automation science if liquids end up in its recipe, making the seed impossible.
|
||||
# Can't hand craft automation science if liquids end up in its recipe, making the seed impossible.
|
||||
current -= liquids
|
||||
elif science_pack == "logistic-science-pack":
|
||||
current |= {"steam"}
|
||||
current -= already_taken
|
||||
|
||||
Reference in New Issue
Block a user