Compare commits

...

12 commits

Author SHA1 Message Date
Simon Brodtmann
06281ea9ca Update to 2.0 2025-10-16 17:38:34 +02:00
Brevven
126c1bf6b3 balance SEK2 energy requirements for electrolysis 2024-03-23 14:12:41 -07:00
Brevven
e4eb4c4f2a up 2024-03-23 14:12:19 -07:00
Brevven
03d64c6e3d up 2024-03-23 12:13:22 -07:00
Brevven
dee0ce3df0 k2: bakelite recipe alt 2023-12-26 07:05:33 -08:00
Brevven
e85ca01dd2 credit 2023-04-16 03:33:17 -07:00
brevven
90b08c25e9
Merge pull request #5 from klarkxy/main
Add zh-CN locale
2023-04-16 03:31:37 -07:00
Brevven
2567aeef66 k2 electrolysis time halved 2023-04-16 01:44:44 -07:00
Brevven
6b8ec24e66 fix particle 2023-04-16 01:44:23 -07:00
Brevven
ea0b51054e matter 2023-04-16 01:43:41 -07:00
klarkxy
b42b0ea7b4 Add chinese mod-name and mod-description 2023-04-06 20:46:39 +08:00
klarkxy
ece220b4da Add zh-CN locale 2023-04-06 20:37:01 +08:00
18 changed files with 361 additions and 329 deletions

3
.editorconfig Normal file
View file

@ -0,0 +1,3 @@
[*]
indent_style = space
indent_size = 2

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.idea

View file

@ -14,6 +14,7 @@ See changelog.txt
## Thanks to
- [Benjah-bmm27](https://commons.wikimedia.org/wiki/File:Vinyl-chloride-3D-vdW.png) (vinyl chloride icon)
- [snouz](https://github.com/snouz) (logo inspiration)
- [cackling fiend](https://mods.factorio.com/user/cackling.fiend) (Update to 2.0)
### Compatibility
- [nihilistzsche](https://github.com/nihilistzsche)
@ -22,6 +23,7 @@ See changelog.txt
- [Sakuro](https://github.com/sakuro) (ja)
- [CV514](https://github.com/CV514) (ru)
- [Klarkxy](https://github.com/klarkxy) (zh-CN)
### Testing
- Berkelear

View file

@ -1,4 +1,30 @@
---------------------------------------------------------------------------------------------------
Version: 0.1.5
Date: 2024-03-24
Changes:
- K2 + SE: Cut the time for salt water electrolysis to balance energy requirements to be close
to what they were prior to SE changes. As of now the time is 1.25s, down from 3.5s; both at
5.17MW. Before the SE changes, it was 2.5s at 2.58MW.
---------------------------------------------------------------------------------------------------
Version: 0.1.4
Date: 2023-04-23
Fixes:
- K2: When used with Natural Gas mod, unlock alternate bakelite recipe
---------------------------------------------------------------------------------------------------
Version: 0.1.3
Date: 2023-04-16
Localization:
- zh-CN thanks to Klarkxy
---------------------------------------------------------------------------------------------------
Version: 0.1.2
Date: 2023-04-16
Features:
- K2 matter
Changes:
- K2 salt water electrolysis time cut in half (due to higher chlorine demands)
Fixes:
- Mining particle graphics update
---------------------------------------------------------------------------------------------------
Version: 0.1.1
Date: 2023-03-28
Fixes:

View file

@ -1,10 +1,10 @@
local util = require("data-util");
if mods.bobelectronics or mods.MDbobelectronics then
if mods.bobelectronics or mods.MDbobelectronics or mods.MDbobelectronics2 then
-- FeCL3 is now anhydrous, so hydrate it for bob
util.remove_ingredient("ferric-chloride-solution", "iron-ore")
util.remove_ingredient("ferric-chloride-solution", "hydrogen-chloride")
util.remove_ingredient("ferric-chloride-solution", mods["Krastorio2"] and "kr-hydrogen-chloride" or "hydrogen-chloride")
util.add_ingredient("ferric-chloride-solution", "ferric-chloride", 5)
util.add_ingredient("ferric-chloride-solution", "water", 50)

View file

@ -26,4 +26,61 @@ function util.force_enable_recipe(event, recipe_name)
end
end
function util.warptorio2_expansion_helper()
if script.active_mods["warptorio2_expansion"] then
function check_container_for_items(container,items)
local has_all =true
for k=1,#items do
if container.get_item_count(items[k].name)<items[k].count then has_all=false break end
end
return has_all
end
function remove_items_from_container(container,items)
for k=1,#items do
container.remove_item(items[k])
end
end
script.on_nth_tick(60, function (event)
if global.done then return end
local fix_items={
{name='iron-plate',count=100},
{name='iron-gear-wheel',count=100},
{name='repair-pack',count=50},
}
local entities = {}
for i=1,100 do
if game.surfaces[i] then
local lentities= game.surfaces[i].find_entities_filtered{area = {{-100, -100}, {100, 100}}, name = "wpe_broken_lab"}
for j, entity in pairs(lentities) do
table.insert(entities, entity)
end
end
end
if #entities == 0 then
if global.checking then
-- The lab has already been fixed
global.done = true
else
-- Check that the lab doesn't reappear due to a warp
global.checking = true
end
return
end
if check_container_for_items(entities[1],fix_items) then
remove_items_from_container(entities[1],fix_items)
local lab = entities[1].surface.create_entity({name='wpe_repaired_lab', position=entities[1].position, force = game.forces.player})
lab.destructible=false
lab.minable=false
entities[1].destroy()
global.done = true
end
end)
end
end
return util

View file

@ -64,17 +64,7 @@ function util.fe_plus(sub)
end
end
function util.get_stack_size(default)
if mods.Krastorio2 then
local size = get_setting("kr-stack-size")
if size and tonumber(size) then
return tonumber(size)
end
end
return default
end
function util.k2assets()
function util.k2assets()
if mods["Krastorio2Assets"] then
return "__Krastorio2Assets__"
end
@ -111,8 +101,8 @@ function util.se_landfill(params)
category = "hard-recycling",
order = "z-b-"..params.ore,
subgroup = "terrain",
result = "landfill",
ingredients = {{params.ore, 50}},
results = {{type="item", name="landfill", amount=1}},
ingredients = {{type="item", name=params.ore, amount=50}},
}
})
util.add_unlock("se-recycling-facility", lname)
@ -123,7 +113,7 @@ end
-- k2 matter
-- params: {k2matter}, k2baseicon , {icon}
function util.k2matter(params)
local matter = require("__Krastorio2__/lib/public/data-stages/matter-util")
local matter = require("__Krastorio2__/prototypes/libraries/matter")
if mods["space-exploration"] then
params.k2matter.need_stabilizer = true
end
@ -169,7 +159,7 @@ function util.k2matter(params)
{
{"production-science-pack", 1},
{"utility-science-pack", 1},
{"matter-tech-card", 1}
{"kr-matter-tech-card", 1}
},
time = 45,
},
@ -177,7 +167,7 @@ function util.k2matter(params)
},
})
end
matter.createMatterRecipe(params.k2matter)
matter.make_recipes(params.k2matter)
end
@ -211,16 +201,16 @@ function util.se_matter(params)
energy_required = params.energy_required,
enabled = false,
ingredients = {
{sedata, 1},
{type="item", name=sedata, amount=1},
{type="fluid", name="se-particle-stream", amount=50},
{type="fluid", name="se-space-coolant-supercooled", amount=25},
},
results = {
{params.ore, params.quant_out},
{"se-contaminated-scrap", 1},
{type=item, name=sedata, amount=1, probability=.99},
{type=item, name=sejunk, amount=1, probability=.01},
{type="fluid", name="se-space-coolant-hot", amount=25, catalyst_amount=25},
{type="item", name=params.ore, amount=params.quant_out},
{type="item", name="se-contaminated-scrap", amount=1},
{type="item", name=sedata, amount=1, probability=.99},
{type="item", name=sejunk, amount=1, probability=.01},
{type="fluid", name="se-space-coolant-hot", amount=25, ignored_by_productivity=25, ignored_by_stats=25},
}
}
})
@ -250,14 +240,14 @@ function util.se_matter(params)
energy_required = 30,
enabled = false,
ingredients = {
{"se-kr-matter-liberation-data", 1},
{params.ore, params.quant_in},
{type="item", name="se-kr-matter-liberation-data", amount=1},
{type="item", name=params.ore, amount=params.quant_in},
{type="fluid", name="se-particle-stream", amount=50},
},
results = {
{type=item, name="se-kr-matter-liberation-data", amount=1, probability=.99},
{type=item, name=sejunk, amount=1, probability=.01},
{type="fluid", name="se-particle-stream", amount=params.stream_out, catalyst_amount=50},
{type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99},
{type="item", name=sejunk, amount=1, probability=.01},
{type="fluid", name="se-particle-stream", amount=params.stream_out, ignored_by_productivity=50, ignored_by_stats=50},
}
}
})
@ -284,7 +274,7 @@ function util.se_matter(params)
{"se-astronomic-science-pack-4", 1},
{"se-energy-science-pack-4", 1},
{"se-material-science-pack-4", 1},
{"matter-tech-card", 1},
{"kr-matter-tech-card", 1},
{"se-deep-space-science-pack-1", 1},
}
@ -298,18 +288,6 @@ function util.se_matter(params)
end
end
-- Get the normal prototype for a recipe -- either .normal or the recipe itself
function util.get_normal(recipe_name)
if data.raw.recipe[recipe_name] then
recipe = data.raw.recipe[recipe_name]
if recipe.normal and recipe.normal.ingredients then
return recipe.normal
elseif recipe.ingredients then
return recipe
end
end
end
-- Set/override a technology's prerequisites
function util.set_prerequisite(technology_name, prerequisites)
local technology = data.raw.technology[technology_name]
@ -376,7 +354,7 @@ function util.add_unlock(technology_name, recipe)
end
-- Check if a tech unlocks a recipe
function util.check_unlock(technology_name, recipe_name)
function util.check_unlock(technology_name, recipe)
local technology = data.raw.technology[technology_name]
if technology and technology.effects then
for i, effect in pairs(technology.effects) do
@ -421,17 +399,13 @@ end
function util.set_enabled(recipe_name, enabled)
if data.raw.recipe[recipe_name] then
if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.enabled = enabled end
if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.enabled = enabled end
if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].enabled = enabled end
data.raw.recipe[recipe_name].enabled = enabled
end
end
function util.set_hidden(recipe_name)
if data.raw.recipe[recipe_name] then
if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.hidden = true end
if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.hidden = true end
if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].hidden = true end
data.raw.recipe[recipe_name].hidden = true
end
end
@ -441,8 +415,6 @@ function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity, option
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
me.add_modified(recipe_name)
add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
add_or_add_to_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
add_or_add_to_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
end
end
@ -465,8 +437,6 @@ function util.add_ingredient(recipe_name, ingredient, quantity, options)
if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then
me.add_modified(recipe_name)
add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity, is_fluid)
add_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity, is_fluid)
add_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity, is_fluid)
end
end
@ -480,7 +450,7 @@ function add_ingredient(recipe, ingredient, quantity, is_fluid)
if is_fluid then
table.insert(recipe.ingredients, {type="fluid", name=ingredient, amount=quantity})
else
table.insert(recipe.ingredients, {ingredient, quantity})
table.insert(recipe.ingredients, {type="item", name=ingredient, amount=quantity})
end
end
end
@ -491,8 +461,6 @@ function util.add_ingredient_raw(recipe_name, ingredient, options)
if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then
me.add_modified(recipe_name)
add_ingredient_raw(data.raw.recipe[recipe_name], ingredient)
add_ingredient_raw(data.raw.recipe[recipe_name].normal, ingredient)
add_ingredient_raw(data.raw.recipe[recipe_name].expensive, ingredient)
end
end
@ -516,8 +484,6 @@ function util.set_ingredient(recipe_name, ingredient, quantity, options)
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
me.add_modified(recipe_name)
set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
set_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
set_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
end
end
@ -541,29 +507,18 @@ end
-- Only works for recipes with multiple products
function util.add_product(recipe_name, product, options)
if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] and
(data.raw.item[product[1]] or data.raw.item[product.name] or
data.raw.fluid[product[1]] or data.raw.fluid[product.name]
) then
if data.raw.recipe[recipe_name] and
(data.raw.item[product.name] or data.raw.fluid[product.name]) then
add_product(data.raw.recipe[recipe_name], product)
add_product(data.raw.recipe[recipe_name].normal, product)
add_product(data.raw.recipe[recipe_name].expensive, product)
end
end
function add_product(recipe, product)
if recipe ~= nil then
if (product[1] and data.raw.item[product[1]]) or
(product.name and data.raw[product.type][product.name]) then
if not recipe.normal then
if recipe.results == nil then
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}}
end
recipe.result = nil
recipe.result_count = nil
table.insert(recipe.results, product)
if recipe.results == nil then
recipe.results = {}
end
end
table.insert(recipe.results, product)
end
end
@ -571,18 +526,13 @@ end
function util.get_ingredient_amount(recipe_name, ingredient_name)
local recipe = data.raw.recipe[recipe_name]
if recipe then
if recipe.normal and recipe.normal.ingredients then
for i, ingredient in pairs(recipe.normal.ingredients) do
if ingredient[1] == ingredient_name then return ingredient[2] end
if ingredient.name == ingredient_name then return ingredient.amount end
end
elseif recipe.ingredients then
if recipe.ingredients then
for i, ingredient in pairs(recipe.ingredients) do
if ingredient[1] == ingredient_name then return ingredient[2] end
if ingredient.name == ingredient_name then return ingredient.amount end
end
end
return 0
return 1
end
return 0
end
@ -592,14 +542,7 @@ function util.get_amount(recipe_name, product)
if not product then product = recipe_name end
local recipe = data.raw.recipe[recipe_name]
if recipe then
if recipe.normal and recipe.normal.results then
for i, result in pairs(recipe.normal.results) do
if result[1] == product then return result[2] end
if result.name == product then return result.amount end
end
elseif recipe.normal and recipe.normal.result_count then
return recipe.normal.result_count
elseif recipe.results then
if recipe.results then
for i, result in pairs(recipe.results) do
if result[1] == product then return result[2] end
if result.name == product then return result.amount end
@ -617,9 +560,7 @@ function util.get_result_count(recipe_name, product)
if not product then product = recipe_name end
local recipe = data.raw.recipe[recipe_name]
if recipe then
if recipe.normal and recipe.normal.results then
return #(recipe.normal.results)
elseif recipe.results then
if recipe.results then
return #(recipe.results)
end
return 1
@ -634,8 +575,6 @@ function util.replace_ingredient(recipe_name, old, new, amount, multiply, option
if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then
me.add_modified(recipe_name)
replace_ingredient(data.raw.recipe[recipe_name], old, new, amount, multiply)
replace_ingredient(data.raw.recipe[recipe_name].normal, old, new, amount, multiply)
replace_ingredient(data.raw.recipe[recipe_name].expensive, old, new, amount, multiply)
end
end
@ -677,8 +616,6 @@ function util.remove_ingredient(recipe_name, old, options)
if data.raw.recipe[recipe_name] then
me.add_modified(recipe_name)
remove_ingredient(data.raw.recipe[recipe_name], old)
remove_ingredient(data.raw.recipe[recipe_name].normal, old)
remove_ingredient(data.raw.recipe[recipe_name].expensive, old)
end
end
@ -704,28 +641,23 @@ function util.replace_some_product(recipe_name, old, old_amount, new, new_amount
if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then
me.add_modified(recipe_name)
replace_some_product(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid)
replace_some_product(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount, is_fluid)
replace_some_product(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount, is_fluid)
end
end
function replace_some_product(recipe, old, old_amount, new, new_amount)
function replace_some_product(recipe, old, old_amount, new, new_amount, is_fluid)
if recipe ~= nil then
if recipe.result == new then return end
if recipe.results then
for i, existing in pairs(recipe.results) do
if existing[1] == new or existing.name == new then
if existing.name == new then
return
end
end
end
add_product(recipe, {new, new_amount})
add_product(recipe, {type=is_fluid and "fluid" or "item", name=new, amount=new_amount})
for i, product in pairs(recipe.results) do
if product.name == old then
product.amount = math.max(1, product.amount - old_amount)
end
if product[1] == old then
product[2] = math.max(1, product[2] - old_amount)
end
end
end
@ -738,8 +670,6 @@ function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amo
if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then
me.add_modified(recipe_name)
replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid)
replace_some_ingredient(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount, is_fluid)
replace_some_ingredient(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount, is_fluid)
end
end
@ -768,8 +698,6 @@ function util.set_product_amount(recipe_name, product, amount, options)
me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then
set_product_amount(data.raw.recipe[recipe_name], product, amount)
set_product_amount(data.raw.recipe[recipe_name].normal, product, amount)
set_product_amount(data.raw.recipe[recipe_name].expensive, product, amount)
end
end
@ -808,8 +736,6 @@ function util.multiply_recipe(recipe_name, multiple, options)
me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then
multiply_recipe(data.raw.recipe[recipe_name], multiple)
multiply_recipe(data.raw.recipe[recipe_name].normal, multiple)
multiply_recipe(data.raw.recipe[recipe_name].expensive, multiple)
end
end
@ -817,8 +743,6 @@ function multiply_recipe(recipe, multiple)
if recipe then
if recipe.energy_required then
recipe.energy_required = recipe.energy_required * multiple
else
recipe.energy_required = 0.5 * multiple -- 0.5 is factorio default
end
if recipe.result_count then
recipe.result_count = recipe.result_count * multiple
@ -833,8 +757,11 @@ function multiply_recipe(recipe, multiple)
result.amount_min = result.amount_min * multiple
result.amount_max = result.amount_max * multiple
end
if result.catalyst_amount then
result.catalyst_amount = result.catalyst_amount * multiple
if result.ignored_by_productivity then
result.ignored_by_productivity = result.ignored_by_productivity * multiple
end
if result.ignored_by_stats then
result.ignored_by_stats = result.ignored_by_stats * multiple
end
end
if result[1] then
@ -861,9 +788,8 @@ end
-- Returns true if a recipe has an ingredient
function util.has_ingredient(recipe_name, ingredient)
return data.raw.recipe[recipe_name] and (
has_ingredient(data.raw.recipe[recipe_name], ingredient) or
has_ingredient(data.raw.recipe[recipe_name].normal, ingredient))
return data.raw.recipe[recipe_name] and
has_ingredient(data.raw.recipe[recipe_name], ingredient)
end
function has_ingredient(recipe, ingredient)
@ -883,8 +809,6 @@ function util.remove_product(recipe_name, old, options)
me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then
remove_product(data.raw.recipe[recipe_name], old)
remove_product(data.raw.recipe[recipe_name].normal, old)
remove_product(data.raw.recipe[recipe_name].expensive, old)
end
end
@ -907,8 +831,6 @@ function util.set_main_product(recipe_name, product, options)
if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] then
set_main_product(data.raw.recipe[recipe_name], product)
set_main_product(data.raw.recipe[recipe_name].normal, product)
set_main_product(data.raw.recipe[recipe_name].expensive, product)
end
end
@ -922,13 +844,11 @@ end
function util.replace_product(recipe_name, old, new, options)
if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] then
replace_product(data.raw.recipe[recipe_name], old, new, options)
replace_product(data.raw.recipe[recipe_name].normal, old, new, options)
replace_product(data.raw.recipe[recipe_name].expensive, old, new, options)
replace_product(data.raw.recipe[recipe_name], old, new)
end
end
function replace_product(recipe, old, new, options)
function replace_product(recipe, old, new)
if recipe then
if recipe.main_product == old then
recipe.main_product = new
@ -968,8 +888,6 @@ function util.set_recipe_time(recipe_name, time, options)
me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then
set_recipe_time(data.raw.recipe[recipe_name], time)
set_recipe_time(data.raw.recipe[recipe_name].normal, time)
set_recipe_time(data.raw.recipe[recipe_name].expensive, time)
end
end
@ -987,8 +905,6 @@ function util.multiply_time(recipe_name, factor, options)
me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then
multiply_time(data.raw.recipe[recipe_name], factor)
multiply_time(data.raw.recipe[recipe_name].normal, factor)
multiply_time(data.raw.recipe[recipe_name].expensive, factor)
end
end
@ -1006,8 +922,6 @@ function util.add_time(recipe_name, amount, options)
me.add_modified(recipe_name)
if data.raw.recipe[recipe_name] then
add_time(data.raw.recipe[recipe_name], amount)
add_time(data.raw.recipe[recipe_name].normal, amount)
add_time(data.raw.recipe[recipe_name].expensive, amount)
end
end
@ -1031,7 +945,7 @@ end
-- Set recipe subgroup
function util.set_subgroup(recipe_name, subgroup, options)
if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] and data.raw["item-subgroup"][subgroup] then
if data.raw.recipe[recipe_name] then
me.add_modified(recipe_name)
data.raw.recipe[recipe_name].subgroup = subgroup
end
@ -1050,34 +964,16 @@ function util.add_icon(recipe_name, icon, options)
if data.raw.recipe[recipe_name] then
me.add_modified(recipe_name)
if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then
if data.raw.recipe[recipe_name].icon then
data.raw.recipe[recipe_name].icons = {{
icon=data.raw.recipe[recipe_name].icon,
icon_size=data.raw.recipe[recipe_name].icon_size,
icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps,
}}
elseif data.raw.item[data.raw.recipe[recipe_name].main_product] then
data.raw.recipe[recipe_name].icons = {{
icon=data.raw.item[data.raw.recipe[recipe_name].main_product].icon,
icon_size=data.raw.item[data.raw.recipe[recipe_name].main_product].icon_size,
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].main_product].icon_mipmaps,
}}
elseif data.raw.item[data.raw.recipe[recipe_name].result] then
data.raw.recipe[recipe_name].icons = {{
icon=data.raw.item[data.raw.recipe[recipe_name].result].icon,
icon_size=data.raw.item[data.raw.recipe[recipe_name].result].icon_size,
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].result].icon_mipmaps,
}}
elseif data.raw.recipe[recipe_name].normal and
data.raw.item[data.raw.recipe[recipe_name].normal.result] then
data.raw.recipe[recipe_name].icons = {{
icon=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon,
icon_size=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_size,
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_mipmaps,
}}
end
data.raw.recipe[recipe_name].icon = nil
data.raw.recipe[recipe_name].icon_size = nil
data.raw.recipe[recipe_name].icons = {}
if data.raw.recipe[recipe_name].icon then
data.raw.recipe[recipe_name].icons = {{
icon=data.raw.recipe[recipe_name].icon,
icon_size=data.raw.recipe[recipe_name].icon_size,
icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps,
}}
data.raw.recipe[recipe_name].icon = nil
data.raw.recipe[recipe_name].icon_size = nil
end
end
table.insert(data.raw.recipe[recipe_name].icons, icon)
end
@ -1137,8 +1033,6 @@ function util.add_to_ingredient(recipe, ingredient, amount, options)
if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe] then
add_to_ingredient(data.raw.recipe[recipe], ingredient, amount)
add_to_ingredient(data.raw.recipe[recipe].normal, ingredient, amount)
add_to_ingredient(data.raw.recipe[recipe].expensive, ingredient, amount)
end
end
@ -1161,8 +1055,6 @@ function util.add_to_product(recipe_name, product, amount, options)
if not should_force(options) and bypass(recipe_name) then return end
if data.raw.recipe[recipe_name] then
add_to_product(data.raw.recipe[recipe_name], product, amount)
add_to_product(data.raw.recipe[recipe_name].normal, product, amount)
add_to_product(data.raw.recipe[recipe_name].expensive, product, amount)
end
end
@ -1285,10 +1177,8 @@ function remove_prior_unlocks(tech, recipe)
util.remove_recipe_effect(tech, recipe)
if technology.prerequisites then
for i, prerequisite in pairs(technology.prerequisites) do
if string.sub(prerequisite, 1, 3) ~= 'ei_' then
-- log("BZZZ removing prior unlocks for " .. recipe .. " from " .. tech ..", checking " .. prerequisite) -- Handy Debug :|
remove_prior_unlocks(prerequisite, recipe)
end
-- log("BZZZ removing prior unlocks for " .. tech ..", checking " .. prerequisite) -- Handy Debug :|
remove_prior_unlocks(prerequisite, recipe)
end
end
end
@ -1330,9 +1220,7 @@ function replace_ingredients_prior_to(tech, old, new, multiplier)
if technology.prerequisites then
for i, prerequisite in pairs(technology.prerequisites) do
-- log("BZZZ checking " .. prerequisite) -- Handy Debug :|
if string.sub(prerequisite, 1, 3) ~= 'ei_' then
replace_ingredients_prior_to(prerequisite, old, new, multiplier)
end
replace_ingredients_prior_to(prerequisite, old, new, multiplier)
end
end
end

View file

@ -3,6 +3,8 @@ require("prototypes/chlorine")
require("prototypes/epoxy")
require("prototypes/pcb")
require("matter")
local util = require("data-util");
if util.se6() then

View file

@ -1,27 +1,27 @@
{
"name": "bzchlorine",
"version": "0.1.1",
"factorio_version": "1.1",
"version": "2.0.0",
"factorio_version": "2.0",
"title": "Salt & Chlorine",
"author": "Brevven",
"contact": "",
"homepage": "",
"dependencies": [
"base >= 1.1.0",
"? bzfoundry >= 0.2.1",
"? bztitanium >= 1.2.0",
"? bzlead >= 1.2.0",
"? bzzirconium >= 0.6.0",
"base >= 2.0.0",
"? bzfoundry >= 2.0.0",
"? bztitanium >= 2.0.26",
"? bzlead >= 2.0.28",
"? bzzirconium >= 2.1.13",
"? bztungsten >= 0.6.0",
"? bzcarbon >= 0.5.5",
"? bztin >= 0.1.8",
"? bzgas",
"? space-exploration >= 0.5.100",
"? aai-industry",
"(?) aai-loaders",
"? Krastorio2",
"? bzcarbon >= 2.0.21",
"? bztin >= 2.1.15",
"? bzgas >= 2.0.0",
"? space-exploration >= 0.7.34",
"? aai-industry >= 0.6.13",
"(?) aai-loaders >= 0.2.7",
"? Krastorio2 >= 2.0.8",
"? bobelectronics",
"? MDbobelectronics",
"? MDbobelectronics2",
"? deadlock-beltboxes-loaders",
"? DeadlockCrating"
],

57
locale/zh-CN/salt.cfg Normal file
View file

@ -0,0 +1,57 @@
[entity-name]
salt=
[autoplace-control-names]
salt=[item=salt] __ENTITY__salt__
[item-name]
salt=__ENTITY__salt__
ferric-chloride=氯化铁
pcb=PCB
pcb-substrate=__ITEM__pcb__ 基板
[item-description]
pcb=印刷电路板
pcb-substrate=用于蚀刻电路的电路板
[fluid-name]
chlorine=
epoxy=环氧树脂
hydrogen-chloride=氯化氢
vinyl-chloride=氯乙烯
[technology-name]
chlorine-processing=氯气加工
[technology-description]
[recipe-name]
[recipe-description]
# Settings
[mod-setting-name]
bzchlorine-recipe-bypass=绕过配方
bzchlorine-list=列出修改后的配方
bzchlorine-salt=生成可开采的盐矿
bzchlorine-more-intermediates=提供更多氯化物中间体
bzchlorine-early-salt=如何尽早获得盐
[mod-setting-description]
bzchlorine-recipe-bypass=跳过修改这些配方(逗号分隔的列表)。
bzchlorine-list=如果启用,文本命令 [color=orange]BZList[/color] 会将一个文件转储到脚本输出目录,其中包含已修改配方的完整列表。\n建议在完成其他设置配置后关闭此功能。
[string-mod-setting]
bzchlorine-more-intermediates-no=
bzchlorine-more-intermediates-yes=是:氯化铁和氯乙烯
bzchlorine-early-salt-assembler=在早期装配器中(启用流体输入)
bzchlorine-early-salt-mining=在起始区域生成可开采的盐矿
bzchlorine-early-salt-both=以上两者
[mod-name]
bzchlorine=BZ-盐和氯
[mod-description]
bzchlorine=在基础游戏中添加盐、氯等。重新设计先进的电路制作。\n\n与Krastorio 2和Space Exploration兼容。BZ Mods的独立作品。

12
matter.lua Normal file
View file

@ -0,0 +1,12 @@
-- Matter recipes for Krastorio2
if mods["Krastorio2"] then
local matter = require("__Krastorio2__/prototypes/libraries/matter");
local salt_matter = {
material = { type = "item", name = "salt", amount = 1 },
matter_count = 2,
energy_required = 1,
need_stabilizer = false,
unlocked_by_technology = "salt-matter-processing",
}
matter.make_recipes(salt_matter)
end

View file

@ -1,16 +1,7 @@
-- Enable prod modules for some recipes
local util = require("data-util")
local util = require("data-util");
for i, recipe in pairs(util.me.recipes) do
if data.raw.recipe[recipe] then
for j, module in pairs(data.raw.module) do
if module.effect then
for effect_name, effect in pairs(module.effect) do
if effect_name == "productivity" and effect.bonus > 0 and module.limitation and #module.limitation > 0 then
table.insert(module.limitation, recipe)
end
end
end
end
data.raw.recipe[recipe].allow_productivity = true
end
end

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,15 +83,20 @@ 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
util.multiply_time("kr-water-electrolysis", 0.5)
end
end
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},
},
@ -103,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",
@ -115,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",
@ -133,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,
@ -154,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" },
},
@ -180,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},
@ -196,7 +206,7 @@ if mods.bzgas then
}
})
if mods.Krastorio2 then
util.add_unlock("advanced-chemistry", "bakelite-hcl")
util.add_unlock("kr-advanced-chemistry", "bakelite-hcl")
else
util.add_unlock("chlorine-processing", "bakelite-hcl")
end

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,9 +1,21 @@
local resource_autoplace = require('resource-autoplace');
local noise = require('noise');
local futil = require("util");
local util = require("data-util");
if util.me.salt() then
local particle = futil.table.deepcopy(data.raw["optimized-particle"]["stone-particle"])
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
end
data:extend({particle})
data:extend({
{
type = "autoplace-control",
@ -13,10 +25,6 @@ data:extend({
order = "b-e"
},
{
type = "noise-layer",
name = "salt"
},
{
type = "resource",
icon_size = 128,
name = "salt",
@ -29,7 +37,7 @@ data:extend({
minable =
{
hardness = 1,
mining_particle = "copper-ore-particle",
mining_particle = "salt-particle",
mining_time = 0.5,
result = "salt"
},
@ -50,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
}
},
},
@ -72,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({
@ -99,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",
@ -124,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,
},
})

View file

@ -23,7 +23,7 @@ util.add_ingredient("uranium-processing", "salt", 1)
if mods.Krastorio2 or util.is_foundry() then
util.replace_some_ingredient("steel-plate", "iron-plate", 1, "salt", 1)
end
util.add_ingredient("kr-biomass-growing", "salt", 1)
util.add_ingredient("kr-biomass", "salt", 1)
util.add_ingredient("kr-energy-storage", "ferric-chloride", 10)
-- Space Exploration
@ -39,16 +39,16 @@ if not mods.Krastorio2 then
util.add_product("se-iridium-powder", {type="fluid", name="chlorine", amount=19, catalyst_amount=19})
end
util.replace_some_ingredient("se-vitamelange-bloom", "sand", 10, "salt", 1)
util.replace_some_ingredient("se-vitamelange-bloom", mods["Krastorio2"] and "kr-sand" or "sand", 10, "salt", 1)
util.add_ingredient("se-nutrient-gel", "salt", 1)
util.add_ingredient("se-vitalic-epoxy", "epoxy", 16)
util.multiply_recipe("se-space-water", 10)
util.replace_some_ingredient("se-space-water", "water", 10, "salt", 1)
util.add_ingredient("se-bio-sludge-decontamination", "chlorine", 1)
util.add_ingredient("se-bio-sludge-decontamination", mods.Krastorio2 and "kr-chloring" or "chlorine", 1)
util.add_ingredient("se-bio-electrics-data", "salt", 1)
util.add_ingredient("se-holmium-chloride", "hydrogen-chloride", 2)
util.add_ingredient("se-holmium-chloride", mods["Krastorio2"] and "kr-hydrogen-chloride" or "hydrogen-chloride", 2)
util.replace_some_ingredient("se-space-coolant", "copper-plate", 1, "salt", 1)
util.replace_some_ingredient("se-space-coolant-cryonite", "copper-plate", 1, "salt", 1)