early salt
|
@ -6,6 +6,9 @@ Date: 2022-12-24
|
||||||
- Without "more intermediates", PCB can be made in normal chem plant
|
- Without "more intermediates", PCB can be made in normal chem plant
|
||||||
Changes:
|
Changes:
|
||||||
- Thumbnail tweak
|
- Thumbnail tweak
|
||||||
|
- Early game salt: New setting to choose one or both of
|
||||||
|
From water in fluid-enabled tier 1 assemblers (or tier 0 with AAI Industry) (default)
|
||||||
|
A starting area salt patch, and more salt near starting area
|
||||||
- SE: Less salt in core mining
|
- SE: Less salt in core mining
|
||||||
- SE: thermofluid basic recipe requires salt
|
- SE: thermofluid basic recipe requires salt
|
||||||
Features:
|
Features:
|
||||||
|
|
|
@ -6,7 +6,41 @@ require("map-gen-preset-updates")
|
||||||
-- require("compatibility/248k")
|
-- require("compatibility/248k")
|
||||||
require("compatibility/bob")
|
require("compatibility/bob")
|
||||||
|
|
||||||
local util = require("data-util");
|
local futil = require("util")
|
||||||
|
local util = require("data-util")
|
||||||
|
|
||||||
|
if util.me.early_assemblers() then
|
||||||
|
util.add_crafting_category("assembling-machine", "assembling-machine-1", "crafting-with-fluid")
|
||||||
|
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.north.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
|
||||||
|
fb.pipe_picture.south.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-S.png"
|
||||||
|
fb.pipe_picture.south.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
|
||||||
|
fb.pipe_picture.east.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-E.png"
|
||||||
|
fb.pipe_picture.east.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
|
||||||
|
fb.pipe_picture.west.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-W.png"
|
||||||
|
fb.pipe_picture.west.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if data.raw["assembling-machine"]["burner-assembling-machine"] then
|
||||||
|
util.add_crafting_category("assembling-machine", "burner-assembling-machine", "crafting-with-fluid")
|
||||||
|
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.north.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png"
|
||||||
|
fb.pipe_picture.south.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-S.png"
|
||||||
|
fb.pipe_picture.south.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png"
|
||||||
|
fb.pipe_picture.east.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-E.png"
|
||||||
|
fb.pipe_picture.east.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png"
|
||||||
|
fb.pipe_picture.west.filename = "__bzchlorine__/graphics/entity/assembler/assembling-machine-2-pipe-W.png"
|
||||||
|
fb.pipe_picture.west.hr_version.filename = "__bzchlorine__/graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
require("modules")
|
require("modules")
|
||||||
|
|
BIN
graphics/entity/assembler/assembling-machine-2-pipe-E.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
graphics/entity/assembler/assembling-machine-2-pipe-E.xcf
Normal file
BIN
graphics/entity/assembler/assembling-machine-2-pipe-N.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
graphics/entity/assembler/assembling-machine-2-pipe-N.xcf
Normal file
BIN
graphics/entity/assembler/assembling-machine-2-pipe-S.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
graphics/entity/assembler/assembling-machine-2-pipe-S.xcf
Normal file
BIN
graphics/entity/assembler/assembling-machine-2-pipe-W.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
graphics/entity/assembler/assembling-machine-2-pipe-W.xcf
Normal file
BIN
graphics/entity/assembler/hr-assembling-machine-2-pipe-E.png
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
graphics/entity/assembler/hr-assembling-machine-2-pipe-E.xcf
Normal file
BIN
graphics/entity/assembler/hr-assembling-machine-2-pipe-N.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
graphics/entity/assembler/hr-assembling-machine-2-pipe-N.xcf
Normal file
BIN
graphics/entity/assembler/hr-assembling-machine-2-pipe-S.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
graphics/entity/assembler/hr-assembling-machine-2-pipe-S.xcf
Normal file
BIN
graphics/entity/assembler/hr-assembling-machine-2-pipe-W.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
graphics/entity/assembler/hr-assembling-machine-2-pipe-W.xcf
Normal file
|
@ -36,6 +36,7 @@ bzchlorine-recipe-bypass=Bypass recipes
|
||||||
bzchlorine-list=Make a list of modified recipes
|
bzchlorine-list=Make a list of modified recipes
|
||||||
bzchlorine-salt=Generate mineable salt patches
|
bzchlorine-salt=Generate mineable salt patches
|
||||||
bzchlorine-more-intermediates=Enable more chloride intermediates
|
bzchlorine-more-intermediates=Enable more chloride intermediates
|
||||||
|
bzchlorine-early-salt=How to get salt early game
|
||||||
|
|
||||||
[mod-setting-description]
|
[mod-setting-description]
|
||||||
bzchlorine-recipe-bypass=Skip modifying these recipes (comma-separated list).
|
bzchlorine-recipe-bypass=Skip modifying these recipes (comma-separated list).
|
||||||
|
@ -44,3 +45,6 @@ bzchlorine-list=If enabled, the text command [color=orange]BZList[/color] will d
|
||||||
[string-mod-setting]
|
[string-mod-setting]
|
||||||
bzchlorine-more-intermediates-no=No
|
bzchlorine-more-intermediates-no=No
|
||||||
bzchlorine-more-intermediates-yes=Yes: Ferric chloride & vinyl chloride
|
bzchlorine-more-intermediates-yes=Yes: Ferric chloride & vinyl chloride
|
||||||
|
bzchlorine-early-salt-assembler=In early assemblers (enable fluid inputs)
|
||||||
|
bzchlorine-early-salt-mining=A starting area patch to mine (requires minable salt patches)
|
||||||
|
bzchlorine-early-salt-both=Both of the above
|
||||||
|
|
15
me.lua
|
@ -3,6 +3,21 @@ local me = {}
|
||||||
me.name = "bzchlorine"
|
me.name = "bzchlorine"
|
||||||
me.list = {}
|
me.list = {}
|
||||||
|
|
||||||
|
function me.starting_patch()
|
||||||
|
return (
|
||||||
|
me.get_setting("bzchlorine-early-salt") == "mining" or
|
||||||
|
me.get_setting("bzchlorine-early-salt") == "both"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
function me.early_assemblers()
|
||||||
|
return (
|
||||||
|
me.get_setting("bzchlorine-early-salt") == "assembler" or
|
||||||
|
me.get_setting("bzchlorine-early-salt") == "both" or
|
||||||
|
(not me.salt())
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
function me.more()
|
function me.more()
|
||||||
if me.get_setting("bz-all-intermediates") then return true end
|
if me.get_setting("bz-all-intermediates") then return true end
|
||||||
return me.get_setting("bzchlorine-more-intermediates") == "yes"
|
return me.get_setting("bzchlorine-more-intermediates") == "yes"
|
||||||
|
|
|
@ -42,6 +42,7 @@ data:extend({
|
||||||
base_density = 3,
|
base_density = 3,
|
||||||
base_spots_per_km2 = 2,
|
base_spots_per_km2 = 2,
|
||||||
regular_rq_factor_multiplier = 2.0,
|
regular_rq_factor_multiplier = 2.0,
|
||||||
|
has_starting_area_placement = util.me.starting_patch(),
|
||||||
},
|
},
|
||||||
|
|
||||||
stage_counts = {15000, 9500, 5500, 2900, 1300, 400, 150, 80},
|
stage_counts = {15000, 9500, 5500, 2900, 1300, 400, 150, 80},
|
||||||
|
@ -71,9 +72,10 @@ data:extend({
|
||||||
local richness = data.raw.resource["salt"].autoplace.richness_expression
|
local richness = data.raw.resource["salt"].autoplace.richness_expression
|
||||||
local probability = data.raw.resource["salt"].autoplace.probability_expression
|
local probability = data.raw.resource["salt"].autoplace.probability_expression
|
||||||
|
|
||||||
|
if not util.me.starting_patch() then
|
||||||
-- Modify salt autoplace richness:
|
-- Modify salt autoplace richness:
|
||||||
-- After 500 tiles it's standard
|
-- After 500 tiles it's standard
|
||||||
-- After 300 tiles it scales up
|
-- After 250 tiles it scales up
|
||||||
data.raw.resource["salt"].autoplace.richness_expression =
|
data.raw.resource["salt"].autoplace.richness_expression =
|
||||||
richness * noise.if_else_chain(
|
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.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(500)),
|
||||||
|
@ -82,11 +84,12 @@ data.raw.resource["salt"].autoplace.richness_expression =
|
||||||
|
|
||||||
data.raw.resource["salt"].autoplace.probability_expression =
|
data.raw.resource["salt"].autoplace.probability_expression =
|
||||||
probability * noise.if_else_chain(
|
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)),
|
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(249)),
|
||||||
0,
|
0,
|
||||||
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(300)),
|
noise.less_than(noise.distance_from(noise.var("x"), noise.var("y"), noise.var("starting_positions")), noise.to_noise_expression(250)),
|
||||||
0.3,
|
0.3,
|
||||||
1)
|
1)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
data:extend({
|
data:extend({
|
||||||
|
@ -111,13 +114,27 @@ data:extend({
|
||||||
name = "salt",
|
name = "salt",
|
||||||
result = "salt",
|
result = "salt",
|
||||||
ingredients = {{type="fluid", name="water", amount=100}},
|
ingredients = {{type="fluid", name="water", amount=100}},
|
||||||
enabled = false,
|
enabled = not not mods["aai-industry"],
|
||||||
category = mods.Krastorio2 and "fluid-filtration" or "crafting-with-fluid",
|
category = "crafting-with-fluid",
|
||||||
energy_required = mods.Krastorio2 and 1 or 2,
|
energy_required = 2,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if mods.Krastorio2 then
|
if mods.Krastorio2 then
|
||||||
util.add_unlock("kr-fluids-chemistry", "salt")
|
data:extend({
|
||||||
else
|
{
|
||||||
util.add_unlock("fluid-handling", "salt")
|
type = "recipe",
|
||||||
|
name = "salt-filtration",
|
||||||
|
result = "salt",
|
||||||
|
ingredients = {{type="fluid", name="water", amount=100}},
|
||||||
|
enabled = false,
|
||||||
|
category = mods.Krastorio2 and "fluid-filtration",
|
||||||
|
energy_required = 0.4,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
if mods.Krastorio2 then
|
||||||
|
util.add_unlock("kr-fluids-chemistry", "salt-filtration")
|
||||||
|
end
|
||||||
|
if not mods["aai-industry"] then
|
||||||
|
util.add_unlock("automation", "salt")
|
||||||
end
|
end
|
||||||
|
|
12
settings.lua
|
@ -5,18 +5,29 @@ data:extend({
|
||||||
setting_type = "startup",
|
setting_type = "startup",
|
||||||
default_value = "",
|
default_value = "",
|
||||||
allow_blank = true,
|
allow_blank = true,
|
||||||
|
order = "a",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type = "bool-setting",
|
type = "bool-setting",
|
||||||
name = "bzchlorine-list",
|
name = "bzchlorine-list",
|
||||||
setting_type = "startup",
|
setting_type = "startup",
|
||||||
default_value = false,
|
default_value = false,
|
||||||
|
order = "b",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type = "bool-setting",
|
type = "bool-setting",
|
||||||
name = "bzchlorine-salt",
|
name = "bzchlorine-salt",
|
||||||
setting_type = "startup",
|
setting_type = "startup",
|
||||||
default_value = true,
|
default_value = true,
|
||||||
|
order = "c1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "string-setting",
|
||||||
|
name = "bzchlorine-early-salt",
|
||||||
|
setting_type = "startup",
|
||||||
|
default_value = "assembler",
|
||||||
|
allowed_values = {"assembler", "mining", "both"},
|
||||||
|
order = "c2",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type = "string-setting",
|
type = "string-setting",
|
||||||
|
@ -24,5 +35,6 @@ data:extend({
|
||||||
setting_type = "startup",
|
setting_type = "startup",
|
||||||
default_value = "yes",
|
default_value = "yes",
|
||||||
allowed_values = {"yes", "no"},
|
allowed_values = {"yes", "no"},
|
||||||
|
order = "d",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|