This commit is contained in:
Brevven 2022-08-15 00:02:40 -07:00
parent 52c1432f20
commit db81ee44e2
4 changed files with 13 additions and 4 deletions

181
prototypes/chlorine.lua Normal file
View file

@ -0,0 +1,181 @@
local util = require("data-util");
if not mods.Krastorio2 then
data:extend({
{
type = "fluid",
name = "chlorine",
default_temperature = 25,
heat_capacity = "0.1KJ",
base_color = {r=0.60, g=0.90, b=0.50},
flow_color = {r=0.60, g=1.00, b=0.50},
icon = "__bzchlorine__/graphics/icons/chlorine.png",
icon_size = 128,
order = "a[fluid]-f[chlorine]",
},
{
type = "fluid",
name = "hydrogen-chloride",
default_temperature = 25,
heat_capacity = "0.1KJ",
base_color = {r=0.80, g=0.90, b=0.70},
flow_color = {r=0.80, g=1.00, b=0.70},
icon = "__bzchlorine__/graphics/icons/hcl.png",
icon_size = 128,
order = "a[fluid]-f[chlorine-h]",
},
})
end
if util.me.more() then
data:extend({
{
type = "item",
name = "ferric-chloride",
icon = "__bzchlorine__/graphics/icons/ferric-chloride.png",
icon_size = 64, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[chlorine-fe]",
stack_size = util.get_stack_size(100),
},
{
type = "fluid",
name = "vinyl-chloride",
default_temperature = 25,
heat_capacity = "0.1KJ",
base_color = {r=0.90, g=0.90, b=0.75},
flow_color = {r=0.90, g=1.00, b=0.75},
icon = "__bzchlorine__/graphics/icons/vinyl-chloride.png",
icon_size = 128,
order = "a[fluid]-f[chlorine-v]",
},
})
end
if not mods.Krastorio2 then
data:extend({
{
type = "recipe",
name = "chlorine",
results = {{type="fluid", name="chlorine", amount=10}},
ingredients = {{"salt", 2}},
enabled = false,
category = "chemistry",
energy_required = 0.5,
},
{
type = "recipe",
name = "hydrogen-chloride-pure",
results = {{type="fluid", name="hydrogen-chloride", amount=20}},
ingredients = {
{type="fluid", name="water", amount=10},
{type="fluid", name="chlorine", amount=10},
},
enabled = false,
category = "chemistry",
energy_required = 10,
},
})
else
util.replace_ingredient("kr-water-electrolysis", "sand", "salt", 2)
end
data:extend({
{
type = "recipe",
name = "hydrogen-chloride-salt",
results = {{type="fluid", name="hydrogen-chloride", amount=10}},
ingredients = {
{"salt", 1},
{type="fluid", name="water", amount=5},
{type="fluid", name="sulfuric-acid", amount=5},
},
enabled = false,
category = "chemistry",
energy_required = 1,
},
})
if util.me.more() then
data:extend({
{
type = "recipe",
name = "ferric-chloride",
results = {{"ferric-chloride", 2}},
ingredients = {
{"iron-plate", 2},
{type="fluid", name="chlorine", amount=30},
},
enabled = false,
category = "chemistry",
energy_required = 3,
},
{
type = "recipe",
name = "vinyl-chloride",
results = {{type="fluid", name="vinyl-chloride", amount=20}},
ingredients = {
{type="fluid", name="chlorine", amount=10},
{type="fluid", name="petroleum-gas", amount=20},
},
enabled = false,
category = "chemistry",
energy_required = 3,
},
})
end
util.add_unlock("plastics", "vinyl-chloride")
if not mods.Krastorio2 then
data:extend({
{
type="technology",
name="salt-processing",
icon = "__bzchlorine__/graphics/icons/chlorine.png", -- FIX
icon_size = 128,
effects = {
{ type = "unlock-recipe", recipe = "chlorine" },
{ type = "unlock-recipe", recipe = "hydrogen-chloride-salt" },
{ type = "unlock-recipe", recipe = "hydrogen-chloride-pure" },
},
unit = {
count = 70, time = 30,
ingredients = {{"automation-science-pack", 1}, {"logistic-science-pack", 1}},
},
prerequisites = {"fluid-handling"},
},
})
util.add_unlock("salt-processing", "ferric-chloride")
util.add_unlock("fluid-handling", "chemical-plant")
util.remove_recipe_effect("oil-processing", "chemical-plant")
else
util.add_unlock("fluids-chemistry", "ferric-chloride")
util.add_unlock("fluids-chemistry", "hydrogen-chloride-salt")
end
if mods.bzgas then
data:extend({
{
type="recipe",
name="bakelite-hcl",
results = {{"bakelite", 3}},
ingredients = {
{"phenol", 1},
{type="fluid", name="formaldehyde", amount=10},
{type="fluid", name="hydrogen-chloride", amount=5},
},
icons = {
{icon = "__bzgas__/graphics/icons/bakelite.png", icon_size=128},
{icon = "__bzchlorine__/graphics/icons/hcl.png", icon_size=128, scale=0.125, shift={-8,-8}},
},
enabled = false,
category = "chemistry",
energy_required = 3,
}
})
if mods.Krastorio2 then
util.add_unlock("advanced-chemistry", "bakelite-hcl")
else
util.add_unlock("salt-processing", "bakelite-hcl")
end
end

37
prototypes/epoxy.lua Normal file
View file

@ -0,0 +1,37 @@
local util = require("data-util");
data:extend({
{
type = "fluid",
name = "epoxy",
default_temperature = 25,
heat_capacity = "0.1KJ",
base_color = {r=0.90, g=0.95, b=0.90},
flow_color = {r=0.90, g=1.00, b=0.90},
icon = "__bzchlorine__/graphics/icons/epoxy.png",
icon_size = 128,
order = "a[fluid]-f[epoxy]",
},
})
data:extend({
{
type = "recipe",
name = "epoxy",
results = {
{type="fluid", name="epoxy", amount=10},
{"salt", 1},
},
main_product = "epoxy",
ingredients = {
{type="fluid", name="chlorine", amount=10},
{type="fluid", name="petroleum-gas", amount=10},
},
enabled = false,
category = "chemistry",
energy_required = 3,
},
})
util.add_unlock("plastics", "epoxy")
util.add_prerequisite("plastics", "salt-processing")

72
prototypes/pcb.lua Normal file
View file

@ -0,0 +1,72 @@
local util = require("data-util");
data:extend({
{
type = "item",
name = "pcb-substrate",
icon = "__bzchlorine__/graphics/icons/pcb-substrate.png",
icon_size = 128,
subgroup = "intermediate-product",
order = "f[advanced-circuit][pcb-substrate]",
stack_size = util.get_stack_size(200),
},
})
if (not mods.bobelectronics and not mods.MDbobelectronics) then
data:extend({
{
type = "item",
name = "pcb",
icon = "__bzchlorine__/graphics/icons/pcb.png",
icon_size = 128,
subgroup = "intermediate-product",
order = "f[advanced-circuit][pcb]",
stack_size = util.get_stack_size(200),
},
})
end
data:extend({
{
type = "recipe",
name = "pcb-substrate",
results = {
{"pcb-substrate", 6},
},
ingredients = {
{type="fluid", name="epoxy", amount=30},
{"plastic-bar", 3},
},
enabled = false,
category = "chemistry",
energy_required = 6,
},
})
util.add_unlock("advanced-electronics", "pcb-substrate")
-- These updates should be in data phase
util.replace_some_ingredient("pcb-substrate", "plastic-bar", 1, "silica", 3, {force=true})
util.replace_some_ingredient("pcb-substrate", "plastic-bar", 1, "bakelite", 1, {force=true})
if (not mods.bobelectronics and not mods.MDbobelectronics) then
data:extend({
{
type = "recipe",
name = "pcb",
results = {
{"pcb", 2},
},
ingredients = {
{"pcb-substrate", 2},
{"copper-plate", 2},
util.me.more() and {"ferric-chloride", 1} or {type="fluid", name="hydrogen-chloride", amount=15},
{type="fluid", name="water", amount=10},
},
enabled = false,
category = "crafting-with-fluid",
energy_required = 4,
},
})
util.add_unlock("advanced-electronics", "pcb")
end

123
prototypes/salt.lua Normal file
View file

@ -0,0 +1,123 @@
local resource_autoplace = require('resource-autoplace');
local noise = require('noise');
local util = require("data-util");
if util.me.salt() then
data:extend({
{
type = "autoplace-control",
category = "resource",
name = "salt",
richness = true,
order = "b-e"
},
{
type = "noise-layer",
name = "salt"
},
{
type = "resource",
icon_size = 128,
name = "salt",
icon = "__bzchlorine__/graphics/icons/salt.png",
flags = {"placeable-neutral"},
order="a-b-a",
map_color = {r=0.92, g=1.00, b=0.93},
tree_removal_probability=1,
tree_removal_max_distance=32*32,
minable =
{
hardness = 1,
mining_particle = "copper-ore-particle",
mining_time = 0.5,
result = "salt"
},
collision_box = {{ -0.1, -0.1}, {0.1, 0.1}},
selection_box = {{ -0.5, -0.5}, {0.5, 0.5}},
autoplace = resource_autoplace.resource_autoplace_settings{
name = "salt",
order = "b-z",
base_density = 3,
base_spots_per_km2 = 2,
regular_rq_factor_multiplier = 2.0,
},
stage_counts = {15000, 9500, 5500, 2900, 1300, 400, 150, 80},
stages =
{
sheet =
{
filename = "__bzchlorine__/graphics/entity/ores/salt.png",
priority = "extra-high",
size = 64,
frame_count = 8,
variation_count = 8,
hr_version =
{
filename = "__bzchlorine__/graphics/entity/ores/hr-salt.png",
priority = "extra-high",
size = 128,
frame_count = 8,
variation_count = 8,
scale = 0.5
}
}
},
},
})
local richness = data.raw.resource["salt"].autoplace.richness_expression
local probability = data.raw.resource["salt"].autoplace.probability_expression
-- Modify salt autoplace richness:
-- After 500 tiles it's standard
-- After 300 tiles it scales up
data.raw.resource["salt"].autoplace.richness_expression =
richness * noise.if_else_chain(
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(500)),
(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")) - 275)/475,
1)
data.raw.resource["salt"].autoplace.probability_expression =
probability * noise.if_else_chain(
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(299)),
0,
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(300)),
0.3,
1)
end
data:extend({
{
type = "item",
name = "salt",
icon_size = 128,
icon = "__bzchlorine__/graphics/icons/salt.png",
pictures = {
{filename="__bzchlorine__/graphics/icons/salt.png", size=128, scale=0.125},
{filename="__bzchlorine__/graphics/icons/salt-1.png", size=128, scale=0.125},
{filename="__bzchlorine__/graphics/icons/salt-2.png", size=128, scale=0.125},
{filename="__bzchlorine__/graphics/icons/salt-3.png", size=128, scale=0.125},
{filename="__bzchlorine__/graphics/icons/salt-4.png", size=128, scale=0.125},
},
subgroup = "raw-resource",
order = "t-c-a",
stack_size = util.get_stack_size(50)
},
{
type = "recipe",
name = "salt",
result = "salt",
ingredients = {{type="fluid", name="water", amount=100}},
enabled = false,
category = mods.Krastorio2 and "fluid-filtration" or "crafting-with-fluid",
energy_required = mods.Krastorio2 and 1 or 2,
},
})
if mods.Krastorio2 then
util.add_unlock("kr-fluids-chemistry", "salt")
else
util.add_unlock("fluid-handling", "salt")
end