crafting efficiency
This commit is contained in:
parent
c137c2525f
commit
60af808661
6 changed files with 36 additions and 15 deletions
|
|
@ -1,4 +1,9 @@
|
|||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.17
|
||||
Date: 2022-01-17
|
||||
Features:
|
||||
- (Beta) Crafting efficiency compatibility
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 1.2.16
|
||||
Date: 2022-12-24
|
||||
Localization:
|
||||
|
|
|
|||
26
compatibility/crafting-efficiency.lua
Normal file
26
compatibility/crafting-efficiency.lua
Normal file
|
|
@ -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
|
||||
|
|
@ -5,5 +5,6 @@ require("map-gen-preset-updates")
|
|||
require("strange-matter")
|
||||
require("compatibility/248k")
|
||||
require("compatibility/sciencecosttweakerm")
|
||||
require("compatibility/crafting-efficiency")
|
||||
|
||||
require("lead-recipe-modules")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bzlead",
|
||||
"version": "1.2.16",
|
||||
"version": "1.2.17",
|
||||
"factorio_version": "1.1",
|
||||
"title": "Lead",
|
||||
"author": "Brevven",
|
||||
|
|
|
|||
|
|
@ -1,19 +1,7 @@
|
|||
local util = require("data-util");
|
||||
-- Enable prod modules for all lead plate and ore recipes
|
||||
|
||||
recipes = {"lead-plate"}
|
||||
if mods["Krastorio2"] then
|
||||
table.insert(recipes, "enriched-lead-plate")
|
||||
table.insert(recipes, "enriched-lead")
|
||||
end
|
||||
if mods["space-exploration"] then
|
||||
table.insert(recipes, "lead-smelting-vulcanite")
|
||||
table.insert(recipes, "molten-lead")
|
||||
if mods["Krastorio2"] then
|
||||
table.insert(recipes, "enriched-lead-smelting-vulcanite")
|
||||
end
|
||||
end
|
||||
|
||||
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
|
||||
|
|
|
|||
1
me.lua
1
me.lua
|
|
@ -3,6 +3,7 @@ local me = {}
|
|||
me.name = "bzlead"
|
||||
me.lead_ore = "lead-ore"
|
||||
me.lead_plate = "lead-plate"
|
||||
me.recipes = {me.lead_plate, "enriched-lead-plate", "enriched-lead", "lead-smelting-vulcanite", "molten-lead", "enriched-lead-smelting-vulcanite"}
|
||||
|
||||
function me.byproduct()
|
||||
return me.get_setting("bzlead-byproduct") and not me.get_setting("bz-no-byproduct")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue