adamo-chemical/data.lua

715 lines
17 KiB
Lua
Raw Normal View History

2020-05-21 11:36:04 +00:00
require("factsheet")
require("facilities")
adamochemical = {}
adamochemical.mixer = false
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"
},
},
prerequisites = {"chemical-science-pack"},
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,
})
local calcite_item = {
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
}
local clinker_item = {
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
}
local gypsum_item = {
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
}
local fluorite_item = {
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
}
local cement_item = {
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
})
local found_sisiquartz = false
if data.raw.item["SiSi-quartz"] then
data.raw.item["SiSi-quartz"]
.order = "g[adamo-chemical-quartz]"
data.raw.item["SiSi-quartz"]
.subgroup = "raw-material"
--data.raw.item["SiSi-quartz"]
--.icon = "__adamo-chemical__/graphics/icons/quartz.png"
--data.raw.item["SiSi-quartz"]
--.icon_size = 64
found_sisiquartz = true
if data.raw.recipe["SiSi-quartz"] then
data.raw.recipe["SiSi-quartz"]
.normal.hidden = true
data.raw.recipe["SiSi-quartz"]
.expensive.hidden = true
data.raw.recipe["SiSi-quartz"]
.icon = nil
data.raw.recipe["SiSi-quartz"]
.icon_size = nil
end
else
local quartz_item = {
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 = colors.hf_base,
flow_color = colors.hf_flow,
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 = colors.highgrey,
-- tertiary = data.raw.fluid.water.flow_color,
-- quaternary = colors.midgrey
--},
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 = colors.midgrey,
-- 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 = colors.hf_base,
-- secondary = colors.midgrey,
-- 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 brick_recipe = util.table.deepcopy(
data.raw.recipe["stone-brick"]
)
if brick_recipe then
replace_in_recipe_io(
brick_recipe,"stone","adamo-chemical-calcite"
)
brick_recipe.name = "adamo-chemical-limestone-brick"
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},
{"stone",50},
{type="fluid",name="water",amount=200}
},
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},
{"stone",50},
{"SiSi-quartz",10},
{type="fluid",name="water",amount=200},
},
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
}},
crafting_machine_tint = {
primary = colors.softgreen,
secondary = data.raw.fluid.water.base_color,
tertiary = data.raw.fluid.water.flow_color,
quaternary = colors.highbrown,
},
}
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
}},
crafting_machine_tint = {
primary = colors.softgreen,
secondary = data.raw.fluid.water.base_color,
tertiary = data.raw.fluid.water.flow_color,
quaternary = colors.highbrown,
},
}
if found_sisiquartz then
basic_froth_flotation_recipe.results = {{
type = "item",
name = "SiSi-quartz",
probability = adamo.geo.abundance.quartz,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-calcite",
probability = adamo.geo.abundance.calcite,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-gypsum",
probability = adamo.geo.abundance.gypsum,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*recover_ratio
},{
type = "item",
name = "sulfur",
probability = adamo.geo.abundance.sulfur,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "landfill",
amount = landfill_output_count
2020-05-21 11:36:04 +00:00
}}
advanced_froth_flotation_recipe.results = {{
type = "item",
name = "SiSi-quartz",
probability = adamo.geo.abundance.quartz,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*adv_recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-fluorite",
probability = adamo.geo.abundance.fluorite,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*adv_recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-calcite",
probability = adamo.geo.abundance.calcite,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*adv_recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-gypsum",
probability = adamo.geo.abundance.gypsum,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = "sulfur",
probability = adamo.geo.abundance.sulfur,
2020-09-29 06:57:47 +00:00
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
},{
type = "item",
name = "landfill",
amount = landfill_output_count
2020-05-21 11:36:04 +00:00
}}
else
basic_froth_flotation_recipe.results = {{
type = "item",
name = "adamo-chemical-quartz",
probability = adamo.geo.abundance.quartz,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-calcite",
probability = adamo.geo.abundance.calcite,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-gypsum",
probability = adamo.geo.abundance.gypsum,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*recover_ratio
},{
type = "item",
name = "sulfur",
probability = adamo.geo.abundance.sulfur,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "landfill",
amount = landfill_output_count
2020-05-21 11:36:04 +00:00
}}
advanced_froth_flotation_recipe.results = {{
type = "item",
name = "adamo-chemical-quartz",
probability = adamo.geo.abundance.quartz,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*adv_recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-fluorite",
probability = adamo.geo.abundance.fluorite,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*adv_recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-calcite",
probability = adamo.geo.abundance.calcite,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*adv_recover_ratio
2020-05-21 11:36:04 +00:00
},{
type = "item",
name = "adamo-chemical-gypsum",
probability = adamo.geo.abundance.gypsum,
2020-09-29 06:57:47 +00:00
amount = mineral_output_count*adv_recover_ratio
},{
type = "item",
name = "sulfur",
probability = adamo.geo.abundance.sulfur,
2020-09-29 06:57:47 +00:00
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
},{
type = "item",
name = "landfill",
amount = landfill_output_count
2020-05-21 11:36:04 +00:00
}}
end
data:extend({
calcite_recipe,
gypsum_recipe,
hydrofluoric_acid_recipe,
water_recipe,
clinker_recipe,
clinker_recipe_with_fluorite,
brick_recipe,
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",
}
)
set_productivity_recipes({
"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",
})