diff --git a/data-util.lua b/data-util.lua index 0e48dbf..fb70b99 100644 --- a/data-util.lua +++ b/data-util.lua @@ -514,15 +514,15 @@ end -- k2 matter -- params: {k2matter}, k2baseicon , {icon} -function util.k2matter(params) - local matter = require("__Krastorio2__/lib/public/data-stages/matter-util") +function util.k2matter(params, only_deconversion) + local matter = require("__Krastorio2__/prototypes/libraries/matter") if mods["space-exploration"] then - params.k2matter.need_stabilizer = true + params.k2matter.needs_stabilizer = true end - if not params.k2matter.minimum_conversion_quantity then - params.k2matter.minimum_conversion_quantity = 10 + if not params.k2matter.material.amount then + params.k2matter.material.amount = 10 end - if not data.raw.technology[params.k2matter.unlocked_by_technology] then + if not data.raw.technology[params.k2matter.unlocked_by] then local icon = "" if params.k2baseicon then icon = util.k2assets().."/technologies/matter-"..params.k2baseicon..".png" @@ -534,7 +534,7 @@ function util.k2matter(params) { { type = "technology", - name = params.k2matter.unlocked_by_technology, + name = params.k2matter.unlocked_by, icons = { { @@ -569,7 +569,11 @@ function util.k2matter(params) }, }) end - matter.createMatterRecipe(params.k2matter) + if only_deconversion then + matter.make_deconversion_recipe(params.k2matter) + else + matter.make_recipes(params.k2matter) + end end diff --git a/lead-enriched.lua b/lead-enriched.lua index 124ecfc..0002690 100644 --- a/lead-enriched.lua +++ b/lead-enriched.lua @@ -43,7 +43,7 @@ data:extend( results = { {type = "item", name = "enriched-lead", amount = util.me.byproduct() and 5 or 6}, - {type = "fluid", name = "dirty-water", amount = 25, catalyst_amount = 25}, + {type = "fluid", name = "kr-dirty-water", amount = 25, catalyst_amount = 25}, util.me.byproduct() and {type = "item", name = "copper-ore", amount = 2} or nil, }, crafting_machine_tint = @@ -71,30 +71,29 @@ data:extend( allow_productivity = true, ingredients = { - {"enriched-lead", 5} + {type = "item", name = "enriched-lead", amount = 5} }, - result = "lead-plate", - result_count = 5, + results = { { type = "item", name = "lead-plate", amount = 5 } }, order = "b[lead-plate]-b[enriched-lead-plate]" }, { type = "recipe", name = "dirty-water-filtration-lead", - category = "fluid-filtration", + category = "kr-fluid-filtration", icons = { { - icon = data.raw.fluid["dirty-water"].icon, - icon_size = data.raw.fluid["dirty-water"].icon_size + icon = data.raw.fluid["kr-dirty-water"].icon, + icon_size = data.raw.fluid["kr-dirty-water"].icon_size }, { icon = data.raw.item["lead-ore"].icon, icon_size = data.raw.item["lead-ore"].icon_size, - scale = 0.20 * (data.raw.fluid["dirty-water"].icon_size/data.raw.item["lead-ore"].icon_size), + scale = 0.2 * 64 / (data.raw.item["lead-ore"].icon_size or 64), shift = {0, 4} } }, - icon_size = data.raw.fluid["dirty-water"].icon_size, + icon_size = data.raw.fluid["kr-dirty-water"].icon_size, energy_required = 2, enabled = false, allow_as_intermediate = false, @@ -102,7 +101,7 @@ data:extend( always_show_products = true, ingredients = { - {type = "fluid", name = "dirty-water", amount = 100, catalyst_amount = 100}, + {type = "fluid", name = "kr-dirty-water", amount = 100, catalyst_amount = 100}, }, results = { diff --git a/lead-matter.lua b/lead-matter.lua index 19b544d..8e4a2df 100644 --- a/lead-matter.lua +++ b/lead-matter.lua @@ -1,7 +1,7 @@ -- Matter recipes for Krastorio2 if mods["Krastorio2"] then -local util = require("__bzlead__.data-util"); -local matter = require("__Krastorio2__/lib/public/data-stages/matter-util") +local util = require("data-util"); +local matter = require("__Krastorio2__/prototypes/libraries/matter") data:extend( { @@ -20,6 +20,7 @@ data:extend( scale = 1.25, } }, + effects = {}, prerequisites = {"kr-matter-processing"}, unit = { @@ -28,35 +29,41 @@ data:extend( { {"production-science-pack", 1}, {"utility-science-pack", 1}, - {"matter-tech-card", 1} + {"kr-matter-tech-card", 1} }, time = 45 } }, }) -local lead_ore_matter = - { - item_name = "lead-ore", - minimum_conversion_quantity = 10, - matter_value = 5, +util.k2matter({ + k2matter = { + material = { + name = "lead-ore", + type = "item", + amount = 10, + }, + matter_count = 5, energy_required = 1, - need_stabilizer = false, - unlocked_by_technology = "lead-matter-processing" + needs_stabilizer = false, + allow_productivity = true, + unlocked_by = "lead-matter-processing" } -matter.createMatterRecipe(lead_ore_matter) +}, false) - -local lead_plate_matter = - { - item_name = "lead-plate", - minimum_conversion_quantity = 10, - matter_value = 7.5, +util.k2matter({ + k2matter = { + material = { + name = "lead-plate", + type = "item", + amount = 10, + }, + matter_count = 7.5, energy_required = 2, - only_deconversion = true, - need_stabilizer = true, - unlocked_by_technology = "lead-matter-processing" + needs_stabilizer = true, + allow_productivity = true, + unlocked_by = "lead-matter-processing" } -matter.createMatterRecipe(lead_plate_matter) +}, true) end diff --git a/locale/en/lead.cfg b/locale/en/lead.cfg index 24370a5..973fb13 100644 --- a/locale/en/lead.cfg +++ b/locale/en/lead.cfg @@ -46,6 +46,7 @@ casting-lead-expansion-bolt=Casting lead expansion bolt molten-lead-from-lava=Molten lead from lava lead-dechelation=Lead dechelation alternative-metallic-asteroid-crushing=Alternative metallic asteroid crushing +enriched-lead-plate=Lead plate from enriched lead [recipe-description] enriched-lead=Enrich lead ore, purifying with sulfuric acid [fluid=sulfuric-acid] and water [fluid=water], improving the final yield. Produce dirty water [fluid=dirty-water] as a byproduct.