diff --git a/data.lua b/data.lua index 85a01e3..76aca38 100644 --- a/data.lua +++ b/data.lua @@ -1,5 +1,8 @@ -require("gas") -require("gas-extractor") +require("prototypes/gas") +require("prototypes/gas-extractor") +require("prototypes/phenol") +require("prototypes/formaldehyde") +require("prototypes/bakelite") -- require("gas-boiler/data") local util = require("data-util"); diff --git a/prototypes/bakelite.lua b/prototypes/bakelite.lua new file mode 100644 index 0000000..9f08a67 --- /dev/null +++ b/prototypes/bakelite.lua @@ -0,0 +1,50 @@ +local util = require("data-util"); + +b_prereq = {"basic-chemistry"} +if data.raw.technology["foundry"] then + table.insert(b_prereq, "foundry") +end + +data:extend({ + { + type = "item", + name = "bakelite", + icon = "__bzgas__/graphics/icons/bakelite.png", + icon_size = 128, + subgroup = "raw-material", + order = "g[bakelite]", + stack_size = util.get_stack_size(100), + }, + { + type = "recipe", + name = "bakelite", + category = "basic-chemistry", + main_product = "bakelite", + enabled = "false", + ingredients = { + {util.me.use_phenol() and "phenol" or "coal", 1}, + {type="fluid", name="formaldehyde", amount=10} + }, + energy_required = 6, + results = { + {type="item", name="bakelite", amount = 2}, + }, + }, + { + type = "technology", + name = "bakelite", + icon = "__bzgas__/graphics/technology/bakelite.png", + icon_size = 256, + prerequisites = b_prereq, + effects = { + {type = "unlock-recipe", recipe = "bakelite"}, + }, + unit = { + count = 10, + ingredients = {{"automation-science-pack", 1}}, + time = 20, + }, + }, +}) + +util.add_prerequisite("electronics", "bakelite") diff --git a/prototypes/formaldehyde.lua b/prototypes/formaldehyde.lua new file mode 100644 index 0000000..bb3ad14 --- /dev/null +++ b/prototypes/formaldehyde.lua @@ -0,0 +1,54 @@ + +local util = require("data-util"); + +data:extend({ + { + type = "recipe-category", + name = "basic-chemistry", + } +}) + +data:extend({ + { + type = "fluid", + name = "formaldehyde", + default_temperature = 25, + heat_capacity = "0.1KJ", + fuel_value = "0.5KJ", + base_color = {r=0.77, g=0.87, b=0.67}, + flow_color = {r=0.77, g=0.87, b=0.77}, + icon = "__bzgas__/graphics/icons/formaldehyde.png", + icon_size = 128, + order = "a[fluid]-f[formaldehyde]" + }, + { + type = "recipe", + name = "formaldehyde", + category = "basic-chemistry", + enabled = "false", + ingredients = { + {type="fluid", name="gas", amount=10} + }, + energy_required = 2, + results = { + {type="fluid", name="formaldehyde", amount=9} + }, + }, + + { + type = "technology", + name = "basic-chemistry", + icon = "__bzgas__/graphics/technology/formaldehyde.png", + icon_size = 256, + prerequisites = {"gas-extraction"}, + effects = { + -- {type = "unlock-recipe", recipe = "basic-chemical-plant"}, + {type = "unlock-recipe", recipe = "formaldehyde"}, + }, + unit = { + count = 10, + ingredients = {{"automation-science-pack", 1}}, + time = 20, + }, + }, +}) diff --git a/gas-extractor.lua b/prototypes/gas-extractor.lua similarity index 99% rename from gas-extractor.lua rename to prototypes/gas-extractor.lua index af7b5ed..417d230 100644 --- a/gas-extractor.lua +++ b/prototypes/gas-extractor.lua @@ -36,7 +36,7 @@ data:extend({ }, { type = "technology", - name = "gas-processing", + name = "gas-extraction", icon = "__bzgas__/graphics/technology/gas-processing.png", icon_size = 256, prerequisites = ge_prereq, diff --git a/gas.lua b/prototypes/gas.lua similarity index 99% rename from gas.lua rename to prototypes/gas.lua index c41898d..58933b2 100644 --- a/gas.lua +++ b/prototypes/gas.lua @@ -133,6 +133,6 @@ data:extend({ flow_color = {r=0.67, g=0.87, b=0.87}, icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128, - order = "a[fluid]-f[organotins]" + order = "a[fluid]-f[gas]" }, }) diff --git a/prototypes/phenol.lua b/prototypes/phenol.lua new file mode 100644 index 0000000..42ab960 --- /dev/null +++ b/prototypes/phenol.lua @@ -0,0 +1,63 @@ +local util = require("data-util"); + +if util.me.use_phenol() then + +data:extend({ + { + type = "item", + name = "phenol", + icon = "__bzgas__/graphics/icons/phenol.png", + icon_size = 128, + subgroup = "raw-material", + order = "g[phenol]", + stack_size = util.get_stack_size(100), + }, +}) + +if data.raw.item["coke"] then + local er = mods.Krastorio2 and 10 or 6.4 + local cat + if mods.Krastorio2 then + cat = "smelting" + util.add_effect("steel-processing", {type="recipe-unlock", name="phenol"}) + elseif data.raw.item["foundry"] then + cat = "founding" + util.add_effect("foundry", {type="recipe-unlock", name="phenol"}) + else + cat = "advanced-crafting" + util.add_effect("automation", {type="recipe-unlock", name="phenol"}) + end + + data:extend({ + { + type = "recipe", + name = "phenol", + category = cat, + main_product = "phenol", + enabled = "false", + ingredients = {{"coal", 4}}, + energy_required = er, + results = { + {type="item", name="phenol", amount = 2}, + {type="item", name="coke", amount = 1}, + }, + } + }) +else + data:extend({ + { + type = "recipe", + name = "phenol", + category = "advanced-crafting", + main_product = "phenol", + enabled = "false", + energy_required = 1, + ingredients = {{"coal", 1}}, + results = { + {type="item", name="phenol", amount = 1}, + }, + } + }) + util.add_effect("automation", {type="recipe-unlock", name="phenol"}) +end +end