Update to 2.0

This commit is contained in:
Simon Brodtmann 2025-10-05 08:52:53 +02:00
parent 126c1bf6b3
commit 06281ea9ca
14 changed files with 196 additions and 341 deletions

View file

@ -6,26 +6,15 @@ if util.me.early_assemblers() then
data.raw["assembling-machine"]["assembling-machine-1"].fluid_boxes = futil.table.deepcopy(data.raw["assembling-machine"]["assembling-machine-2"].fluid_boxes)
for i, fb in pairs(data.raw["assembling-machine"]["assembling-machine-1"].fluid_boxes) do
if i ~= "off_when_no_fluid_recipe" and fb.pipe_picture then
fb.pipe_picture.north.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-W.png"
if fb.pipe_picture.north.hr_version then
fb.pipe_picture.north.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
end
fb.pipe_picture.north.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
if fb.pipe_picture.north.layers and fb.pipe_picture.north.layers[1] then
fb.pipe_picture.north.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-W.png"
fb.pipe_picture.north.layers[1].hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.layers[1].hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.layers[1].hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.layers[1].hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
fb.pipe_picture.north.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
fb.pipe_picture.north.layers[2] = nil
fb.pipe_picture.south.layers[2] = nil
fb.pipe_picture.east.layers[2] = nil
@ -38,25 +27,15 @@ if util.me.early_assemblers() then
data.raw["assembling-machine"]["burner-assembling-machine"].fluid_boxes = futil.table.deepcopy(data.raw["assembling-machine"]["assembling-machine-2"].fluid_boxes)
for i, fb in pairs(data.raw["assembling-machine"]["burner-assembling-machine"].fluid_boxes) do
if i ~= "off_when_no_fluid_recipe" and fb.pipe_picture then
fb.pipe_picture.north.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-W.png"
if fb.pipe_picture.north.hr_version then
fb.pipe_picture.north.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
end
fb.pipe_picture.north.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
if fb.pipe_picture.north.layers and fb.pipe_picture.north.layers[1] then
fb.pipe_picture.north.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-W.png"
fb.pipe_picture.north.layers[1].hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.layers[1].hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.layers[1].hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.layers[1].hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
fb.pipe_picture.north.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
fb.pipe_picture.south.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
fb.pipe_picture.east.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
fb.pipe_picture.west.layers[1].filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
fb.pipe_picture.north.layers[2] = nil
fb.pipe_picture.south.layers[2] = nil
fb.pipe_picture.east.layers[2] = nil

View file

@ -1,12 +1,16 @@
local util = require("data-util");
local cl_name = mods.Krastorio2 and "kr-chlorine" or "chlorine"
local hcl_name = mods.Krastorio2 and "kr-hydrogen-chloride" or "hydrogen-chloride"
if not mods.Krastorio2 then
data:extend({
{
type = "fluid",
name = "chlorine",
name = cl_name,
default_temperature = 25,
heat_capacity = "0.1KJ",
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",
@ -15,9 +19,9 @@ data:extend({
},
{
type = "fluid",
name = "hydrogen-chloride",
name = hcl_name,
default_temperature = 25,
heat_capacity = "0.1KJ",
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",
@ -36,13 +40,13 @@ data:extend({
icon_size = 64, icon_mipmaps = 4,
subgroup = "raw-material",
order = "b[chlorine-fe]",
stack_size = util.get_stack_size(100),
stack_size = 100,
},
{
type = "fluid",
name = "vinyl-chloride",
default_temperature = 25,
heat_capacity = "0.1KJ",
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",
@ -56,9 +60,9 @@ if not mods.Krastorio2 then
data:extend({
{
type = "recipe",
name = "chlorine",
results = {{type="fluid", name="chlorine", amount=10}},
ingredients = {{"salt", 2}},
name = cl_name,
results = {{type="fluid", name=cl_name, amount=10}},
ingredients = {{type="item", name="salt", amount=2}},
enabled = false,
category = "chemistry",
subgroup = "fluid-recipes",
@ -67,10 +71,10 @@ data:extend({
{
type = "recipe",
name = "hydrogen-chloride-pure",
results = {{type="fluid", name="hydrogen-chloride", amount=20}},
results = {{type="fluid", name=hcl_name, amount=20}},
ingredients = {
{type="fluid", name="water", amount=10},
{type="fluid", name="chlorine", amount=10},
{type="fluid", name=cl_name, amount=10},
},
enabled = false,
category = "chemistry",
@ -79,7 +83,7 @@ data:extend({
},
})
else
util.replace_ingredient("kr-water-electrolysis", "sand", "salt", 2)
util.replace_ingredient("kr-water-electrolysis", "kr-sand", "salt", 2)
if util.se6() then
util.multiply_time("kr-water-electrolysis", 5.0/28)
else
@ -90,9 +94,9 @@ data:extend({
{
type = "recipe",
name = "hydrogen-chloride-salt",
results = {{type="fluid", name="hydrogen-chloride", amount=10}},
results = {{type="fluid", name=hcl_name, amount=10}},
ingredients = {
{"salt", 1},
{type="item", name="salt", amount=1},
{type="fluid", name="water", amount=5},
{type="fluid", name="sulfuric-acid", amount=5},
},
@ -108,10 +112,10 @@ data:extend({
{
type = "recipe",
name = "ferric-chloride",
results = {{"ferric-chloride", 2}},
results = {{type="item", name="ferric-chloride", amount=2}},
ingredients = {
{"iron-plate", 2},
{type="fluid", name="chlorine", amount=30},
{type="item", name="iron-plate", amount=2},
{type="fluid", name=cl_name, amount=30},
},
enabled = false,
category = "chemistry",
@ -120,14 +124,14 @@ data:extend({
{
type = "recipe",
name = "ferric-chloride-hcl",
results = {{"ferric-chloride", 4}},
results = {{type="item", name="ferric-chloride", amount=4}},
icons = {
{icon = "__bzchlorine__/graphics/icons/ferric-chloride.png", icon_size=64, scale=1},
{icon = "__bzchlorine__/graphics/icons/hcl.png", icon_size=128, scale=0.25, shift={8,-8}},
},
ingredients = {
{"iron-ore", 1},
{type="fluid", name="hydrogen-chloride", amount=120},
{type="item", name="iron-ore", amount=1},
{type="fluid", name=hcl_name, amount=120},
},
enabled = false,
category = "chemistry",
@ -138,7 +142,7 @@ data:extend({
name = "vinyl-chloride",
results = {{type="fluid", name="vinyl-chloride", amount=20}},
ingredients = {
{type="fluid", name="chlorine", amount=10},
{type="fluid", name=cl_name, amount=10},
{type="fluid", name="petroleum-gas", amount=20},
},
enabled = false,
@ -159,7 +163,7 @@ data:extend({
{icon = "__bzchlorine__/graphics/technology/salt-tech.png", icon_size = 256, tint={a=.75,r=1,b=1,g=1} },
},
effects = {
{ type = "unlock-recipe", recipe = "chlorine" },
{ type = "unlock-recipe", recipe = cl_name },
{ type = "unlock-recipe", recipe = "hydrogen-chloride-salt" },
{ type = "unlock-recipe", recipe = "hydrogen-chloride-pure" },
},
@ -185,11 +189,12 @@ if mods.bzgas then
{
type="recipe",
name="bakelite-hcl",
results = {{"bakelite", 3}},
localised_name = { "item-name.bakelite" },
results = {{type="item", name="bakelite", amount=3}},
ingredients = {
{data.raw.item["phenol"] and "phenol" or "coal", 1},
{type="item", name=data.raw.item["phenol"] and "phenol" or "coal", amount=1},
{type="fluid", name="formaldehyde", amount=10},
{type="fluid", name="hydrogen-chloride", amount=5},
{type="fluid", name=hcl_name, amount=5},
},
icons = {
{icon = "__bzgas__/graphics/icons/bakelite.png", icon_size=128},

View file

@ -1,11 +1,13 @@
local util = require("data-util");
local cl_name = mods.Krastorio2 and "kr-chlorine" or cl_name
data:extend({
{
type = "fluid",
name = "epoxy",
default_temperature = 25,
heat_capacity = "0.1KJ",
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",
@ -20,11 +22,11 @@ data:extend({
name = "epoxy",
results = {
{type="fluid", name="epoxy", amount=10},
{"salt", 1},
{type="item", name="salt", amount=1},
},
main_product = "epoxy",
ingredients = {
{type="fluid", name="chlorine", amount=10},
{type="fluid", name=cl_name, amount=10},
{type="fluid", name="petroleum-gas", amount=10},
},
enabled = false,

View file

@ -1,5 +1,7 @@
local util = require("data-util");
local hcl_name = mods.Krastorio2 and "kr-hydrogen-chloride" or hcl_name
data:extend({
{
type = "item",
@ -8,10 +10,10 @@ data:extend({
icon_size = 128,
subgroup = "intermediate-product",
order = "f[advanced-circuit][pcb-substrate]",
stack_size = util.get_stack_size(200),
stack_size = 200,
},
})
if (not mods.bobelectronics and not mods.MDbobelectronics) then
if not (mods.bobelectronics or mods.MDbobelectronics or mods.MDbobelectronics2) then
data:extend({
{
type = "item",
@ -20,7 +22,7 @@ data:extend({
icon_size = 128,
subgroup = "intermediate-product",
order = "f[advanced-circuit][pcb]",
stack_size = util.get_stack_size(200),
stack_size = 200,
},
})
@ -31,44 +33,44 @@ data:extend({
type = "recipe",
name = "pcb-substrate",
results = {
{"pcb-substrate", 12},
{type="item", name="pcb-substrate", amount=12},
},
ingredients = {
{type="fluid", name="epoxy", amount=30},
{"plastic-bar", 3},
{type="item", name="plastic-bar", amount=3},
},
enabled = false,
category = "chemistry",
energy_required = 6,
},
})
util.add_unlock("advanced-electronics", "pcb-substrate")
util.add_unlock("advanced-circuit", "pcb-substrate")
-- These updates should be in data phase
util.replace_some_ingredient("pcb-substrate", "plastic-bar", 1, "silica", 3, {force=true})
if (not mods.bobelectronics and not mods.MDbobelectronics) then
if not (mods.bobelectronics or mods.MDbobelectronics or mods.MDbobelectronics2) then
data:extend({
{
type = "recipe",
name = "pcb",
results = {
{"pcb", 4},
{type="item", name="pcb", amount=4},
},
ingredients = util.me.more() and {
{"pcb-substrate", 4},
{"copper-plate", 1},
{"ferric-chloride", 2},
{type="item", name="pcb-substrate", amount=4},
{type="item", name="copper-plate", amount=1},
{type="item", name="ferric-chloride", amount=2},
{type="fluid", name="water", amount=20},
} or {
{"pcb-substrate", 4},
{"copper-plate", 1},
{type="fluid", name="hydrogen-chloride", amount=30}
{type="item", name="pcb-substrate", amount=4},
{type="item", name="copper-plate", amount=1},
{type="fluid", name=hcl_name, amount=30}
},
enabled = false,
category = "crafting-with-fluid",
energy_required = 8,
},
})
util.add_unlock("advanced-electronics", "pcb")
util.add_unlock("advanced-circuit", "pcb")
end

View file

@ -1,5 +1,4 @@
local resource_autoplace = require('resource-autoplace');
local noise = require('noise');
local futil = require("util");
local util = require("data-util");
@ -13,7 +12,6 @@ particle.name = "salt-particle"
for i, picture in ipairs(particle.pictures) do
local tint = {r=1, g=1, b=1, a=0}
picture.tint = tint
picture.hr_version.tint = tint
end
data:extend({particle})
@ -27,10 +25,6 @@ data:extend({
order = "b-e"
},
{
type = "noise-layer",
name = "salt"
},
{
type = "resource",
icon_size = 128,
name = "salt",
@ -64,20 +58,12 @@ data:extend({
{
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
}
filename = "__bzchlorine__/graphics/entity/ores/hr-salt.png",
priority = "extra-high",
size = 128,
frame_count = 8,
variation_count = 8,
scale = 0.5
}
},
},
@ -86,24 +72,24 @@ data:extend({
local richness = data.raw.resource["salt"].autoplace.richness_expression
local probability = data.raw.resource["salt"].autoplace.probability_expression
if not util.me.starting_patch() then
-- Modify salt autoplace richness:
-- After 500 tiles it's standard
-- After 250 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(249)),
0,
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(250)),
0.3,
1)
end
--if not util.me.starting_patch() then
-- -- Modify salt autoplace richness:
-- -- After 500 tiles it's standard
-- -- After 250 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(249)),
-- 0,
-- noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(250)),
-- 0.3,
-- 1)
--end
end
data:extend({
@ -113,20 +99,20 @@ data:extend({
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},
{filename="__bzchlorine__/graphics/icons/salt.png", size=128, scale=0.25},
{filename="__bzchlorine__/graphics/icons/salt-1.png", size=128, scale=0.25},
{filename="__bzchlorine__/graphics/icons/salt-2.png", size=128, scale=0.25},
{filename="__bzchlorine__/graphics/icons/salt-3.png", size=128, scale=0.25},
{filename="__bzchlorine__/graphics/icons/salt-4.png", size=128, scale=0.25},
},
subgroup = "raw-resource",
order = "t-c-a",
stack_size = util.get_stack_size(50)
stack_size = 50
},
{
type = "recipe",
name = "salt",
result = "salt",
results = {{type="item", name="salt", amount=1}},
ingredients = {{type="fluid", name="water", amount=100}},
enabled = not not mods["aai-industry"],
category = "crafting-with-fluid",
@ -138,10 +124,10 @@ if mods.Krastorio2 then
{
type = "recipe",
name = "salt-filtration",
result = "salt",
results = {{type="item", name="salt", amount=1}},
ingredients = {{type="fluid", name="water", amount=100}},
enabled = false,
category = mods.Krastorio2 and "fluid-filtration",
category = mods.Krastorio2 and "kr-fluid-filtration",
energy_required = 0.4,
},
})