crafting efficiency

This commit is contained in:
Brevven 2023-01-14 22:08:03 -08:00
parent 877c1681ab
commit 62c72a8ec4
6 changed files with 67 additions and 15 deletions

View file

@ -1,20 +1,7 @@
-- Enable prod modules for all recipes
local util = require("data-util");
recipes = {
"graphite",
"synthetic-diamond",
"graphene",
"heavy-water-graphene",
"enriched-graphite",
"fullerenes",
"nanotubes",
"diamond-synthesis-vulcanite",
-- NOTE: Carbon black recipes do not allow prod modules
}
local recipes = util.me.recipes
-- Add all *-nanotubes recipes that exist
local ending = "-nanotubes"

View file

@ -1,4 +1,11 @@
---------------------------------------------------------------------------------------------------
Version: 0.5.6
Date: 2022-12-28
Features:
- Support for Crafting Efficieny mod (note: technology icon cropping issues)
Changes:
- Carbon fiber, polyacrylonitrile, and rough diamond processing can benefit from productivity
---------------------------------------------------------------------------------------------------
Version: 0.5.5
Date: 2022-12-28
Changes:

View file

@ -0,0 +1,38 @@
local util = require("data-util");
if mods["crafting-efficiency-2"] then
local recipes = util.me.recipes
local eff_data = {
["synthetic-diamond"] = {
max = 15,
icon = data.raw.item["diamond"].icon,
crafting = { efficiency = 10 },
research = { level = 6 },
},
["diamond-processing"] = {
max = 15,
icon = data.raw.item["diamond"].icon,
crafting = { efficiency = 10 },
research = { level = 6 },
},
}
for i, recipe in pairs(recipes) do
-- 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] then
eff_data[recipe] = {
name = recipe.." efficiency",
max = 15,
icon = data.raw.item[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

View file

@ -21,5 +21,6 @@ if mods.Asteroid_Mining then
end
end
require("compatibility/crafting-efficiency")
-- Must be last
util.create_list()

View file

@ -1,6 +1,6 @@
{
"name": "bzcarbon",
"version": "0.5.5",
"version": "0.5.6",
"factorio_version": "1.1",
"title": "Graphite & Diamonds",
"author": "Brevven",

19
me.lua
View file

@ -3,6 +3,25 @@ local me = {}
me.name = "bzcarbon"
me.list = {}
me.recipes = { -- recipes that allow productivity
"graphite",
"synthetic-diamond",
"diamond-processing",
"graphene",
"heavy-water-graphene",
"enriched-graphite",
"fullerenes",
"nanotubes",
"carbon-fiber",
"polyacrylonitrile",
"diamond-synthesis-vulcanite",
-- NOTE: Carbon black recipes do not allow prod modules
}
function me.use_fiber()
return me.get_setting("bzcarbon-enable-carbon-fiber") == "yes"
end