mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-15 02:12:46 -06:00
nullius compat
This commit is contained in:
@@ -11,20 +11,31 @@ if mods["nullius"] then
|
|||||||
table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network")
|
table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Reset the combinator recipe back to arithmetic combinator recipe in case a mod has changed it
|
|
||||||
local recipe = flib.deep_copy(data.raw["recipe"]["arithmetic-combinator"].ingredients)
|
if mods["nullius"] then
|
||||||
for k, _ in pairs(recipe) do
|
--Credit to modo-lv for submitting the following code
|
||||||
local mult = 2
|
-- Place combinator in the same subgroup as the regular train stop
|
||||||
for i, _ in pairs(recipe) do
|
data.raw["recipe"][COMBINATOR_NAME].subgroup = data.raw["train-stop"]["train-stop"].subgroup
|
||||||
if recipe[k][i] == "copper-cable" then
|
data.raw["item"][COMBINATOR_NAME].subgroup = data.raw["item"]["train-stop"].subgroup
|
||||||
mult = 4
|
-- Nullius makes modded technologies part of its research tree
|
||||||
break;
|
-- Place combinator in the same place on the research tree as LTN
|
||||||
end
|
table.insert(data.raw.technology["nullius-broadcasting-1"].prerequisites, "cybersyn-train-network")
|
||||||
end
|
else
|
||||||
for i, _ in pairs(recipe) do
|
-- Reset the combinator recipe back to arithmetic combinator recipe in case a mod has changed it
|
||||||
if type(recipe[k][i]) == "number" then
|
local recipe = flib.deep_copy(data.raw["recipe"]["arithmetic-combinator"].ingredients)
|
||||||
recipe[k][i] = mult*recipe[k][i]
|
for k, _ in pairs(recipe) do
|
||||||
|
local mult = 2
|
||||||
|
for i, _ in pairs(recipe) do
|
||||||
|
if recipe[k][i] == "copper-cable" then
|
||||||
|
mult = 4
|
||||||
|
break;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i, _ in pairs(recipe) do
|
||||||
|
if type(recipe[k][i]) == "number" then
|
||||||
|
recipe[k][i] = mult*recipe[k][i]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
data.raw["recipe"][COMBINATOR_NAME].ingredients = recipe
|
||||||
end
|
end
|
||||||
data.raw["recipe"][COMBINATOR_NAME].ingredients = recipe
|
|
||||||
|
|||||||
Reference in New Issue
Block a user