mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Factorio: fix random rocket recipe
This commit is contained in:
@@ -189,11 +189,14 @@ class Factorio(World):
|
|||||||
max_energy = remaining_energy * 0.75
|
max_energy = remaining_energy * 0.75
|
||||||
min_energy = (remaining_energy - max_energy) / remaining_num_ingredients
|
min_energy = (remaining_energy - max_energy) / remaining_num_ingredients
|
||||||
ingredient = pool.pop()
|
ingredient = pool.pop()
|
||||||
if ingredient in ['stone', 'iron-ore', 'copper-ore', 'coal']:
|
if ingredient in all_product_sources:
|
||||||
continue
|
|
||||||
ingredient_recipe = min(all_product_sources[ingredient], key=lambda recipe: recipe.rel_cost)
|
ingredient_recipe = min(all_product_sources[ingredient], key=lambda recipe: recipe.rel_cost)
|
||||||
ingredient_raw = sum((count for ingredient, count in ingredient_recipe.base_cost.items()))
|
ingredient_raw = sum((count for ingredient, count in ingredient_recipe.base_cost.items()))
|
||||||
ingredient_energy = ingredient_recipe.total_energy
|
ingredient_energy = ingredient_recipe.total_energy
|
||||||
|
else:
|
||||||
|
# assume simple ore TODO: remove if tree when mining data is harvested from Factorio
|
||||||
|
ingredient_raw = 1
|
||||||
|
ingredient_energy = 2
|
||||||
min_num_raw = min_raw / ingredient_raw
|
min_num_raw = min_raw / ingredient_raw
|
||||||
max_num_raw = max_raw / ingredient_raw
|
max_num_raw = max_raw / ingredient_raw
|
||||||
min_num_energy = min_energy / ingredient_energy
|
min_num_energy = min_energy / ingredient_energy
|
||||||
|
Reference in New Issue
Block a user