minor refactor

This commit is contained in:
Brevven 2022-09-24 20:48:00 -07:00
parent 9a863ae6f6
commit 8710b56d90
3 changed files with 13 additions and 15 deletions

View file

@ -1,7 +1,7 @@
local bzutil = require("data-util");
local util = require("util")
local util = require("data-util");
local futil = require("util")
if mods.Krastorio2 then
if bzutil.me.use_fullerenes() then
if util.me.use_fullerenes() then
-- Add extra nanotube recipes.
-- This could be moved to data-updates in future if necessary
data:extend({
@ -19,7 +19,7 @@ if mods.Krastorio2 then
energy_required = 32,
ingredients = {
{"nanotubes", 6},
table.unpack(util.table.deepcopy(data.raw.recipe["imersium-plate"].ingredients)),
table.unpack(futil.table.deepcopy(data.raw.recipe["imersium-plate"].ingredients)),
},
result = "imersium-plate",
result_count = 6,
@ -39,7 +39,7 @@ if mods.Krastorio2 then
energy_required = 12,
ingredients = {
{"nanotubes", 4},
table.unpack(util.table.deepcopy(data.raw.recipe["kr-s-c-imersium-beam"].ingredients)),
table.unpack(futil.table.deepcopy(data.raw.recipe["kr-s-c-imersium-beam"].ingredients)),
},
result = "imersium-beam",
result_count = 2,
@ -59,15 +59,14 @@ if mods.Krastorio2 then
energy_required = 12,
ingredients = {
{"nanotubes", 2},
table.unpack(util.table.deepcopy(data.raw.recipe["kr-s-c-imersium-gear-wheel"].ingredients)),
table.unpack(futil.table.deepcopy(data.raw.recipe["kr-s-c-imersium-gear-wheel"].ingredients)),
},
result = "imersium-gear-wheel",
result_count = 2,
},
})
bzutil.add_effect("nanotubes", {type="unlock-recipe", recipe="imersium-plate-nanotubes"})
bzutil.add_effect("nanotubes", {type="unlock-recipe", recipe="imersium-beam-nanotubes"})
bzutil.add_effect("nanotubes", {type="unlock-recipe", recipe="imersium-gear-wheel-nanotubes"})
util.add_unlock("nanotubes", "imersium-plate-nanotubes")
util.add_unlock("nanotubes", "imersium-beam-nanotubes")
util.add_unlock("nanotubes", "imersium-gear-wheel-nanotubes")
end
end