diff --git a/changelog.txt b/changelog.txt index b90c67c..8e04553 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 0.0.11 +Date: 2022-01-17 + Features: + - (Beta) Crafting efficiency compatibility + Localization: + - ru by CV514 +--------------------------------------------------------------------------------------------------- Version: 0.0.10 Date: 2022-01-06 Fixes: diff --git a/compatibility/crafting-efficiency.lua b/compatibility/crafting-efficiency.lua new file mode 100644 index 0000000..282f6e5 --- /dev/null +++ b/compatibility/crafting-efficiency.lua @@ -0,0 +1,26 @@ +local util = require("data-util"); + +if mods["crafting-efficiency-2"] then + + local eff_data = { + } + + for i, recipe in pairs(util.me.recipes) do + -- 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]) + and not eff_data[recipe] and + (data.raw.recipe[recipe].main_product or util.get_result_count(recipe) == 1) then + eff_data[recipe] = { + max = 15, + icon = data.raw.item[recipe] and data.raw.item[recipe].icon or data.raw.fluid[recipe].icon, + crafting = { efficiency = 10 }, + research = { level = 6 }, + } + end + end + for recipe, d in pairs(eff_data) do + log("Adding "..recipe.." crafting efficiency") + d.name = recipe:gsub("^%l", string.upper).." efficiency" + CE_Add_Recipe(d, recipe) + end +end diff --git a/data-updates.lua b/data-updates.lua index 3c130e5..d962c1a 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -5,7 +5,7 @@ require("map-gen-preset-updates") -- require("strange-matter") -- require("compatibility/248k") require("compatibility/bob") - +require("compatibility/crafting-efficiency") require("prototypes/assembler-updates") local util = require("data-util") diff --git a/info.json b/info.json index 4eaeafe..ae4713c 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzchlorine", - "version": "0.0.10", + "version": "0.0.11", "factorio_version": "1.1", "title": "Salt & Chlorine", "author": "Brevven", diff --git a/me.lua b/me.lua index b8c27c6..d62747c 100644 --- a/me.lua +++ b/me.lua @@ -2,6 +2,8 @@ local me = {} me.name = "bzchlorine" me.list = {} +-- Recipes with very specific ratios are deliberately excluded +me.recipes = {"chlorine", "epoxy", "pcb-substrate", "pcb", "bakelite-hcl"} function me.starting_patch() return ( diff --git a/modules.lua b/modules.lua index 10d7860..ac4d9eb 100644 --- a/modules.lua +++ b/modules.lua @@ -1,10 +1,7 @@ -- Enable prod modules for some recipes --- Recipes with very specific ratios are deliberately excluded -recipes = {"chlorine", "epoxy", "pcb-substrate", "pcb", "bakelite-hcl"} -if mods["Krastorio2"] then -end +local util = require("data-util") -for i, recipe in pairs(recipes) do +for i, recipe in pairs(util.me.recipes) do if data.raw.recipe[recipe] then for j, module in pairs(data.raw.module) do if module.effect then