Factorio: remove option to turn off random_tech_ingredients

This commit is contained in:
Fabian Dill 2021-06-16 23:41:38 +02:00
parent 3ee88fd8fe
commit a5bf3a8407
2 changed files with 1 additions and 2 deletions

View File

@ -433,7 +433,6 @@ factorio_options: typing.Dict[str, type(Option)] = {"max_science_pack": MaxScien
"tech_cost": TechCost, "tech_cost": TechCost,
"free_samples": FreeSamples, "free_samples": FreeSamples,
"visibility": Visibility, "visibility": Visibility,
"random_tech_ingredients": Toggle,
"starting_items": FactorioStartItems, "starting_items": FactorioStartItems,
"recipe_time": RecipeTime} "recipe_time": RecipeTime}

View File

@ -66,7 +66,7 @@ class CustomTechnology(Technology):
def __init__(self, origin: Technology, world, allowed_packs: Set[str], player: int): def __init__(self, origin: Technology, world, allowed_packs: Set[str], player: int):
ingredients = origin.ingredients & allowed_packs ingredients = origin.ingredients & allowed_packs
self.player = player self.player = player
if world.random_tech_ingredients[player] and origin.name not in world.worlds[player].static_nodes: if origin.name not in world.worlds[player].static_nodes:
ingredients = list(ingredients) ingredients = list(ingredients)
ingredients.sort() # deterministic sample ingredients.sort() # deterministic sample
ingredients = world.random.sample(ingredients, world.random.randint(1, len(ingredients))) ingredients = world.random.sample(ingredients, world.random.randint(1, len(ingredients)))