Merge pull request #8 from nihilistzsche/main

Everything efficiency.
This commit is contained in:
brevven 2023-02-11 22:25:48 -08:00 committed by GitHub
commit 0a98f1212f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 14 deletions

View file

@ -8,16 +8,13 @@ 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
research_level = 1
else
for tech, tbl in pairs(data.raw.technology) do for tech, tbl in pairs(data.raw.technology) do
for _, effect in pairs(tbl.effects or {}) do for _, effect in pairs(tbl.effects or {}) do
if effect.type == "unlock-recipe" and effect.recipe == recipe then if effect.type == "unlock-recipe" and effect.recipe == recipe then
research_level = math.min(#tbl.unit.ingredients, research_level) research_level = math.min(#tbl.unit.ingredients, 6)
end end
end end
end end

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},