krastorio 2.0 compatibility
This commit is contained in:
parent
6cb3e341fa
commit
d0e649a375
4 changed files with 50 additions and 39 deletions
|
|
@ -514,15 +514,15 @@ end
|
||||||
|
|
||||||
-- k2 matter
|
-- k2 matter
|
||||||
-- params: {k2matter}, k2baseicon , {icon}
|
-- params: {k2matter}, k2baseicon , {icon}
|
||||||
function util.k2matter(params)
|
function util.k2matter(params, only_deconversion)
|
||||||
local matter = require("__Krastorio2__/lib/public/data-stages/matter-util")
|
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.material.amount then
|
||||||
params.k2matter.minimum_conversion_quantity = 10
|
params.k2matter.material.amount = 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"
|
||||||
|
|
@ -534,7 +534,7 @@ function util.k2matter(params)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
type = "technology",
|
type = "technology",
|
||||||
name = params.k2matter.unlocked_by_technology,
|
name = params.k2matter.unlocked_by,
|
||||||
icons =
|
icons =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
@ -569,7 +569,11 @@ function util.k2matter(params)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
matter.createMatterRecipe(params.k2matter)
|
if only_deconversion then
|
||||||
|
matter.make_deconversion_recipe(params.k2matter)
|
||||||
|
else
|
||||||
|
matter.make_recipes(params.k2matter)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ data:extend(
|
||||||
results =
|
results =
|
||||||
{
|
{
|
||||||
{type = "item", name = "enriched-lead", amount = util.me.byproduct() and 5 or 6},
|
{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,
|
util.me.byproduct() and {type = "item", name = "copper-ore", amount = 2} or nil,
|
||||||
},
|
},
|
||||||
crafting_machine_tint =
|
crafting_machine_tint =
|
||||||
|
|
@ -71,30 +71,29 @@ data:extend(
|
||||||
allow_productivity = true,
|
allow_productivity = true,
|
||||||
ingredients =
|
ingredients =
|
||||||
{
|
{
|
||||||
{"enriched-lead", 5}
|
{type = "item", name = "enriched-lead", amount = 5}
|
||||||
},
|
},
|
||||||
result = "lead-plate",
|
results = { { type = "item", name = "lead-plate", amount = 5 } },
|
||||||
result_count = 5,
|
|
||||||
order = "b[lead-plate]-b[enriched-lead-plate]"
|
order = "b[lead-plate]-b[enriched-lead-plate]"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type = "recipe",
|
type = "recipe",
|
||||||
name = "dirty-water-filtration-lead",
|
name = "dirty-water-filtration-lead",
|
||||||
category = "fluid-filtration",
|
category = "kr-fluid-filtration",
|
||||||
icons =
|
icons =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
icon = data.raw.fluid["dirty-water"].icon,
|
icon = data.raw.fluid["kr-dirty-water"].icon,
|
||||||
icon_size = data.raw.fluid["dirty-water"].icon_size
|
icon_size = data.raw.fluid["kr-dirty-water"].icon_size
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon = data.raw.item["lead-ore"].icon,
|
icon = data.raw.item["lead-ore"].icon,
|
||||||
icon_size = data.raw.item["lead-ore"].icon_size,
|
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}
|
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,
|
energy_required = 2,
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_as_intermediate = false,
|
allow_as_intermediate = false,
|
||||||
|
|
@ -102,7 +101,7 @@ data:extend(
|
||||||
always_show_products = true,
|
always_show_products = true,
|
||||||
ingredients =
|
ingredients =
|
||||||
{
|
{
|
||||||
{type = "fluid", name = "dirty-water", amount = 100, catalyst_amount = 100},
|
{type = "fluid", name = "kr-dirty-water", amount = 100, catalyst_amount = 100},
|
||||||
},
|
},
|
||||||
results =
|
results =
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
-- Matter recipes for Krastorio2
|
-- Matter recipes for Krastorio2
|
||||||
if mods["Krastorio2"] then
|
if mods["Krastorio2"] then
|
||||||
local util = require("__bzlead__.data-util");
|
local util = require("data-util");
|
||||||
local matter = require("__Krastorio2__/lib/public/data-stages/matter-util")
|
local matter = require("__Krastorio2__/prototypes/libraries/matter")
|
||||||
|
|
||||||
data:extend(
|
data:extend(
|
||||||
{
|
{
|
||||||
|
|
@ -20,6 +20,7 @@ data:extend(
|
||||||
scale = 1.25,
|
scale = 1.25,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
effects = {},
|
||||||
prerequisites = {"kr-matter-processing"},
|
prerequisites = {"kr-matter-processing"},
|
||||||
unit =
|
unit =
|
||||||
{
|
{
|
||||||
|
|
@ -28,35 +29,41 @@ data:extend(
|
||||||
{
|
{
|
||||||
{"production-science-pack", 1},
|
{"production-science-pack", 1},
|
||||||
{"utility-science-pack", 1},
|
{"utility-science-pack", 1},
|
||||||
{"matter-tech-card", 1}
|
{"kr-matter-tech-card", 1}
|
||||||
},
|
},
|
||||||
time = 45
|
time = 45
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
local lead_ore_matter =
|
util.k2matter({
|
||||||
{
|
k2matter = {
|
||||||
item_name = "lead-ore",
|
material = {
|
||||||
minimum_conversion_quantity = 10,
|
name = "lead-ore",
|
||||||
matter_value = 5,
|
type = "item",
|
||||||
|
amount = 10,
|
||||||
|
},
|
||||||
|
matter_count = 5,
|
||||||
energy_required = 1,
|
energy_required = 1,
|
||||||
need_stabilizer = false,
|
needs_stabilizer = false,
|
||||||
unlocked_by_technology = "lead-matter-processing"
|
allow_productivity = true,
|
||||||
|
unlocked_by = "lead-matter-processing"
|
||||||
}
|
}
|
||||||
matter.createMatterRecipe(lead_ore_matter)
|
}, false)
|
||||||
|
|
||||||
|
util.k2matter({
|
||||||
local lead_plate_matter =
|
k2matter = {
|
||||||
{
|
material = {
|
||||||
item_name = "lead-plate",
|
name = "lead-plate",
|
||||||
minimum_conversion_quantity = 10,
|
type = "item",
|
||||||
matter_value = 7.5,
|
amount = 10,
|
||||||
|
},
|
||||||
|
matter_count = 7.5,
|
||||||
energy_required = 2,
|
energy_required = 2,
|
||||||
only_deconversion = true,
|
needs_stabilizer = true,
|
||||||
need_stabilizer = true,
|
allow_productivity = true,
|
||||||
unlocked_by_technology = "lead-matter-processing"
|
unlocked_by = "lead-matter-processing"
|
||||||
}
|
}
|
||||||
matter.createMatterRecipe(lead_plate_matter)
|
}, true)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ casting-lead-expansion-bolt=Casting lead expansion bolt
|
||||||
molten-lead-from-lava=Molten lead from lava
|
molten-lead-from-lava=Molten lead from lava
|
||||||
lead-dechelation=Lead dechelation
|
lead-dechelation=Lead dechelation
|
||||||
alternative-metallic-asteroid-crushing=Alternative metallic asteroid crushing
|
alternative-metallic-asteroid-crushing=Alternative metallic asteroid crushing
|
||||||
|
enriched-lead-plate=Lead plate from enriched lead
|
||||||
|
|
||||||
[recipe-description]
|
[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.
|
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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue