forked from cacklingfiend/bztungsten2
Fix K2 matter recipe generation and tech icon (#1)
I found that while cleaning.  Co-authored-by: pla Reviewed-on: cacklingfiend/bztungsten2#1 Co-authored-by: pla <pla@noreply.example.org> Co-committed-by: pla <pla@noreply.example.org>
This commit is contained in:
parent
46bcd93aea
commit
f0061c6a7f
2 changed files with 66 additions and 56 deletions
|
|
@ -109,18 +109,17 @@ function util.se_landfill(params)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
-- k2 matter
|
||||
-- params: {k2matter}, k2baseicon , {icon}
|
||||
function util.k2matter(params)
|
||||
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
|
||||
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"
|
||||
|
|
@ -128,13 +127,11 @@ function util.k2matter(params)
|
|||
icon = util.k2assets() .. "/technologies/backgrounds/matter.png"
|
||||
end
|
||||
|
||||
data:extend(
|
||||
{
|
||||
data:extend({
|
||||
{
|
||||
type = "technology",
|
||||
name = params.k2matter.unlocked_by_technology,
|
||||
icons =
|
||||
{
|
||||
name = params.k2matter.unlocked_by,
|
||||
icons = {
|
||||
{
|
||||
icon = icon,
|
||||
icon_size = 256,
|
||||
|
|
@ -142,11 +139,9 @@ function util.k2matter(params)
|
|||
params.icon,
|
||||
},
|
||||
prerequisites = { "kr-matter-processing" },
|
||||
unit =
|
||||
{
|
||||
unit = {
|
||||
count = 350,
|
||||
ingredients = mods["space-exploration"] and
|
||||
{
|
||||
ingredients = mods["space-exploration"] and {
|
||||
{ "automation-science-pack", 1 },
|
||||
{ "logistic-science-pack", 1 },
|
||||
{ "chemical-science-pack", 1 },
|
||||
|
|
@ -155,21 +150,26 @@ function util.k2matter(params)
|
|||
{ "se-material-science-pack-4", 1 },
|
||||
{ "se-deep-space-science-pack-2", 1 },
|
||||
{ "se-kr-matter-science-pack-2", 1 },
|
||||
} or
|
||||
{
|
||||
} or {
|
||||
{ "production-science-pack", 1 },
|
||||
{ "utility-science-pack", 1 },
|
||||
{"kr-matter-tech-card", 1}
|
||||
{ "kr-matter-tech-card", 1 },
|
||||
},
|
||||
time = 45,
|
||||
},
|
||||
localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}},
|
||||
effects = {},
|
||||
-- localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}},
|
||||
},
|
||||
})
|
||||
end
|
||||
if params.k2matter.only_deconversion then
|
||||
matter.make_deconversion_recipe(params.k2matter)
|
||||
else
|
||||
matter.make_recipes(params.k2matter)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- se matter
|
||||
-- params: ore, energy_required, quant_out, quant_in, icon_size, stream_out
|
||||
|
|
|
|||
|
|
@ -1,22 +1,32 @@
|
|||
-- Matter recipes for Krastorio2
|
||||
if mods["Krastorio2"] then
|
||||
local util = require("data-util");
|
||||
local matter = require("__Krastorio2__/prototypes/libraries/matter")
|
||||
local util = require("data-util")
|
||||
|
||||
matter.make_recipes({
|
||||
material = { type = "item", name = "tungsten-ore", amount = 1 },
|
||||
util.k2matter({
|
||||
k2matter = {
|
||||
material = { type = "item", name = "tungsten-ore", amount = 30 },
|
||||
item_name = "tungsten-ore",
|
||||
matter_count = 6,
|
||||
energy_required = 1,
|
||||
need_stabilizer = false,
|
||||
unlocked_by_technology = "tungsten-matter-processing",
|
||||
icon = {icon = "__bztungsten2__/graphics/icons/tungsten-ore.png", icon_size = 64, scale = 1.25}
|
||||
needs_stabilizer = false,
|
||||
unlocked_by = "tungsten-matter-processing",
|
||||
},
|
||||
icon = {
|
||||
icon = "__bztungsten2__/graphics/icons/tungsten-ore.png",
|
||||
icon_size = 64,
|
||||
scale = 1
|
||||
},
|
||||
})
|
||||
|
||||
matter.make_recipes({
|
||||
material = { type = "item", name = "tungsten-plate", amount = 1 },
|
||||
util.k2matter({
|
||||
k2matter = {
|
||||
material = { type = "item", name = "tungsten-plate", amount = 10 },
|
||||
item_name = "tungsten-plate",
|
||||
matter_count = 10,
|
||||
energy_required = 2,
|
||||
need_stabilizer = false,
|
||||
unlocked_by_technology = "tungsten-matter-processing",
|
||||
only_deconversion = true,
|
||||
needs_stabilizer = true,
|
||||
unlocked_by = "tungsten-matter-processing",
|
||||
},
|
||||
})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue