krastorio2 2.0 compatibility
This commit is contained in:
parent
a15f4fe5b6
commit
c0d9c352e8
7 changed files with 34 additions and 22 deletions
4
compatibility/krastorio2.lua
Normal file
4
compatibility/krastorio2.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
if mods["Krastorio2"] then
|
||||
local k2datautil = require("__Krastorio2__/data-util")
|
||||
k2datautil.remove_recipe_unlock("kr-silicon-processing", "kr-quartz")
|
||||
end
|
|
@ -3,6 +3,7 @@ require("strange-matter")
|
|||
require("recipes/silicon-vulcanite")
|
||||
require("compatibility/248k")
|
||||
require("compatibility/any-planet-start")
|
||||
require("compatibility/krastorio2")
|
||||
|
||||
local util = require("data-util");
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -6,11 +6,11 @@ data:extend(
|
|||
mods["Krastorio2"] and {
|
||||
type = "recipe",
|
||||
name = "silica",
|
||||
category = "crushing",
|
||||
category = "kr-crushing",
|
||||
enabled = false,
|
||||
energy_required = 4,
|
||||
allow_productivity = true,
|
||||
ingredients = {util.item("quartz", 10)},
|
||||
ingredients = {util.item("kr-quartz", 10)},
|
||||
results = {util.item("silica", 30)}
|
||||
} or util.me.use_bio_crushed_stone() and {
|
||||
type = "recipe",
|
||||
|
@ -84,7 +84,7 @@ data:extend(
|
|||
},
|
||||
{
|
||||
type = "unlock-recipe",
|
||||
recipe = "quartz"
|
||||
recipe = "kr-quartz"
|
||||
},
|
||||
},
|
||||
prerequisites = {"kr-fluids-chemistry", "kr-stone-processing"},
|
||||
|
|
|
@ -20,16 +20,16 @@ data:extend(
|
|||
{
|
||||
mods["Krastorio2"] and {
|
||||
type = "recipe",
|
||||
name = "silicon",
|
||||
name = "kr-silicon",
|
||||
category = "smelting",
|
||||
enabled = false,
|
||||
energy_required = 14.4,
|
||||
allow_productivity = true,
|
||||
ingredients = {
|
||||
util.item("silica", 18),
|
||||
util.item("coke", 1),
|
||||
util.item("kr-coke", 1),
|
||||
},
|
||||
results = {util.item("silicon", 3)}
|
||||
results = {util.item("kr-silicon", 3)}
|
||||
} or {
|
||||
type = "recipe",
|
||||
name = "silicon",
|
||||
|
|
|
@ -2,13 +2,16 @@ if mods["Krastorio2"] then
|
|||
local util = require("data-util");
|
||||
util.k2matter({
|
||||
k2matter = {
|
||||
item_name = "silica",
|
||||
minimum_conversion_quantity = 20,
|
||||
matter_value = .65,
|
||||
material = {
|
||||
name = "silica",
|
||||
type = "item",
|
||||
amount = 20
|
||||
},
|
||||
matter_count = .65,
|
||||
energy_required = 2,
|
||||
only_deconversion = false,
|
||||
need_stabilizer = false,
|
||||
unlocked_by_technology = "kr-matter-stone-processing"
|
||||
needs_stabilizer = false,
|
||||
allow_productivity = true,
|
||||
unlocked_by = "kr-matter-stone-processing"
|
||||
},
|
||||
})
|
||||
}, false)
|
||||
end
|
||||
|
|
|
@ -20,7 +20,7 @@ if mods["space-exploration"] then
|
|||
{name = "silicon", amount = 6},
|
||||
}
|
||||
if string.sub(mods["space-exploration"], 1, 3) == "0.6" then
|
||||
table.insert(recipe.ingredients, {"coke", 1})
|
||||
table.insert(recipe.ingredients, {"kr-coke", 1})
|
||||
recipe.icons = {
|
||||
{ icon = "__Krastorio2Assets__/icons/items-with-variations/silicon/silicon.png", icon_size = 64},
|
||||
{ icon = "__space-exploration-graphics__/graphics/icons/fluid/pyroflux.png", icon_size = 64, scale=0.25, shift= {-10, -10}},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue