161 lines
9.1 KiB
Lua
161 lines
9.1 KiB
Lua
--recycling doesnt detect recipe change, doing it manually
|
|
if mods["space-exploration"] then
|
|
if mods["Krastorio2"] then
|
|
bobmods.lib.recipe.remove_result("se-recycle-radar", "electronic-circuit")
|
|
bobmods.lib.recipe.add_result("se-recycle-radar", "kr-automation-core")
|
|
else
|
|
bobmods.lib.recipe.remove_result("se-recycle-radar", "electronic-circuit")
|
|
bobmods.lib.recipe.add_result("se-recycle-radar", { type = "item", name = "basic-circuit-board", amount = 6 })
|
|
end
|
|
--fix for krastorio/spaceex radar recipe glitch
|
|
end
|
|
|
|
--insulated-cable
|
|
if mods["bzsilicon2"] then
|
|
bobmods.lib.recipe.add_ingredient("optical-fiber", { type = "item", name = "insulated-cable", amount = 1 })
|
|
|
|
--seems that new version of bzsilicon adds this ingredient which interfears
|
|
bobmods.lib.recipe.remove_ingredient("processing-unit", mods["Krastorio2"] and "kr-silicon" or "silicon")
|
|
end
|
|
------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
if settings.startup["bobmods-recursive-circuitred"].value == true then
|
|
|
|
if mods["space-exploration"] and not mods["Krastorio2"] then
|
|
bobmods.lib.recipe.set_ingredient("advanced-circuit", { type = "item", name = "electronic-circuit", amount = 2 })
|
|
|
|
bobmods.lib.recipe.set_ingredient("processing-unit", { type = "item", name = "advanced-circuit", amount = 2 })
|
|
bobmods.lib.recipe.set_ingredient("processing-unit", { type = "item", name = "electronic-circuit", amount = 20 })
|
|
|
|
bobmods.lib.recipe.set_ingredient("se-processing-unit-holmium", { type = "item", name = "advanced-circuit", amount = 1 })
|
|
bobmods.lib.recipe.set_ingredient("se-processing-unit-holmium", { type = "item", name = "electronic-circuit", amount = 10 })
|
|
|
|
bobmods.lib.recipe.set_ingredient("advanced-processing-unit", { type = "item", name = "processing-unit", amount = 1 })
|
|
end
|
|
|
|
if mods["Krastorio2"] and not mods["space-exploration"] then
|
|
bobmods.lib.recipe.set_ingredient("advanced-circuit", { type = "item", name = "electronic-circuit", amount = 4 })
|
|
bobmods.lib.recipe.set_ingredient("processing-unit", { type = "item", name = "advanced-circuit", amount = 6 })
|
|
bobmods.lib.recipe.set_ingredient("advanced-processing-unit", { type = "item", name = "processing-unit", amount = 1 })
|
|
end
|
|
|
|
if mods["Krastorio2"] and mods["space-exploration"] then
|
|
bobmods.lib.recipe.set_ingredient("advanced-circuit", { type = "item", name = "electronic-circuit", amount = 4 })
|
|
|
|
bobmods.lib.recipe.set_ingredient("processing-unit", { type = "item", name = "advanced-circuit", amount = 6 })
|
|
bobmods.lib.recipe.set_ingredient("se-processing-unit-holmium", { type = "item", name = "advanced-circuit", amount = 3 })
|
|
|
|
bobmods.lib.recipe.set_ingredient("advanced-processing-unit", { type = "item", name = "processing-unit", amount = 1 })
|
|
end
|
|
|
|
if not mods["Krastorio2"] and not mods["space-exploration"] then
|
|
bobmods.lib.recipe.set_ingredient("advanced-circuit", { type = "item", name = "electronic-circuit", amount = 2 })
|
|
|
|
bobmods.lib.recipe.set_ingredient("processing-unit", { type = "item", name = "advanced-circuit", amount = 2 })
|
|
bobmods.lib.recipe.set_ingredient("processing-unit", { type = "item", name = "electronic-circuit", amount = 20 })
|
|
|
|
bobmods.lib.recipe.set_ingredient("advanced-processing-unit", { type = "item", name = "processing-unit", amount = 1 })
|
|
end
|
|
|
|
--change results
|
|
if mods["Krastorio2"] then
|
|
bobmods.lib.recipe.set_result("electronic-circuit", { type = "item", name = "electronic-circuit", amount = 1 })
|
|
bobmods.lib.recipe.set_result("advanced-circuit", { type = "item", name = "advanced-circuit", amount = 2 })
|
|
bobmods.lib.recipe.set_result("processing-unit", { type = "item", name = "processing-unit", amount = 2 })
|
|
bobmods.lib.recipe.set_result("se-processing-unit-holmium", { type = "item", name = "processing-unit", amount = 2 })
|
|
end
|
|
|
|
|
|
--if not then make sure to remove
|
|
else
|
|
bobmods.lib.recipe.remove_ingredient("advanced-circuit", "electronic-circuit")
|
|
|
|
bobmods.lib.recipe.remove_ingredient("processing-unit", "advanced-circuit")
|
|
bobmods.lib.recipe.remove_ingredient("processing-unit", "electronic-circuit")
|
|
|
|
bobmods.lib.recipe.remove_ingredient("se-processing-unit-holmium", "advanced-circuit")
|
|
bobmods.lib.recipe.remove_ingredient("se-processing-unit-holmium", "electronic-circuit")
|
|
|
|
--just in case go back to 1 result
|
|
bobmods.lib.recipe.set_result("advanced-circuit", { type = "item", name = "advanced-circuit", amount = 1 })
|
|
bobmods.lib.recipe.set_result("processing-unit", { type = "item", name = "processing-unit", amount = 1 })
|
|
|
|
if mods["space-exploration"] and not mods["Krastorio2"] then
|
|
bobmods.lib.recipe.set_result("se-processing-unit-holmium", { type = "item", name = "processing-unit", amount = 2 })
|
|
end
|
|
end
|
|
|
|
data.raw.recipe["electronic-circuit"].ingredients = {
|
|
{ type = "item", name = "basic-circuit-board", amount = 1 },
|
|
{ type = "item", name = "basic-electronic-components", amount = 5 }
|
|
}
|
|
|
|
if mods["Krastorio2"] then
|
|
bobmods.lib.recipe.remove_ingredient("advanced-circuit", "copper-cable")
|
|
bobmods.lib.recipe.set_ingredient("advanced-circuit", { type = "item", name = "kr-electronic-components", amount = 2 })
|
|
bobmods.lib.recipe.add_ingredient("advanced-processing-unit", { type = "item", name = "kr-rare-metals", amount = 5 })
|
|
bobmods.lib.recipe.add_ingredient("advanced-processing-unit", { type = "item", name = "processing-electronics", amount = 2 })
|
|
bobmods.lib.recipe.add_ingredient("advanced-processing-unit", { type = "fluid", name = "kr-nitric-acid", amount = 10 })
|
|
|
|
bobmods.lib.recipe.add_ingredient("kr-advanced-assembling-machine", { "advanced-processing-unit", amount = 2 })
|
|
bobmods.lib.recipe.add_ingredient("kr-advanced-furnace", { "advanced-processing-unit", amount = 5 })
|
|
end
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------
|
|
if mods["space-exploration"] then
|
|
data.raw.recipe["electronic-circuit-wood"].hidden = true
|
|
bobmods.lib.recipe.add_ingredient("electronic-circuit", { type = "item", name = "stone-tablet", amount = 1 })
|
|
|
|
--add circuits to recipes
|
|
bobmods.lib.recipe.add_ingredient("se-processing-unit-holmium", { type = "item", name = "basic-electronic-components", amount = 1 })
|
|
bobmods.lib.recipe.add_ingredient("se-processing-unit-holmium", { type = "item", name = "BOBMD-electronic-components", amount = 2 })
|
|
bobmods.lib.recipe.add_ingredient("se-processing-unit-holmium", { type = "item", name = "intergrated-electronics", amount = 1 })
|
|
bobmods.lib.recipe.add_ingredient("se-processing-unit-holmium", { type = "item", name = "superior-circuit-board", amount = 1 })
|
|
bobmods.lib.recipe.add_ingredient("processing-unit", { type = "fluid", name = "sulfuric-acid", amount = 4 })
|
|
|
|
bobmods.lib.recipe.add_ingredient("se-space-assembling-machine", { "advanced-processing-unit", amount = 2 })
|
|
bobmods.lib.recipe.replace_ingredient("se-spaceship-console", "processing-unit", "advanced-processing-unit")
|
|
bobmods.lib.recipe.add_ingredient("se-space-supercomputer-2", { "advanced-processing-unit", amount = 150 })
|
|
bobmods.lib.recipe.replace_ingredient("se-space-supercomputer-3", "processing-unit", "advanced-processing-unit")
|
|
|
|
--Force circuits back to my own tab
|
|
if data.raw.item["electronic-circuit"] then
|
|
data.raw.item["electronic-circuit"].subgroup = "bob-electronic-boards"
|
|
end
|
|
if data.raw.item["advanced-circuit"] then
|
|
data.raw.item["advanced-circuit"].subgroup = "bob-electronic-boards"
|
|
end
|
|
if data.raw.item["processing-unit"] then
|
|
data.raw.item["processing-unit"].subgroup = "bob-electronic-boards"
|
|
end
|
|
if data.raw.item["se-processing-unit-holmium"] then
|
|
data.raw.item["se-processing-unit-holmium"].subgroup = "bob-electronic-boards"
|
|
end
|
|
end
|
|
|
|
--progression fix for krastorio:
|
|
if data.raw.fluid["kr-hydrogen-chloride"] then
|
|
bobmods.lib.tech.add_recipe_unlock("kr-fluids-chemistry", "kr-hydrogen-chloride")
|
|
bobmods.lib.tech.remove_recipe_unlock("kr-advanced-chemistry", "kr-hydrogen-chloride")
|
|
end
|
|
|
|
if data.raw.item["solder"] then
|
|
local electronic_circuit = data.raw.recipe["electronic-circuit"]
|
|
for _, ingredient in pairs(electronic_circuit.ingredients) do
|
|
ingredient.amount = ingredient.amount * 2
|
|
end
|
|
for _, result in pairs(electronic_circuit.results) do
|
|
result.amount = result.amount * 2
|
|
result.amount_min = result.amount_min and result.amount_min * 2 or nil
|
|
result.amount_max = result.amount_max and result.amount_max * 2 or nil
|
|
end
|
|
electronic_circuit.energy_required = electronic_circuit.energy_required and electronic_circuit.energy_required * 2 or 1
|
|
bobmods.lib.recipe.add_ingredient("electronic-circuit", {type="item", name="solder", amount=1})
|
|
bobmods.lib.recipe.add_ingredient("advanced-circuit", {type="item", name="solder", amount=1})
|
|
bobmods.lib.recipe.add_ingredient("processing-unit", {type="item", name="solder", amount=2})
|
|
bobmods.lib.recipe.add_ingredient("advanced-processing-unit", {type="item", name="solder", amount=4})
|
|
end
|
|
|
|
|
|
|