Everything efficiency.

This commit is contained in:
Nihilistzsche 2023-02-10 17:11:04 -08:00
parent 2e41b14809
commit 5db25cd8a0
No known key found for this signature in database
GPG key ID: E046460F41BAA12C
2 changed files with 15 additions and 14 deletions

View file

@ -8,20 +8,17 @@ if mods["crafting-efficiency-2"] then
for i, recipe in pairs(util.me.recipes) do for i, recipe in pairs(util.me.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] or data.raw.fluid[recipe]) if data.raw.recipe[recipe] and (data.raw.item[recipe] or data.raw.fluid[recipe])
and not eff_data[recipe] and and not eff_data[recipe] then
(data.raw.recipe[recipe].main_product or util.get_result_count(recipe) == 1) then local research_level = 1
local research_level = 6 if not data.raw.recipe[recipe].enabled then
if data.raw.recipe[recipe].enabled then for tech, tbl in pairs(data.raw.technology) do
research_level = 1 for _, effect in pairs(tbl.effects or {}) do
else if effect.type == "unlock-recipe" and effect.recipe == recipe then
for tech, tbl in pairs(data.raw.technology) do research_level = math.min(#tbl.unit.ingredients, 6)
for _, effect in pairs(tbl.effects or {}) do end
if effect.type == "unlock-recipe" and effect.recipe == recipe then end
research_level = math.min(#tbl.unit.ingredients, research_level) end
end end
end
end
end
eff_data[recipe] = { eff_data[recipe] = {
max = 15, max = 15,
icon = data.raw.item[recipe] and data.raw.item[recipe].icon or data.raw.fluid[recipe].icon, icon = data.raw.item[recipe] and data.raw.item[recipe].icon or data.raw.fluid[recipe].icon,

View file

@ -37,8 +37,10 @@ if data.raw.item["coke"] then
category = cat, category = cat,
main_product = "phenol", main_product = "phenol",
enabled = "false", enabled = "false",
icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128,
ingredients = {{"coal", 6}, {"wood", 6}}, ingredients = {{"coal", 6}, {"wood", 6}},
energy_required = 16, energy_required = 16,
subgroup = "raw-material",
results = { results = {
{type="item", name="phenol", amount = 6}, {type="item", name="phenol", amount = 6},
{type="item", name="coke", amount = 3}, {type="item", name="coke", amount = 3},
@ -53,8 +55,10 @@ if data.raw.item["coke"] then
category = cat, category = cat,
main_product = "phenol", main_product = "phenol",
enabled = "false", enabled = "false",
icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128,
ingredients = {{"coal", 4}}, ingredients = {{"coal", 4}},
energy_required = 6.4, energy_required = 6.4,
subgroup = "raw-material",
results = { results = {
{type="item", name="phenol", amount = 2}, {type="item", name="phenol", amount = 2},
{type="item", name="coke", amount = 1}, {type="item", name="coke", amount = 1},