commit
cba9dad4aa
1 changed files with 13 additions and 5 deletions
|
|
@ -20,14 +20,22 @@ if mods["crafting-efficiency-2"] then
|
||||||
|
|
||||||
for i, recipe in pairs(recipes) do
|
for i, recipe in pairs(recipes) do
|
||||||
-- add remaining recipes with direct items to find the icons
|
-- add remaining recipes with direct items to find the icons
|
||||||
if data.raw.recipe[recipe] and data.raw.item[recipe] and not eff_data[recipe] and
|
if data.raw.recipe[recipe] and data.raw.item[recipe] and not eff_data[recipe] then
|
||||||
(data.raw.recipe[recipe].main_product or util.get_result_count(recipe) == 1) then
|
local research_level = 1
|
||||||
|
if not data.raw.recipe[recipe].enabled then
|
||||||
|
for tech, tbl in pairs(data.raw.technology) do
|
||||||
|
for _, effect in pairs(tbl.effects or {}) do
|
||||||
|
if effect.type == "unlock-recipe" and effect.recipe == recipe then
|
||||||
|
research_level = math.min(#tbl.unit.ingredients, 6)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
eff_data[recipe] = {
|
eff_data[recipe] = {
|
||||||
name = recipe.." efficiency",
|
|
||||||
max = 15,
|
max = 15,
|
||||||
icon = data.raw.item[recipe].icon,
|
icon = data.raw.item[recipe].icon,
|
||||||
crafting = { efficiency = 10 },
|
crafting = { efficiency = 10 },
|
||||||
research = { level = 6 },
|
research = { level = research_level },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue