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,65 +109,65 @@ function util.se_landfill(params)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- k2 matter
|
-- k2 matter
|
||||||
-- params: {k2matter}, k2baseicon , {icon}
|
-- params: {k2matter}, k2baseicon , {icon}
|
||||||
function util.k2matter(params)
|
function util.k2matter(params)
|
||||||
local matter = require("__Krastorio2__/prototypes/libraries/matter")
|
local matter = require("__Krastorio2__/prototypes/libraries/matter")
|
||||||
if mods["space-exploration"] then
|
if mods["space-exploration"] then
|
||||||
params.k2matter.need_stabilizer = true
|
params.k2matter.needs_stabilizer = true
|
||||||
end
|
end
|
||||||
if not params.k2matter.minimum_conversion_quantity then
|
if not params.k2matter.minimum_conversion_quantity then
|
||||||
params.k2matter.minimum_conversion_quantity = 10
|
params.k2matter.minimum_conversion_quantity = 10
|
||||||
end
|
end
|
||||||
if not data.raw.technology[params.k2matter.unlocked_by_technology] then
|
if not data.raw.technology[params.k2matter.unlocked_by] then
|
||||||
local icon = ""
|
local icon = ""
|
||||||
if params.k2baseicon then
|
if params.k2baseicon then
|
||||||
icon = util.k2assets().."/technologies/matter-"..params.k2baseicon..".png"
|
icon = util.k2assets() .. "/technologies/matter-" .. params.k2baseicon .. ".png"
|
||||||
else
|
else
|
||||||
icon = util.k2assets().."/technologies/backgrounds/matter.png"
|
icon = util.k2assets() .. "/technologies/backgrounds/matter.png"
|
||||||
end
|
end
|
||||||
|
|
||||||
data:extend(
|
data:extend({
|
||||||
{
|
|
||||||
{
|
{
|
||||||
type = "technology",
|
type = "technology",
|
||||||
name = params.k2matter.unlocked_by_technology,
|
name = params.k2matter.unlocked_by,
|
||||||
icons =
|
icons = {
|
||||||
{
|
|
||||||
{
|
{
|
||||||
icon = icon,
|
icon = icon,
|
||||||
icon_size = 256,
|
icon_size = 256,
|
||||||
},
|
},
|
||||||
params.icon,
|
params.icon,
|
||||||
},
|
},
|
||||||
prerequisites = {"kr-matter-processing"},
|
prerequisites = { "kr-matter-processing" },
|
||||||
unit =
|
unit = {
|
||||||
{
|
|
||||||
count = 350,
|
count = 350,
|
||||||
ingredients = mods["space-exploration"] and
|
ingredients = mods["space-exploration"] and {
|
||||||
{
|
{ "automation-science-pack", 1 },
|
||||||
{"automation-science-pack", 1},
|
{ "logistic-science-pack", 1 },
|
||||||
{"logistic-science-pack", 1},
|
{ "chemical-science-pack", 1 },
|
||||||
{"chemical-science-pack", 1},
|
{ "se-astronomic-science-pack-4", 1 },
|
||||||
{"se-astronomic-science-pack-4", 1},
|
{ "se-energy-science-pack-4", 1 },
|
||||||
{"se-energy-science-pack-4", 1},
|
{ "se-material-science-pack-4", 1 },
|
||||||
{"se-material-science-pack-4", 1},
|
{ "se-deep-space-science-pack-2", 1 },
|
||||||
{"se-deep-space-science-pack-2", 1},
|
{ "se-kr-matter-science-pack-2", 1 },
|
||||||
{"se-kr-matter-science-pack-2", 1},
|
} or {
|
||||||
} or
|
{ "production-science-pack", 1 },
|
||||||
{
|
{ "utility-science-pack", 1 },
|
||||||
{"production-science-pack", 1},
|
{ "kr-matter-tech-card", 1 },
|
||||||
{"utility-science-pack", 1},
|
|
||||||
{"kr-matter-tech-card", 1}
|
|
||||||
},
|
},
|
||||||
time = 45,
|
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
|
end
|
||||||
|
if params.k2matter.only_deconversion then
|
||||||
|
matter.make_deconversion_recipe(params.k2matter)
|
||||||
|
else
|
||||||
matter.make_recipes(params.k2matter)
|
matter.make_recipes(params.k2matter)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,32 @@
|
||||||
-- Matter recipes for Krastorio2
|
-- Matter recipes for Krastorio2
|
||||||
if mods["Krastorio2"] then
|
if mods["Krastorio2"] then
|
||||||
local util = require("data-util");
|
local util = require("data-util")
|
||||||
local matter = require("__Krastorio2__/prototypes/libraries/matter")
|
|
||||||
|
|
||||||
matter.make_recipes({
|
util.k2matter({
|
||||||
material = { type = "item", name = "tungsten-ore", amount = 1 },
|
k2matter = {
|
||||||
|
material = { type = "item", name = "tungsten-ore", amount = 30 },
|
||||||
|
item_name = "tungsten-ore",
|
||||||
matter_count = 6,
|
matter_count = 6,
|
||||||
energy_required = 1,
|
energy_required = 1,
|
||||||
need_stabilizer = false,
|
needs_stabilizer = false,
|
||||||
unlocked_by_technology = "tungsten-matter-processing",
|
unlocked_by = "tungsten-matter-processing",
|
||||||
icon = {icon = "__bztungsten2__/graphics/icons/tungsten-ore.png", icon_size = 64, scale = 1.25}
|
},
|
||||||
|
icon = {
|
||||||
|
icon = "__bztungsten2__/graphics/icons/tungsten-ore.png",
|
||||||
|
icon_size = 64,
|
||||||
|
scale = 1
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
matter.make_recipes({
|
util.k2matter({
|
||||||
material = { type = "item", name = "tungsten-plate", amount = 1 },
|
k2matter = {
|
||||||
|
material = { type = "item", name = "tungsten-plate", amount = 10 },
|
||||||
|
item_name = "tungsten-plate",
|
||||||
matter_count = 10,
|
matter_count = 10,
|
||||||
energy_required = 2,
|
energy_required = 2,
|
||||||
need_stabilizer = false,
|
only_deconversion = true,
|
||||||
unlocked_by_technology = "tungsten-matter-processing",
|
needs_stabilizer = true,
|
||||||
|
unlocked_by = "tungsten-matter-processing",
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue