diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..bbf3e21 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*] +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/README.md b/README.md index 14d4a11..9c8f2da 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/changelog.txt b/changelog.txt index 7bb7ad8..23d238a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -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: diff --git a/compatibility/bob.lua b/compatibility/bob.lua index 848bb81..a09b74d 100644 --- a/compatibility/bob.lua +++ b/compatibility/bob.lua @@ -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) diff --git a/control-util.lua b/control-util.lua index cd2b0f2..9000745 100644 --- a/control-util.lua +++ b/control-util.lua @@ -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) 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 diff --git a/data.lua b/data.lua index e142430..fadac78 100644 --- a/data.lua +++ b/data.lua @@ -3,6 +3,8 @@ require("prototypes/chlorine") require("prototypes/epoxy") require("prototypes/pcb") +require("matter") + local util = require("data-util"); if util.se6() then diff --git a/info.json b/info.json index 3e9def8..472594c 100644 --- a/info.json +++ b/info.json @@ -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" ], diff --git a/locale/zh-CN/salt.cfg b/locale/zh-CN/salt.cfg new file mode 100644 index 0000000..5a29215 --- /dev/null +++ b/locale/zh-CN/salt.cfg @@ -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的独立作品。 \ No newline at end of file diff --git a/matter.lua b/matter.lua new file mode 100644 index 0000000..84675cf --- /dev/null +++ b/matter.lua @@ -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 diff --git a/modules.lua b/modules.lua index ac4d9eb..818462f 100644 --- a/modules.lua +++ b/modules.lua @@ -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 diff --git a/prototypes/assembler-updates.lua b/prototypes/assembler-updates.lua index 1dd3f14..f553779 100644 --- a/prototypes/assembler-updates.lua +++ b/prototypes/assembler-updates.lua @@ -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 diff --git a/prototypes/chlorine.lua b/prototypes/chlorine.lua index 173402d..5359cfd 100644 --- a/prototypes/chlorine.lua +++ b/prototypes/chlorine.lua @@ -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 diff --git a/prototypes/epoxy.lua b/prototypes/epoxy.lua index 64ba8a6..40226c3 100644 --- a/prototypes/epoxy.lua +++ b/prototypes/epoxy.lua @@ -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, diff --git a/prototypes/pcb.lua b/prototypes/pcb.lua index e3a0977..5f3fe92 100644 --- a/prototypes/pcb.lua +++ b/prototypes/pcb.lua @@ -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 diff --git a/prototypes/salt.lua b/prototypes/salt.lua index 4b95957..102045c 100644 --- a/prototypes/salt.lua +++ b/prototypes/salt.lua @@ -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, }, }) diff --git a/recipe-updates.lua b/recipe-updates.lua index 289a041..245cf95 100644 --- a/recipe-updates.lua +++ b/recipe-updates.lua @@ -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)