adamo-chemical/data.lua

666 lines
16 KiB
Lua
Raw Normal View History

2020-05-21 11:36:04 +00:00
require("factsheet")
require("machines")
2020-05-21 11:36:04 +00:00
adamochemical = {}
adamochemical.mixer = false
if informatron_make_image then
informatron_make_image (
"adamo-chemical-image",
"__adamo-chemical__/thumbnail.png",
64,64
)
end
2020-05-21 11:36:04 +00:00
data:extend({{
type = "item-group",
name = "adamo-chemical-group",
order = "m",
icon = "__adamo-chemical__/graphics/flask.png",
icon_size = 64
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-production-machine",
order = "0"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-manufacturing",
order = "1"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-vaporworks",
order = "a"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-disassociation",
order = "g"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-recovery",
order = "h"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-displacement",
order = "i"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-activation",
order = "j"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-deposition",
order = "k"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-binding",
order = "n"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-firing",
order = "o"
},{
type = "item-subgroup",
group = "adamo-chemical-group",
name = "adamo-chemical-separation",
order = "p"
},{
type = "recipe-category",
name = "adamo-chemical-separation"
},{
type = "recipe-category",
name = "adamo-chemical-firing"
},{
type = "recipe-category",
name = "adamo-chemical-binding"
},{
type = "recipe-category",
name = "adamo-chemical-vaporworks"
},{
type = "recipe-category",
name = "adamo-chemical-hydrolysis"
},{
type = "recipe-category",
name = "adamo-chemical-displacement"
},{
type = "recipe-category",
name = "adamo-chemical-heating"
},{
type = "recipe-category",
name = "adamo-chemical-deposition"
},{
type = "recipe-category",
name = "adamo-chemical-decomposition"
},{
type = "recipe-category",
name = "adamo-chemical-recovery"
},{
type = "recipe-category",
name = "adamo-chemical-manufacturing"
},{
type = "recipe-category",
name = "adamo-chemical-activation"
},{
type = "recipe-category",
name = "adamo-chemical-disassociation"
}})
local fluorine_processing_tech = {
type = "technology",
name = "adamo-chemical-fluorine-processing",
icon = "__adamo-chemical__/graphics/icons/fluorite.png",
icon_size = 64,
effects =
{
{
type = "unlock-recipe",
recipe = "adamo-chemical-hydrofluoric-acid"
},
},
2023-12-20 23:37:40 +00:00
prerequisites = {"advanced-material-processing-2"},
2020-05-21 11:36:04 +00:00
unit =
{
count = 150,
ingredients = {
{"automation-science-pack", 1},
{"logistic-science-pack", 1},
{"chemical-science-pack", 1},
},
time = 30
},
order = "c-c-c",
}
data:extend({
fluorine_processing_tech,
})
2023-12-20 23:37:40 +00:00
calcite_item = {
2020-05-21 11:36:04 +00:00
type = "item",
name = "adamo-chemical-calcite",
icon = "__adamo-chemical__/graphics/icons/calcite.png",
icon_size = 32,
subgroup = "raw-material",
order = "g1[adamo-chemical-calcite]",
stack_size = 50
}
2023-12-20 23:37:40 +00:00
clinker_item = {
2020-05-21 11:36:04 +00:00
type = "item",
name = "adamo-chemical-clinker",
icon = "__adamo-chemical__/graphics/icons/clinker.png",
icon_size = 32,
subgroup = "raw-material",
order = "g1[adamo-chemical-clinker]",
stack_size = 50
}
2023-12-20 23:37:40 +00:00
gypsum_item = {
2020-05-21 11:36:04 +00:00
type = "item",
name = "adamo-chemical-gypsum",
icon = "__adamo-chemical__/graphics/icons/gypsum.png",
icon_size = 32,
subgroup = "raw-material",
order = "g1[adamo-chemical-gypsum]",
stack_size = 50
}
2023-12-20 23:37:40 +00:00
fluorite_item = {
2020-05-21 11:36:04 +00:00
type = "item",
name = "adamo-chemical-fluorite",
icon = "__adamo-chemical__/graphics/icons/fluorite.png",
icon_size = 64,
subgroup = "raw-material",
order = "h1[adamo-chemical-fluorite]",
stack_size = 50
}
2023-12-20 23:37:40 +00:00
cement_item = {
2020-05-21 11:36:04 +00:00
type = "item",
name = "adamo-chemical-cement",
icon = "__adamo-chemical__/graphics/icons/cement.png",
icon_size = 32,
subgroup = "intermediate-product",
order = "i1[adamo-chemical-cement]",
stack_size = 50
}
data:extend({
calcite_item,
clinker_item,
gypsum_item,
fluorite_item,
cement_item
})
2023-12-20 23:37:40 +00:00
quartz_item = data.raw.item["SiSi-quartz"]
local quartz_recipe = data.raw.recipe["SiSi-quartz"]
if quartz_item then
quartz_item.order = "g[adamo-chemical-quartz]"
quartz_item.subgroup = "raw-material"
if quartz_recipe then
quartz_recipe.normal.hidden = true
quartz_recipe.expensive.hidden = true
quartz_recipe.icon = nil
quartz_recipe.icon_size = nil
2020-05-21 11:36:04 +00:00
end
else
2023-12-20 23:37:40 +00:00
quartz_item = {
2020-05-21 11:36:04 +00:00
type = "item",
name = "adamo-chemical-quartz",
icon = "__adamo-chemical__/graphics/icons/quartz.png",
icon_size = 32,
flags = {},
subgroup = "raw-material",
order = "g1[adamo-chemical-quartz]",
stack_size = 50
}
data:extend({quartz_item})
end
local hydrofluoric_acid_fluid = {
type = "fluid",
name = "adamo-chemical-hydrofluoric-acid",
order = "a[fluid]-g1[adamo-chemical-hydrofluoric-acid]",
icon = "__adamo-chemical__/graphics/icons/hydrofluoride.png",
icon_size = 32,
base_color = adamo.colors.hf_base,
flow_color = adamo.colors.hf_flow,
2020-05-21 11:36:04 +00:00
default_temperature = 25,
max_temperature = 100,
heat_capacity = "0.1KJ",
}
data:extend({
hydrofluoric_acid_fluid
})
local calcite_recipe = {
type = "recipe",
name = "adamo-chemical-calcite",
category = "chemistry",
enabled = false,
energy_required = 1,
show_amount_in_title = true,
main_product = "adamo-chemical-calcite",
ingredients = {{
type = "fluid",
name = "water",
amount = 100
},{
type = "item",
name = "adamo-chemical-gypsum",
amount = 5
2020-09-29 06:57:47 +00:00
},{
type = "item",
name = "solid-fuel",
amount = 1
2020-05-21 11:36:04 +00:00
}},
results = {{
type = "item",
name = "adamo-chemical-calcite",
amount = 5,
},{
type = "fluid",
name = "sulfuric-acid",
amount = 50
}},
2020-09-29 06:57:47 +00:00
--crafting_machine_tint = {
-- primary = data.raw.fluid["sulfuric-acid"].base_color,
-- secondary = adamo.colors.highgrey,
2020-09-29 06:57:47 +00:00
-- tertiary = data.raw.fluid.water.flow_color,
-- quaternary = adamo.colors.midgrey
2020-09-29 06:57:47 +00:00
--},
2020-05-21 11:36:04 +00:00
}
2020-09-29 06:57:47 +00:00
adamo.recipe.tint.apply(calcite_recipe)
2020-05-21 11:36:04 +00:00
local gypsum_recipe = {
type = "recipe",
name = "adamo-chemical-gypsum",
category = "chemistry",
enabled = false,
energy_required = 1,
show_amount_in_title = true,
main_product = "adamo-chemical-gypsum",
ingredients = {{
type = "fluid",
name = "sulfuric-acid",
amount = 50
},{
type = "fluid",
name = "water",
amount = 50
2020-09-29 06:57:47 +00:00
},{
type = "item",
name = "adamo-chemical-calcite",
amount = 5,
2020-05-21 11:36:04 +00:00
}},
results = {{
type = "item",
name = "adamo-chemical-gypsum",
amount = 5
}},
2020-09-29 06:57:47 +00:00
--crafting_machine_tint = {
-- primary = adamo.colors.midgrey,
2020-09-29 06:57:47 +00:00
-- secondary = data.raw.fluid["sulfuric-acid"].base_color,
-- tertiary = data.raw.fluid["sulfuric-acid"].flow_color,
-- quaternary = data.raw.fluid.water.flow_color
--},
2020-05-21 11:36:04 +00:00
}
2020-09-29 06:57:47 +00:00
adamo.recipe.tint.apply(gypsum_recipe)
2020-05-21 11:36:04 +00:00
local hydrofluoric_acid_recipe = {
type = "recipe",
name = "adamo-chemical-hydrofluoric-acid",
category = "chemistry",
subgroup = "fluid-recipes",
enabled = false,
energy_required = 1, -- same as sulfuric-acid
ingredients = {{
type = "fluid",
name = "sulfuric-acid",
amount = 50
},{
type = "fluid",
name = "water",
amount = 100
2020-09-29 06:57:47 +00:00
},{
type = "item",
name = "adamo-chemical-fluorite",
amount = 5
2020-05-21 11:36:04 +00:00
}},
results = {{
type='fluid',
name = "adamo-chemical-hydrofluoric-acid",
amount = 100
},{
type = "item",
name = "adamo-chemical-gypsum",
amount = 5,
catalyst_amount = 5
}},
main_product = "adamo-chemical-hydrofluoric-acid",
requester_paste_multiplier = 4,
2020-09-29 06:57:47 +00:00
--crafting_machine_tint = {
-- primary = adamo.colors.hf_base,
-- secondary = adamo.colors.midgrey,
2020-09-29 06:57:47 +00:00
-- tertiary = data.raw.fluid["sulfuric-acid"].flow_color,
-- quaternary = data.raw.fluid.water.flow_color,
--},
2020-05-21 11:36:04 +00:00
}
2020-09-29 06:57:47 +00:00
adamo.recipe.tint.apply(hydrofluoric_acid_recipe)
2020-05-21 11:36:04 +00:00
local water_recipe = {
type = "recipe",
name = "adamo-chemical-water-condensation",
category = "chemistry",
subgroup = "fluid-recipes",
enabled = true,
energy_required = 1,
ingredients = {{
type = "fluid",
name = "steam",
amount = 10
}},
results = {{
type = "fluid",
name = "water",
amount = 10
}},
main_product = "water",
emissions_multiplier = 0,
crafting_machine_tint = {
primary = data.raw.fluid["water"].base_color,
secondary = data.raw.fluid["steam"].base_color,
tertiary = data.raw.fluid["steam"].flow_color,
quaternary = data.raw.fluid["water"].flow_color
},
}
local clinker_recipe = {
type = "recipe",
name = "adamo-chemical-clinker",
category = "adamo-chemical-firing",
subgroup = "adamo-chemical-firing",
order = "0",
enabled = false,
energy_required = 6.4,
ingredients = {
{"adamo-chemical-calcite",5},
{"stone",5},
},
results = {
{"adamo-chemical-clinker",10}
}
}
local clinker_recipe_with_fluorite = {
type = "recipe",
name = "adamo-chemical-clinker-with-fluorite",
category = "adamo-chemical-firing",
subgroup = "adamo-chemical-firing",
order = "1",
enabled = false,
energy_required = 25.6,
ingredients = {
{"adamo-chemical-calcite",40},
2020-05-21 11:36:04 +00:00
{"adamo-chemical-fluorite",1},
{"adamo-chemical-gypsum",1},
{"stone",60},
2020-05-21 11:36:04 +00:00
},
results = {
{"adamo-chemical-clinker",100}
}
}
local limestone_brick_recipe = util.table.deepcopy(data.raw.recipe["stone-brick"])
if limestone_brick_recipe then
replace_in_recipe_io(limestone_brick_recipe,"stone","adamo-chemical-calcite")
limestone_brick_recipe.name = "adamo-chemical-limestone-brick"
end
local mixed_brick_recipe = util.table.deepcopy(data.raw.recipe["stone-brick"])
if mixed_brick_recipe then
add_ingredient(mixed_brick_recipe,"adamo-chemical-calcite",1)
scale_recipe(mixed_brick_recipe,1/2,"stone")
mixed_brick_recipe.name = "adamo-chemical-mixed-brick"
2020-05-21 11:36:04 +00:00
end
local cement_recipe = {
type = "recipe",
name = "adamo-chemical-cement",
category = "advanced-crafting",
enabled = false,
energy_required = 3.2,
icon = "__adamo-chemical__/graphics/icons/cement.png",
icon_size = 32,
ingredients = {
{"adamo-chemical-clinker",10},
{"adamo-chemical-gypsum",1}
},
results = {
{"adamo-chemical-cement",1}
}
}
local concrete_recipe = {
type = "recipe",
name = "adamo-chemical-concrete",
category = "adamo-chemical-binding",
subgroup = "adamo-chemical-binding",
order = "00[adamo-chemical-concrete]",
enabled = false,
energy_required = 8,
icon = "__base__/graphics/icons/concrete.png",
icon_size = 64,
ingredients = {
{"adamo-chemical-cement",5},
2020-05-21 11:36:04 +00:00
{"stone",50},
{type="fluid",name="water",amount=500}
2020-05-21 11:36:04 +00:00
},
results = {
{"concrete",50}
}
}
local refined_concrete_recipe = {
type = "recipe",
name = "adamo-chemical-refined-concrete",
category = "adamo-chemical-binding",
subgroup = "adamo-chemical-binding",
order = "00[adamo-chemical-refined-concrete]",
enabled = false,
energy_required = 8,
icon = "__base__/graphics/icons/refined-concrete.png",
icon_size = 64,
ingredients = {
{"adamo-chemical-cement",5},
2020-05-21 11:36:04 +00:00
{"stone",50},
{"SiSi-quartz",10},
{type="fluid",name="water",amount=500},
2020-05-21 11:36:04 +00:00
},
results = {
{"refined-concrete",50}
}
}
2020-09-29 06:57:47 +00:00
local stone_input_count = data.raw.item["stone"].stack_size
local water_input_count = stone_input_count*adamo.chem.mult.fluid
local landfill_output_count = math.ceil(stone_input_count/50)
local mineral_output_count = stone_input_count
- 20*landfill_output_count
2020-09-29 06:57:47 +00:00
local recover_ratio = 2/3
local adv_recover_ratio = recover_ratio
2020-05-21 11:36:04 +00:00
local basic_froth_flotation_recipe = {
type = "recipe",
name = "adamo-chemical-basic-mineral-processing",
category = "chemistry",
subgroup = "raw-material",
order = "h1[adamo-chemical-basic-mineral-processing]",
icon =
"__adamo-chemical__/graphics/icons/"
.."basic-mineral-processing.png",
icon_size = 32,
enabled = false,
always_show_made_in = true,
energy_required = 20,
ingredients = {{
type = "item",
name = "stone",
amount = stone_input_count,
2020-05-21 11:36:04 +00:00
},{
type = "fluid",
name = "water",
amount = water_input_count
2020-05-21 11:36:04 +00:00
}},
2023-12-20 23:37:40 +00:00
results = {{
type = "item",
name = quartz_item.name,
probability = adamo.geo.abundance.quartz,
amount = mineral_output_count*recover_ratio
},{
type = "item",
name = calcite_item.name,
probability = adamo.geo.abundance.calcite,
amount = mineral_output_count*recover_ratio
},{
type = "item",
name = gypsum_item.name,
probability = adamo.geo.abundance.gypsum,
amount = mineral_output_count*recover_ratio
},{
type = "item",
name = "iron-ore",
probability = adamo.geo.abundance.iron,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = "copper-ore",
probability = adamo.geo.abundance.copper,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = "coal",
probability = adamo.geo.abundance.coal,
amount = mineral_output_count*adv_recover_ratio
}},
2020-05-21 11:36:04 +00:00
crafting_machine_tint = {
primary = adamo.colors.softgreen,
2020-05-21 11:36:04 +00:00
secondary = data.raw.fluid.water.base_color,
tertiary = data.raw.fluid.water.flow_color,
quaternary = adamo.colors.highbrown,
2020-05-21 11:36:04 +00:00
},
}
local advanced_froth_flotation_recipe = {
type = "recipe",
name = "adamo-chemical-advanced-mineral-processing",
category = "chemistry",
subgroup = "raw-material",
order = "h0[adamo-chemical-advanced-mineral-processing]",
icon =
"__adamo-chemical__/graphics/icons/"
.."advanced-mineral-processing.png",
icon_size = 32,
enabled = false,
always_show_made_in = true,
energy_required = 20,
ingredients = {{
type = "item",
name = "stone",
amount = stone_input_count,
2020-05-21 11:36:04 +00:00
},{
type = "fluid",
name = "water",
amount = water_input_count
2020-05-21 11:36:04 +00:00
}},
2023-12-20 23:37:40 +00:00
results = {{
type = "item",
name = quartz_item.name,
probability = adamo.geo.abundance.quartz,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = fluorite_item.name,
probability = adamo.geo.abundance.fluorite,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = calcite_item.name,
probability = adamo.geo.abundance.calcite,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = gypsum_item.name,
probability = adamo.geo.abundance.gypsum,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = "sulfur",
probability = adamo.geo.abundance.sulfur,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = "iron-ore",
probability = adamo.geo.abundance.iron,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = "copper-ore",
probability = adamo.geo.abundance.copper,
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = "coal",
probability = adamo.geo.abundance.coal,
amount = mineral_output_count*adv_recover_ratio
}},
2020-05-21 11:36:04 +00:00
crafting_machine_tint = {
primary = adamo.colors.softgreen,
2020-05-21 11:36:04 +00:00
secondary = data.raw.fluid.water.base_color,
tertiary = data.raw.fluid.water.flow_color,
quaternary = adamo.colors.highbrown,
2020-05-21 11:36:04 +00:00
},
}
data:extend({
calcite_recipe,
gypsum_recipe,
hydrofluoric_acid_recipe,
water_recipe,
clinker_recipe,
clinker_recipe_with_fluorite,
limestone_brick_recipe,
mixed_brick_recipe,
2020-05-21 11:36:04 +00:00
cement_recipe,
concrete_recipe,
refined_concrete_recipe,
basic_froth_flotation_recipe,
advanced_froth_flotation_recipe,
})
add_recipes_to_tech(
"advanced-material-processing",
{
"adamo-chemical-basic-mineral-processing"
}
)
add_recipes_to_tech(
"advanced-material-processing-2",
{
"adamo-chemical-gypsum",
"adamo-chemical-calcite",
"adamo-chemical-advanced-mineral-processing",
}
)
add_recipes_to_tech(
"concrete",
{
"adamo-chemical-clinker",
"adamo-chemical-clinker-with-fluorite",
"adamo-chemical-cement",
"adamo-chemical-concrete",
"adamo-chemical-refined-concrete",
}
)
adamo.recipes.set.productivity({
2020-05-21 11:36:04 +00:00
"adamo-chemical-clinker",
"adamo-chemical-clinker-with-fluorite",
"adamo-chemical-limestone-brick",
"adamo-chemical-cement",
"adamo-chemical-basic-mineral-processing",
"adamo-chemical-advanced-mineral-processing",
"adamo-chemical-hydrofluoric-acid",
})