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..85e49ae --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +*.zip \ No newline at end of file diff --git a/ChemistryForYou2/LICENSE.md b/ChemistryForYou2/LICENSE.md new file mode 100644 index 0000000..ee22ee9 --- /dev/null +++ b/ChemistryForYou2/LICENSE.md @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2023 Timeken + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/ChemistryForYou2/README.md b/ChemistryForYou2/README.md new file mode 100644 index 0000000..7db4260 --- /dev/null +++ b/ChemistryForYou2/README.md @@ -0,0 +1,16 @@ +# MetalsForYou + +## Version History +See changelog.txt + +## Created by + + +## Thanks to + +### Compatibility + + +### Localization + + diff --git a/ChemistryForYou2/changelog.txt b/ChemistryForYou2/changelog.txt new file mode 100644 index 0000000..ea72d02 --- /dev/null +++ b/ChemistryForYou2/changelog.txt @@ -0,0 +1,84 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.5.2 +Date: 2024-08-23 + Features: + - Fixed lithium-chemistry prerequisites. + - Fixed saltpeter-sulfuric-acid dependencies check. +--------------------------------------------------------------------------------------------------- +Version: 0.5.1 +Date: 2024-08-15 + Features: + - Added glass if there is no mod that adds it. + - Fixed missing organic-chemistry technology. + - Fixed missing item groups and sub groups. +--------------------------------------------------------------------------------------------------- +Version: 0.5.0 +Date: 2024-08-07 + Features: + - Added deep space ore enrichment recipe for SE and 248K. + - Added productivity to vitalic extract. +--------------------------------------------------------------------------------------------------- +Version: 0.4.0 +Date: 2024-07-27 + Features: + - Added vitalic slurry recipe for SE. + - Added vitalic extract recipe for SE. + - Added water softening recipe for K2. + - Added lithium peroxide to SE bioscrubber. + - Added 248K vulcanite enrichment. + - Added matter to particle recipe for SE. + - Fixed missing icon when BrimStuff is not installed. + - Fixed lithuim tech unlock when not using K2. +--------------------------------------------------------------------------------------------------- +Version: 0.3.4 +Date: 2024-07-16 + Features: + - Added cobalt nanotubes to SE holmium cable. +--------------------------------------------------------------------------------------------------- +Version: 0.3.3 +Date: 2024-06-27 + Features: + - Added cobalt nanotubes to SE tensile strength data. + - Fixed start up errors. + - Fixed many up missing mod errors. + - Fixed error when not using Tantalite mod. + - Fixed typo. +--------------------------------------------------------------------------------------------------- +Version: 0.3.2 +Date: 2024-01-21 + Features: + - Removed old unused files. +--------------------------------------------------------------------------------------------------- +Version: 0.3.1 +Date: 2024-01-14 + Features: + - Added SE delivery cannon recipe for fluids. + - Fixed carbon dioxide recipe when playing without bzgas. +--------------------------------------------------------------------------------------------------- +Version: 0.3.0 +Date: 2024-01-13 + Features: + - Added smart glass. + - Added tungsten trioxide. + - Added cobalt nanotubes. + - Added cobalt hydroxide. +--------------------------------------------------------------------------------------------------- +Version: 0.2.1 +Date: 2024-01-10 + Features: + - Fixed start up error when playing BrimStuff without chemical waste. + - Fixed start up error when fuel subgroup does not exist. +--------------------------------------------------------------------------------------------------- +Version: 0.2.0 +Date: 2024-01-09 + Features: + - Added lithium carbonate. + - Added lithium peroxide. (used for CO2 scrupping in SE) + - Added lithium hydroxide lubricant. + - Fixed startup error when playing K2+SE+BZ without 248K. + - Fixed lithium hydroxide not replacing lithium in 248K lithium battery. +--------------------------------------------------------------------------------------------------- +Version: 0.1.0 +Date: 2024-01-08 + Features: + - Alpha release. \ No newline at end of file diff --git a/ChemistryForYou2/data-final-fixes.lua b/ChemistryForYou2/data-final-fixes.lua new file mode 100644 index 0000000..b95c07f --- /dev/null +++ b/ChemistryForYou2/data-final-fixes.lua @@ -0,0 +1 @@ +local util = require("recipe-final-fix") \ No newline at end of file diff --git a/ChemistryForYou2/data-updates.lua b/ChemistryForYou2/data-updates.lua new file mode 100644 index 0000000..09f8c28 --- /dev/null +++ b/ChemistryForYou2/data-updates.lua @@ -0,0 +1 @@ +require("recipe-modify") \ No newline at end of file diff --git a/ChemistryForYou2/data-util.lua b/ChemistryForYou2/data-util.lua new file mode 100644 index 0000000..4b2d096 --- /dev/null +++ b/ChemistryForYou2/data-util.lua @@ -0,0 +1,930 @@ +local util = {} + +-- se landfill +-- params: ore, icon_size +function util.se_landfill(params) + if mods["space-exploration"] then + if not params.icon_size then params.icon_size = 64 end + local lname="landfill-"..params.ore + data:extend({ + { + type = "recipe", + icons = { + { icon = "__base__/graphics/icons/landfill.png", icon_size = 64, icon_mipmaps = 3 }, + { icon = "__Chromium2__/graphics/icons/"..params.ore..".png", icon_size = params.icon_size, scale = 0.33*64/params.icon_size}, + }, + energy_required = 1, + enabled=false, + name = lname, + category = "hard-recycling", + order = "z-b-"..params.ore, + subgroup = "terrain", + results = {{type="item", name="landfill", amount=1}}, + ingredients = {{type="item", name=params.ore, amount=50}}, + } + }) + util.add_unlock("se-recycling-facility", lname) + end +end + +-- se matter +-- params: ore, energy_required, quant_out, quant_in, icon_size, stream_out +function util.se_matter(params) + if not params.quant_in then params.quant_in = params.quant_out end + if not params.icon_size then params.icon_size = 64 end + local fname = "matter-fusion-"..params.ore + local sedata = mods["Krastorio2"] and "se-kr-matter-synthesis-data" or "se-fusion-test-data" + local sejunk = mods["Krastorio2"] and "se-broken-data" or "se-junk-data" + data:extend({ + { + type = "recipe", + name = fname, + localised_name = {"recipe-name.se-matter-fusion-to", {"item-name."..params.ore}}, + category = "space-materialisation", + subgroup = "materialisation", + order = "a-b-z", + icons = { + {icon = "__space-exploration-graphics__/graphics/blank.png", + icon_size = 64, scale = 0.5}, + {icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png", + icon_size = 64, scale = 0.33, shift = {8,-8}}, + {icon = "__Chromium2__/graphics/icons/"..params.ore..".png", + icon_size = params.icon_size, scale = 0.33 * 64/params.icon_size, shift={-8, 8}}, + {icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png", + icon_size = 64, scale = 0.5}, + }, + energy_required = params.energy_required, + enabled = false, + ingredients = { + {type = "item", name = sedata, amount=1}, + {type="fluid", name="se-particle-stream", amount=50}, + {type="fluid", name="se-space-coolant-supercooled", amount=25}, + }, + results = { + {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}, + } + } + }) + util.add_unlock("se-space-matter-fusion", fname) + + if mods["Krastorio2"] then + local lname = params.ore.."-to-particle-stream" + data:extend({ + enabled = false, + { + type = "recipe", + name = lname, + localised_name = {"recipe-name.se-kr-matter-liberation", {"item-name."..params.ore}}, + category = "space-materialisation", + subgroup = "advanced-particle-stream", + order = "a-b-z", + icons = { + {icon = "__space-exploration-graphics__/graphics/blank.png", + icon_size = 64, scale = 0.5}, + {icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png", + icon_size = 64, scale = 0.33, shift = {-8,8}}, + {icon = "__Chromium2__/graphics/icons/"..params.ore..".png", + icon_size = params.icon_size, scale = 0.33 * 64/params.icon_size, shift={8, -8}}, + {icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png", + icon_size = 64, scale = 0.5}, + }, + energy_required = 30, + enabled = false, + ingredients = { + {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, ignored_by_productivity = 50, ignored_by_stats = 50}, + } + } + }) + if not data.raw.technology["bz-advanced-stream-production"] then + data:extend({ + { + type = "technology", + name ="bz-advanced-stream-production", + localised_name = {"", {"technology-name.se-kr-advanced-stream-production"}, " 2"}, + icon = "__space-exploration-graphics__/graphics/technology/material-fabricator.png", + icon_size = 128, + effects = {}, + unit = { + count = 100, + time = 15, + ingredients = { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1}, + {"se-rocket-science-pack", 1}, + {"space-science-pack", 1}, + {"production-science-pack", 1}, + {"utility-science-pack", 1}, + {"se-astronomic-science-pack-4", 1}, + {"se-energy-science-pack-4", 1}, + {"se-material-science-pack-4", 1}, + {"matter-tech-card", 1}, + {"se-deep-space-science-pack-1", 1}, + } + }, + prerequisites = {"se-kr-advanced-stream-production"}, + }, + }) + end + util.add_unlock("bz-advanced-stream-production", lname) + 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.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] + if technology then + technology.prerequisites = {} + for i, prerequisite in pairs(prerequisites) do + if data.raw.technology[prerequisite] then + table.insert(technology.prerequisites, prerequisite) + end + end + end +end + +-- Add a prerequisite to a given technology +function util.add_prerequisite(technology_name, prerequisite) + local technology = data.raw.technology[technology_name] + if technology and data.raw.technology[prerequisite] then + if technology.prerequisites then + for i, pre in pairs(technology.prerequisites) do + if pre == prerequisite then return end + end + table.insert(technology.prerequisites, prerequisite) + else + technology.prerequisites = {prerequisite} + end + end +end + +-- Remove a prerequisite from a given technology +function util.remove_prerequisite(technology_name, prerequisite) + local technology = data.raw.technology[technology_name] + local index = -1 + if technology then + for i, prereq in pairs(technology.prerequisites) do + if prereq == prerequisite then + index = i + break + end + end + if index > -1 then + table.remove(technology.prerequisites, index) + end + end +end + + +-- Add an effect to a given technology +function util.add_effect(technology_name, effect) + local technology = data.raw.technology[technology_name] + if technology then + if not technology.effects then technology.effects = {} end + if effect and effect.type == "unlock-recipe" then + if not data.raw.recipe[effect.recipe] then + return + end + table.insert(technology.effects, effect) + end + end +end + +-- Add an effect to a given technology to unlock recipe +function util.add_unlock(technology_name, recipe) + util.add_effect(technology_name, {type="unlock-recipe", recipe=recipe}) +end + +-- remove recipe unlock effect from a given technology, multiple times if necessary +function util.remove_recipe_effect(technology_name, recipe_name) + local technology = data.raw.technology[technology_name] + local index = -1 + local cnt = 0 + if technology and technology.effects then + for i, effect in pairs(technology.effects) do + if effect.type == "unlock-recipe" and effect.recipe == recipe_name then + index = i + cnt = cnt + 1 + end + end + if index > -1 then + table.remove(technology.effects, index) + if cnt > 1 then -- not over yet, do it again + util.remove_recipe_effect(technology_name, recipe_name) + end + end + end +end + +-- Set technology ingredients +function util.set_tech_recipe(technology_name, ingredients) + local technology = data.raw.technology[technology_name] + if technology then + technology.unit.ingredients = ingredients + end +end + +function util.set_enabled(recipe_name, enabled) + if data.raw.recipe[recipe_name] then + data.raw.recipe[recipe_name].enabled = enabled + end +end + +function util.set_hidden(recipe_name) + if data.raw.recipe[recipe_name] then + data.raw.recipe[recipe_name].hidden = true + end +end + +-- Add a given quantity of ingredient to a given recipe +function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity) + if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then + add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) + end +end + +function add_or_add_to_ingredient(recipe, ingredient, quantity) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, existing in pairs(recipe.ingredients) do + if existing[1] == ingredient or existing.name == ingredient then + add_to_ingredient(recipe, ingredient, quantity) + return + end + end + table.insert(recipe.ingredients, {ingredient, quantity}) + end +end + +-- Add a given quantity of ingredient to a given recipe +function util.add_ingredient(recipe_name, ingredient, quantity) + local is_fluid = not not data.raw.fluid[ingredient] + if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then + add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity, is_fluid) + end +end + +function add_ingredient(recipe, ingredient, quantity, is_fluid) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, existing in pairs(recipe.ingredients) do + if existing.name == ingredient then + return + end + end + if is_fluid then + table.insert(recipe.ingredients, {type="fluid", name=ingredient, amount=quantity}) + else + table.insert(recipe.ingredients, {type = "item", name = ingredient, amount = quantity}) + end + end +end + +-- Add a given ingredient prototype to a given recipe +function util.add_ingredient_raw(recipe_name, ingredient) + if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then + add_ingredient_raw(data.raw.recipe[recipe_name], ingredient) + end +end + +function add_ingredient_raw(recipe, ingredient) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, existing in pairs(recipe.ingredients) do + if (existing.name and existing.name == ingredient.name) then + return + end + end + table.insert(recipe.ingredients, ingredient) + end +end + +-- Set an ingredient to a given quantity +function util.set_ingredient(recipe_name, ingredient, quantity) + if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then + set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) + end +end + +function set_ingredient(recipe, ingredient, quantity) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, existing in pairs(recipe.ingredients) do + if existing.name == ingredient then + existing.amount = quantity + existing.amount_min = nil + existing.amount_max = nil + return + end + end + table.insert(recipe.ingredients, {ingredient, quantity}) + end +end +-- Add a given quantity of product to a given recipe. +-- Only works for recipes with multiple products +function util.add_product(recipe_name, product) + 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) + end +end + +function add_product(recipe, product) + if recipe ~= nil then + if recipe.results == nil then + recipe.results = {} + end + table.insert(recipe.results, product) + end +end + +-- Get the amount of the ingredient, will check base/normal not expensive +function util.get_ingredient_amount(recipe_name, ingredient_name) + local recipe = data.raw.recipe[recipe_name] + if recipe then + if recipe.ingredients then + for i, ingredient in pairs(recipe.ingredients) do + if ingredient.name == ingredient_name then return ingredient.amount end + end + end + return 1 + end + return 0 +end + +-- Get the amount of the result, will check base/normal not expensive +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.results then + for i, result in pairs(recipe.results) do + if result.name == product then return result.amount end + end + end + return 1 + end + return 0 +end + +-- Replace one ingredient with another in a recipe +-- Use amount to set an amount. If that amount is a multiplier instead of an exact amount, set multiply true. +function util.replace_ingredient(recipe_name, old, new, amount, multiply) + if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then + replace_ingredient(data.raw.recipe[recipe_name], old, new, amount or 1, multiply) + end +end + +function replace_ingredient(recipe, old, new, amount, multiply) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, existing in pairs(recipe.ingredients) do + if existing.name == new then + return + end + end + for i, ingredient in pairs(recipe.ingredients) do + if ingredient.name == old then + ingredient.name = new + if multiply then + ingredient.amount = amount * ingredient.amount + else + ingredient.amount = amount + end + end + end + end +end + +-- Remove an ingredient from a recipe +function util.remove_ingredient(recipe_name, old) + if data.raw.recipe[recipe_name] then + remove_ingredient(data.raw.recipe[recipe_name], old) + end +end + +function remove_ingredient(recipe, old) + index = -1 + if recipe ~= nil and recipe.ingredients ~= nil then + for i, ingredient in pairs(recipe.ingredients) do + if ingredient.name == old then + index = i + break + end + end + if index > -1 then + table.remove(recipe.ingredients, index) + end + end +end + +-- Replace an amount of an ingredient in a recipe. Keep at least 1 of old. +function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amount) + local is_fluid = not not data.raw.fluid[new] + if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then + replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid) + end +end + +function replace_some_ingredient(recipe, old, old_amount, new, new_amount, is_fluid) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, existing in pairs(recipe.ingredients) do + if existing.name == new then + return + end + end + for i, ingredient in pairs(recipe.ingredients) do + if ingredient.name == old then + ingredient.amount = math.max(1, ingredient.amount - old_amount) + end + end + add_ingredient(recipe, new, new_amount, is_fluid) + end +end + +-- set the amount of a product. +function util.set_product_amount(recipe_name, product, amount) + if data.raw.recipe[recipe_name] then + set_product_amount(data.raw.recipe[recipe_name], product, amount) + end +end + +function set_product_amount(recipe, product, amount) + if recipe then + if recipe.result_count then + recipe.result_count = amount + end + if recipe.results then + for i, result in pairs(recipe.results) do + if result.name == product then + if result.amount then + result.amount = amount + end + if result.amount_min ~= nil then + result.amount_min = nil + result.amount_max = nil + result.amount = amount + end + end + if result[1] == product then + result[2] = amount + end + end + end + if not recipe.results and not recipe.result_count then + -- implicit one item result + recipe.result_count = amount + end + end +end + +-- multiply the cost, energy, and results of a recipe by a multiple +function util.multiply_recipe(recipe_name, multiple) + if data.raw.recipe[recipe_name] then + multiply_recipe(data.raw.recipe[recipe_name], multiple) + end +end + +function multiply_recipe(recipe, multiple) + if recipe then + if recipe.energy_required then + recipe.energy_required = recipe.energy_required * multiple + end + if recipe.result_count then + recipe.result_count = recipe.result_count * multiple + end + if recipe.results then + for i, result in pairs(recipe.results) do + if result.name then + if result.amount then + result.amount = result.amount * multiple + end + if result.amount_min ~= nil then + 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 + end + end + if result[1] then + result[2] = result[2] * multiple + end + end + end + if not recipe.results and not recipe.result_count then + -- implicit one item result + recipe.result_count = multiple + end + if recipe.ingredients then + for i, ingredient in pairs(recipe.ingredients) do + if ingredient.name then + ingredient.amount = ingredient.amount * multiple + end + if ingredient[1] then + ingredient[2] = ingredient[2] * multiple + end + end + end + end +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) +end + +function has_ingredient(recipe, ingredient) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, existing in pairs(recipe.ingredients) do + if existing[1] == ingredient or existing.name == ingredient then + return true + end + end + end + return false +end + +-- Remove a product from a recipe, WILL NOT remove the only product +function util.remove_product(recipe_name, old) + if data.raw.recipe[recipe_name] then + remove_product(data.raw.recipe[recipe_name], old) + end +end + +function remove_product(recipe, old) + index = -1 + if recipe ~= nil and recipe.results ~= nil then + for i, result in pairs(recipe.results) do + if result.name == old or result[1] == old then + index = i + break + end + end + if index > -1 then + table.remove(recipe.results, index) + end + end +end + +function util.set_main_product(recipe_name, product) + if data.raw.recipe[recipe_name] then + set_main_product(data.raw.recipe[recipe_name], product) + end +end + +function set_main_product(recipe, product) + if recipe then + recipe.main_product = product + end +end + +-- Replace one product with another in a recipe +function util.replace_product(recipe_name, old, new) + if data.raw.recipe[recipe_name] then + replace_product(data.raw.recipe[recipe_name], old, new) + end +end + +function replace_product(recipe, old, new) + if recipe then + if recipe.main_product == old then + recipe.main_product = new + end + if recipe.result == old then + recipe.result = new + return + end + if recipe.results then + for i, result in pairs(recipe.results) do + if result.name == old then result.name = new end + if result[1] == old then result[1] = new end + end + end + end +end + +-- Remove an element of type t and name from data.raw +function util.remove_raw(t, name) + if not data.raw[t] then + log(t.." not found in data.raw") + return + end + if data.raw[t][name] then + for i, elem in pairs(data.raw[t]) do + if elem.name == name then + data.raw[t][i] = nil + break + end + end + end +end + +-- Set energy required +function util.set_recipe_time(recipe_name, time) + if data.raw.recipe[recipe_name] then + set_recipe_time(data.raw.recipe[recipe_name], time) + end +end + +function set_recipe_time(recipe, time) + if recipe then + if recipe.energy_required then + recipe.energy_required = time + end + end +end + +-- Multiply energy required +function util.multiply_time(recipe_name, factor) + if data.raw.recipe[recipe_name] then + multiply_time(data.raw.recipe[recipe_name], factor) + end +end + +function multiply_time(recipe, factor) + if recipe then + if recipe.energy_required then + recipe.energy_required = recipe.energy_required * factor + end + end +end + +-- Add to energy required +function util.add_time(recipe_name, amount) + if data.raw.recipe[recipe_name] then + add_time(data.raw.recipe[recipe_name], amount) + end +end + +function add_time(recipe, amount) + if recipe then + if recipe.energy_required then + recipe.energy_required = recipe.energy_required + amount + end + end +end + +-- Set recipe category +function util.set_category(recipe_name, category) + if data.raw.recipe[recipe_name] and data.raw["recipe-category"][category] then + data.raw.recipe[recipe_name].category = category + end +end + +-- Set recipe subgroup +function util.set_subgroup(recipe_name, subgroup) + if data.raw.recipe[recipe_name] then + data.raw.recipe[recipe_name].subgroup = subgroup + end +end + +-- Set item subgroup +function util.set_item_subgroup(item, subgroup) + if data.raw.item[item] and data.raw["item-subgroup"][subgroup] then + data.raw.item[item].subgroup = subgroup + end +end + +function util.add_icon(recipe_name, icon) + if data.raw.recipe[recipe_name] then + if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) 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 + table.insert(data.raw.recipe[recipe_name].icons, icon) + end +end + +-- Set recipe icons +function util.set_icons(recipe_name, icons) + if data.raw.recipe[recipe_name] then + data.raw.recipe[recipe_name].icons = icons + data.raw.recipe[recipe_name].icon = nil + data.raw.recipe[recipe_name].icon_size = nil + end +end + +-- Set recipe icons +function util.set_item_icons(item_name, icons) + if data.raw.item[item_name] then + data.raw.item[item_name].icons = icons + data.raw.item[item_name].icon = nil + data.raw.item[item_name].icon_size = nil + end +end + +-- Gets an item or fluid icon +function util.get_item_or_fluid_icon(name) + icon = "" + if data.raw.item[name] then + icon = data.raw.item[name].icon + if not icon then icon = data.raw.item[name].icons[1].icon end + elseif data.raw.fluid[name] then + icon = data.raw.fluid[name].icon + if not icon then icon = data.raw.fluid[name].icons[1].icon end + end + return icon +end + +function util.set_to_founding(recipe) + util.set_category(recipe, "founding") + util.set_subgroup(recipe, "foundry-intermediate") +end + +-- Add crafting category to an entity +function util.add_crafting_category(entity_type, entity, category) + if data.raw[entity_type][entity] and data.raw["recipe-category"][category] then + for i, existing in pairs(data.raw[entity_type][entity].crafting_categories) do + if existing == category then + return + end + end + table.insert(data.raw[entity_type][entity].crafting_categories, category) + end +end + +function util.add_to_ingredient(recipe, ingredient, amount) + if data.raw.recipe[recipe] then + add_to_ingredient(data.raw.recipe[recipe], ingredient, amount) + end +end + +function add_to_ingredient(recipe, it, amount) + if recipe ~= nil and recipe.ingredients ~= nil then + for i, ingredient in pairs(recipe.ingredients) do + if ingredient.name == it then + ingredient.amount = ingredient.amount + amount + return + end + if ingredient[1] == it then + ingredient[2] = ingredient[2] + amount + return + end + end + end +end + +function util.add_to_product(recipe_name, product, amount) + if data.raw.recipe[recipe_name] then + add_to_product(data.raw.recipe[recipe_name], product, amount) + end +end + +function add_to_product(recipe, product, amount) + if recipe ~= nil and recipe.results ~= nil then + if recipe.result == product then + recipe.result_count = recipe.result_count + amount + return + end + for i, result in pairs(recipe.results) do + if result.name == product then + result.amount = result.amount + amount + return + end + if result[1] == product then + result[2] = result[2] + amount + return + end + end + end +end + +-- Adds a result to a mineable type +function util.add_minable_result(t, name, result) + if data.raw[t] and data.raw[t][name] and data.raw[t][name].minable then + if data.raw[t][name].minable.result and not data.raw[t][name].minable.results then + data.raw[t][name].minable.results = { + {data.raw[t][name].minable.result ,data.raw[t][name].minable.count}} + data.raw[t][name].minable.result = nil + data.raw[t][name].minable.result_count = nil + end + if data.raw[t][name].minable.results then + table.insert(data.raw[t][name].minable.results, result) + end + end +end + +function util.remove_prior_unlocks(tech, recipe) + if data.raw.technology[tech].prerequisites then + for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do + remove_prior_unlocks(prerequisite, recipe) + end + end +end + +function remove_prior_unlocks(tech, recipe) + local technology = data.raw.technology[tech] + if technology then + util.remove_recipe_effect(tech, recipe) + if technology.prerequisites then + for i, prerequisite in pairs(technology.prerequisites) do + -- log("BZZZ removing prior unlocks for " .. tech ..", checking " .. prerequisite) -- Handy Debug :| + remove_prior_unlocks(prerequisite, recipe) + end + end + end +end + +function util.replace_ingredients_prior_to(tech, old, new, multiplier) + if not data.raw.technology[tech] then + log("Not replacing ingredient "..old.." with "..new.." because tech "..tech.." was not found") + return + end + util.remove_prior_unlocks(tech, old) + for i, recipe in pairs(data.raw.recipe) do + if (recipe.enabled and recipe.enabled ~= 'false') + and (not recipe.hidden or recipe.hidden == 'true') -- probably don't want to change hidden recipes + and string.sub(recipe.name, 1, 3) ~= 'se-' -- have to exlude SE in general :( + then + -- log("BZZZ due to 'enabled' replacing " .. old .. " with " .. new .." in " .. recipe.name) -- Handy Debug :| + util.replace_ingredient(recipe.name, old, new, multiplier, true) + end + end + if data.raw.technology[tech].prerequisites then + for i, prerequisite in pairs(data.raw.technology[tech].prerequisites) do + replace_ingredients_prior_to(prerequisite, old, new, multiplier) + end + end +end + +function replace_ingredients_prior_to(tech, old, new, multiplier) + local technology = data.raw.technology[tech] + if technology then + if technology.effects then + for i, effect in pairs(technology.effects) do + if effect.type == "unlock-recipe" then + -- log("BZZZ replacing " .. old .. " with " .. new .." in " .. effect.recipe) -- Handy Debug :| + util.replace_ingredient(effect.recipe, old, new, multiplier, true) + end + end + end + if technology.prerequisites then + for i, prerequisite in pairs(technology.prerequisites) do + -- log("BZZZ checking " .. prerequisite) -- Handy Debug :| + replace_ingredients_prior_to(prerequisite, old, new, multiplier) + end + end + end +end + +function util.remove_all_recipe_effects(recipe_name) + for name, _ in pairs(data.raw.technology) do + util.remove_recipe_effect(name, recipe_name) + end +end + +function util.add_unlock_force(technology_name, recipe) + util.set_enabled(recipe, false) + util.remove_all_recipe_effects(recipe) + util.add_unlock(technology_name, recipe) +end + +-- sum the products of a recipe +function util.sum_products(recipe_name) + -- this is going to end up approximate in some cases, integer division is probs fine + if data.raw.recipe[recipe_name] then + local recipe = data.raw.recipe[recipe_name] + if not recipe.results then return recipe.result_count end + local sum = 0 + for i, result in pairs(recipe.results) do + local amt = 0 + if result[2] then amt = result[2] + elseif result.amount then amt = result.amount + elseif result.amount_min then amt = (result.amount_min + result.amount_max)/2 + end + if result.probability then amt = amt * result.probability end + sum = sum + amt + end + return sum + end + return 0 +end + +function util.add_productivity(recipe) + data.raw.recipe[recipe].allow_productivity = true +end + +return util \ No newline at end of file diff --git a/ChemistryForYou2/data.lua b/ChemistryForYou2/data.lua new file mode 100644 index 0000000..d30056f --- /dev/null +++ b/ChemistryForYou2/data.lua @@ -0,0 +1,2 @@ +require("prototypes.recipes") +require("prototypes.technology") \ No newline at end of file diff --git a/ChemistryForYou2/graphics/icons/acetic-acid.png b/ChemistryForYou2/graphics/icons/acetic-acid.png new file mode 100644 index 0000000..d102065 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/acetic-acid.png differ diff --git a/ChemistryForYou2/graphics/icons/adipic-acid.png b/ChemistryForYou2/graphics/icons/adipic-acid.png new file mode 100644 index 0000000..c14d9bd Binary files /dev/null and b/ChemistryForYou2/graphics/icons/adipic-acid.png differ diff --git a/ChemistryForYou2/graphics/icons/aluminium-hydroxide.png b/ChemistryForYou2/graphics/icons/aluminium-hydroxide.png new file mode 100644 index 0000000..7b20c29 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/aluminium-hydroxide.png differ diff --git a/ChemistryForYou2/graphics/icons/ammonium-nitrate.png b/ChemistryForYou2/graphics/icons/ammonium-nitrate.png new file mode 100644 index 0000000..7470389 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/ammonium-nitrate.png differ diff --git a/ChemistryForYou2/graphics/icons/calcium-sulfite.png b/ChemistryForYou2/graphics/icons/calcium-sulfite.png new file mode 100644 index 0000000..40b4c07 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/calcium-sulfite.png differ diff --git a/ChemistryForYou2/graphics/icons/carbon-dioxide.png b/ChemistryForYou2/graphics/icons/carbon-dioxide.png new file mode 100644 index 0000000..490bc40 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/carbon-dioxide.png differ diff --git a/ChemistryForYou2/graphics/icons/coal-tar.png b/ChemistryForYou2/graphics/icons/coal-tar.png new file mode 100644 index 0000000..bb3cc0a Binary files /dev/null and b/ChemistryForYou2/graphics/icons/coal-tar.png differ diff --git a/ChemistryForYou2/graphics/icons/cobalt-hydroxide.png b/ChemistryForYou2/graphics/icons/cobalt-hydroxide.png new file mode 100644 index 0000000..4740970 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/cobalt-hydroxide.png differ diff --git a/ChemistryForYou2/graphics/icons/cobalt-nanotubes.png b/ChemistryForYou2/graphics/icons/cobalt-nanotubes.png new file mode 100644 index 0000000..7fc628a Binary files /dev/null and b/ChemistryForYou2/graphics/icons/cobalt-nanotubes.png differ diff --git a/ChemistryForYou2/graphics/icons/coke-powder.png b/ChemistryForYou2/graphics/icons/coke-powder.png new file mode 100644 index 0000000..270fcfa Binary files /dev/null and b/ChemistryForYou2/graphics/icons/coke-powder.png differ diff --git a/ChemistryForYou2/graphics/icons/destructive-distillation.png b/ChemistryForYou2/graphics/icons/destructive-distillation.png new file mode 100644 index 0000000..98cab49 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/destructive-distillation.png differ diff --git a/ChemistryForYou2/graphics/icons/ethanolamine-air-scrubbing.png b/ChemistryForYou2/graphics/icons/ethanolamine-air-scrubbing.png new file mode 100644 index 0000000..45192d4 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/ethanolamine-air-scrubbing.png differ diff --git a/ChemistryForYou2/graphics/icons/ethanolamine.png b/ChemistryForYou2/graphics/icons/ethanolamine.png new file mode 100644 index 0000000..e1786f3 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/ethanolamine.png differ diff --git a/ChemistryForYou2/graphics/icons/ethylene-glycol.png b/ChemistryForYou2/graphics/icons/ethylene-glycol.png new file mode 100644 index 0000000..d87beaf Binary files /dev/null and b/ChemistryForYou2/graphics/icons/ethylene-glycol.png differ diff --git a/ChemistryForYou2/graphics/icons/ethylene-oxide.png b/ChemistryForYou2/graphics/icons/ethylene-oxide.png new file mode 100644 index 0000000..6db14ed Binary files /dev/null and b/ChemistryForYou2/graphics/icons/ethylene-oxide.png differ diff --git a/ChemistryForYou2/graphics/icons/glass.png b/ChemistryForYou2/graphics/icons/glass.png new file mode 100644 index 0000000..d51df3a Binary files /dev/null and b/ChemistryForYou2/graphics/icons/glass.png differ diff --git a/ChemistryForYou2/graphics/icons/hexamethylenediamine.png b/ChemistryForYou2/graphics/icons/hexamethylenediamine.png new file mode 100644 index 0000000..d7c03e3 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/hexamethylenediamine.png differ diff --git a/ChemistryForYou2/graphics/icons/hydrogen-peroxide.png b/ChemistryForYou2/graphics/icons/hydrogen-peroxide.png new file mode 100644 index 0000000..5871bcf Binary files /dev/null and b/ChemistryForYou2/graphics/icons/hydrogen-peroxide.png differ diff --git a/ChemistryForYou2/graphics/icons/ketone-alcohol-oil.png b/ChemistryForYou2/graphics/icons/ketone-alcohol-oil.png new file mode 100644 index 0000000..a99d32f Binary files /dev/null and b/ChemistryForYou2/graphics/icons/ketone-alcohol-oil.png differ diff --git a/ChemistryForYou2/graphics/icons/lithium-carbonate.png b/ChemistryForYou2/graphics/icons/lithium-carbonate.png new file mode 100644 index 0000000..cc2d91e Binary files /dev/null and b/ChemistryForYou2/graphics/icons/lithium-carbonate.png differ diff --git a/ChemistryForYou2/graphics/icons/lithium-hydroxide.png b/ChemistryForYou2/graphics/icons/lithium-hydroxide.png new file mode 100644 index 0000000..53f6a08 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/lithium-hydroxide.png differ diff --git a/ChemistryForYou2/graphics/icons/lithium-peroxide.png b/ChemistryForYou2/graphics/icons/lithium-peroxide.png new file mode 100644 index 0000000..46666e6 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/lithium-peroxide.png differ diff --git a/ChemistryForYou2/graphics/icons/nitrate.png b/ChemistryForYou2/graphics/icons/nitrate.png new file mode 100644 index 0000000..fd0239c Binary files /dev/null and b/ChemistryForYou2/graphics/icons/nitrate.png differ diff --git a/ChemistryForYou2/graphics/icons/nitrous-oxide.png b/ChemistryForYou2/graphics/icons/nitrous-oxide.png new file mode 100644 index 0000000..412f97d Binary files /dev/null and b/ChemistryForYou2/graphics/icons/nitrous-oxide.png differ diff --git a/ChemistryForYou2/graphics/icons/nylon-machine-parts.png b/ChemistryForYou2/graphics/icons/nylon-machine-parts.png new file mode 100644 index 0000000..6970b25 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/nylon-machine-parts.png differ diff --git a/ChemistryForYou2/graphics/icons/nylon.png b/ChemistryForYou2/graphics/icons/nylon.png new file mode 100644 index 0000000..4e735b4 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/nylon.png differ diff --git a/ChemistryForYou2/graphics/icons/povidone.png b/ChemistryForYou2/graphics/icons/povidone.png new file mode 100644 index 0000000..3930c05 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/povidone.png differ diff --git a/ChemistryForYou2/graphics/icons/productivity-science-pack.png b/ChemistryForYou2/graphics/icons/productivity-science-pack.png new file mode 100644 index 0000000..5d77ce9 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/productivity-science-pack.png differ diff --git a/ChemistryForYou2/graphics/icons/raw-graphite.png b/ChemistryForYou2/graphics/icons/raw-graphite.png new file mode 100644 index 0000000..47371ad Binary files /dev/null and b/ChemistryForYou2/graphics/icons/raw-graphite.png differ diff --git a/ChemistryForYou2/graphics/icons/smart-glass.png b/ChemistryForYou2/graphics/icons/smart-glass.png new file mode 100644 index 0000000..6300868 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/smart-glass.png differ diff --git a/ChemistryForYou2/graphics/icons/sodium-aluminate.png b/ChemistryForYou2/graphics/icons/sodium-aluminate.png new file mode 100644 index 0000000..c7e6b33 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/sodium-aluminate.png differ diff --git a/ChemistryForYou2/graphics/icons/sodium-carbonate.png b/ChemistryForYou2/graphics/icons/sodium-carbonate.png new file mode 100644 index 0000000..e980a23 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/sodium-carbonate.png differ diff --git a/ChemistryForYou2/graphics/icons/sodium-diuranate.png b/ChemistryForYou2/graphics/icons/sodium-diuranate.png new file mode 100644 index 0000000..2e0476b Binary files /dev/null and b/ChemistryForYou2/graphics/icons/sodium-diuranate.png differ diff --git a/ChemistryForYou2/graphics/icons/sodium-hydroxide.png b/ChemistryForYou2/graphics/icons/sodium-hydroxide.png new file mode 100644 index 0000000..b227144 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/sodium-hydroxide.png differ diff --git a/ChemistryForYou2/graphics/icons/sulfur-dioxide.png b/ChemistryForYou2/graphics/icons/sulfur-dioxide.png new file mode 100644 index 0000000..85d82e0 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/sulfur-dioxide.png differ diff --git a/ChemistryForYou2/graphics/icons/sulfur-trioxide.png b/ChemistryForYou2/graphics/icons/sulfur-trioxide.png new file mode 100644 index 0000000..8f12ab1 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/sulfur-trioxide.png differ diff --git a/ChemistryForYou2/graphics/icons/tungsten-trioxide.png b/ChemistryForYou2/graphics/icons/tungsten-trioxide.png new file mode 100644 index 0000000..cc5f199 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/tungsten-trioxide.png differ diff --git a/ChemistryForYou2/graphics/icons/vinyl-acetate.png b/ChemistryForYou2/graphics/icons/vinyl-acetate.png new file mode 100644 index 0000000..348c374 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/vinyl-acetate.png differ diff --git a/ChemistryForYou2/graphics/icons/vitalic-extract.png b/ChemistryForYou2/graphics/icons/vitalic-extract.png new file mode 100644 index 0000000..813ca8d Binary files /dev/null and b/ChemistryForYou2/graphics/icons/vitalic-extract.png differ diff --git a/ChemistryForYou2/graphics/icons/vitalic-residue.png b/ChemistryForYou2/graphics/icons/vitalic-residue.png new file mode 100644 index 0000000..6ac6945 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/vitalic-residue.png differ diff --git a/ChemistryForYou2/graphics/icons/vitalic-slurry.png b/ChemistryForYou2/graphics/icons/vitalic-slurry.png new file mode 100644 index 0000000..9162a71 Binary files /dev/null and b/ChemistryForYou2/graphics/icons/vitalic-slurry.png differ diff --git a/ChemistryForYou2/graphics/icons/zeolite.png b/ChemistryForYou2/graphics/icons/zeolite.png new file mode 100644 index 0000000..5f2e6fc Binary files /dev/null and b/ChemistryForYou2/graphics/icons/zeolite.png differ diff --git a/ChemistryForYou2/graphics/technology/ammonium-nitrate-explosives.png b/ChemistryForYou2/graphics/technology/ammonium-nitrate-explosives.png new file mode 100644 index 0000000..c08270c Binary files /dev/null and b/ChemistryForYou2/graphics/technology/ammonium-nitrate-explosives.png differ diff --git a/ChemistryForYou2/info.json b/ChemistryForYou2/info.json new file mode 100644 index 0000000..e67dd3e --- /dev/null +++ b/ChemistryForYou2/info.json @@ -0,0 +1,43 @@ +{ + "name": "ChemistryForYou2", + "version": "2.0.0", + "factorio_version": "2.0", + "title": "ChemistryForYou", + "author": "Timeken, cackling fiend", + "homepage": "https://discord.gg/ufvFUJtVwk", + "dependencies": [ + "base >= 2.0.0", + "? 248k-Redux", + "? Bio_Industries_2", + "? BrassTacks-Updated", + "? bobassembly", + "? BrimStuff-Updated", + "? bzaluminum", + "? bzchlorine", + "? bzfoundry", + "? bzgas", + "? bzgold", + "? bzlead", + "? bzsilicon", + "? bztin", + "? bztungsten", + "? Chromium2", + "? Cobalt2", + "? GasGasGases2", + "? EndgameCombat", + "? IfNickel-Updated", + "? IntermediatesForYou2", + "? LasingAround-Updated", + "? Limestone2", + "? LithiumFix", + "? Nylon2", + "? Krastorio2", + "? Krastorio2Assets", + "? RampantArsenal", + "? space-exploration", + "? ShockTurret", + "? Tantalite2", + "? ThemTharHills-Updated" + ], + "description": "This mod adds more chemistry and is intented to be played with my other mods aswell as K2, SE and BZ.\n\nThis mod is inspired by Brevven's BZ mods." +} \ No newline at end of file diff --git a/ChemistryForYou2/locale/en/ChemistryForYou.cfg b/ChemistryForYou2/locale/en/ChemistryForYou.cfg new file mode 100644 index 0000000..11889e5 --- /dev/null +++ b/ChemistryForYou2/locale/en/ChemistryForYou.cfg @@ -0,0 +1,122 @@ +[technology-name] +productivity-science-pack=Productivity science pack +anthraquinone-process=Anthraquinone process +rich-water-filtration=Rich water filtration +silver-pyrometallurgi=Silver pyrometallurgi +nuclear-waste-extraction=Nuclear waste extraction +hydrogen-peroxide-rocket-fuel=Hydrogen peroxide rocket fuel +nitrous-oxide-rocket-fuel=Nitrous oxide rocket fuel +saltpeter-sulfuric-acid=Saltpeter sulfuric acid +aluminium-chemistry=Aluminium chemistry +electrolysis=Electrolysis +water-filtration=Water filtration +microporous-material=Microporous material +sulfur-gas-processing=Sulfur gas processing +carbon-dioxide-growing=Carbon dioxide growing +air-scrubing-oil-processing=Air scrubing oil processing +calcium-sulfite-reaction=Calcium sulfite reaction +advanced-silicon-processing=Advanced silicon processing +soda-lime-glass=Soda-lime glass +trace-uranium-extraction=Trace uranium extraction +ammonium-nitrate-explosives=Ammonium nitrate explosives +lithium-chemistry=Lithium chemistry +tungsten-chemistry=Tungsten chemistry +cobalt-chemistry=Cobalt chemistry +vulcanite-enrichment=Vulcanite enrichment +matter-to-particle=Matter to particle +deep-space-ore-enrichment=Deep space ore enrichment + +[technology-description] + +[autoplace-control-names] + +[tool-name] +productivity-science-pack=Productivity science pack + +[item-name] +aluminium-hydroxide=Aluminium hydroxide +sodium-hydroxide=Sodium hydroxide +sodium-aluminate=Sodium aluminate +zeolite=Zeolite +calcium-sulfite=Calcium sulfite +sodium-carbonate=Sodium carbonate +sodium-diuranate=Sodium diuranate +lithium-hydroxide=Lithium hydroxide +ammonium-nitrate=Ammonium nitrate +lithium-peroxide=Lithium peroxide +lithium-carbonate=Lithium carbonate +tungsten-trioxide=Tungsten trioxide +cobalt-hydroxide=Cobalt hydroxide + +productivity-science-pack=Productivity science pack +smart-glass=Smart glass +cobalt-nanotubes=Cobalt nanotubes +glass=Glass + +vitalic-residue=Vitalic residue +vitalic-extract=Vitalic extract + +[item-description] +smart-glass=A type of glass that can change its reflective properties to prevent sunlight and heat from entering + +[fluid-name] +hydrogen-peroxide=Hydrogen peroxide +nitrous-oxide=Nitrous oxide +sulfur-dioxide=Sulfur dioxide +sulfur-trioxide=Sulfur trioxide +carbon-dioxide=Carbon dioxide +nitrate=Nitrate +vitalic-slurry=Vitalic slurry + +[entity-name] + +[mod-setting-name] + +[mod-setting-description] + +[recipe-name] +rich-water-filtration=Rich water filtration +nuclear-waste-extraction=Nuclear waste extraction +hydrogen-peroxide=Hydrogen peroxide +hydrogen-peroxide-disproportionation=Hydrogen peroxide disproportionation +hydrogen-peroxide-rocket-fuel=Hydrogen peroxide rocket fuel +productivity-science-pack=Productivity science pack +nitrous-oxide-rocket-fuel=Nitrous oxide rocket fuel +saltpeter-sulfuric-acid=Saltpeter sulfuric acid +aluminium-hydroxide-smelting=Aluminium hydroxide smelting +sodium-hydroxide-reaction=Sodium hydroxide reaction +silica-extraction=Silica extraction +sodium-aluminate=Sodium aluminate +sulfur-trioxide=Sulfur trioxide +zeolite=Zeolite +sulfur-trioxide-hydration=Sulfur trioxide hydration +air-scrubing-oil-processing=Air scrubing oil processing +calcium-sulfite-reaction=Calcium sulfite reaction +sulfur-smelting=Sulfur smelting +advanced-silicon-processing=Advanced silicon processing +soda-lime-glass=Soda-lime glass +sodium-carbonate=Sodium carbonate +sodium-diuranate=Sodium diuranate +tissue-digestion=Tissue digestion +lithium-hydroxide=Lithium hydroxide +ammonium-nitrate=Ammonium nitrate +nitrate=Nitrate +sodium-hydroxide-waste-treatment=Sodium hydroxide waste treatment +lithium-hydroxide-purification=Lithium hydroxide purification +lithium-hydroxide-lubricant=Lithium hydroxide lubricant +lithium-peroxide=Lithium peroxide +tungsten-trioxide=Tungsten trioxide +smart-glass=Smart glass +tungsten-trioxide-smelting=Tungsten trioxide smelting +cobalt-hydroxide=Cobalt hydroxide +cobalt-nanotubes=Cobalt nanotubes +water-softening=Water softening +vitalic-purification=Vitalic purification +se-vitalic-acid=Vitalic slurry +vitalic-residue-extract=Vitalic residue extract +vulcanite-enrichment=Vulcanite enrichment +matter-to-particle=Matter to particle +vitalic-extract=Vitalic extract +deep-space-ore-enrichment=Deep space ore enrichment + +[recipe-description] \ No newline at end of file diff --git a/ChemistryForYou2/locale/en/Nylon.cfg b/ChemistryForYou2/locale/en/Nylon.cfg new file mode 100644 index 0000000..b6dd48b --- /dev/null +++ b/ChemistryForYou2/locale/en/Nylon.cfg @@ -0,0 +1,65 @@ +[technology-name] +nylon-processing=Nylon processing +synthetic-graphite=Synthetic graphite +organic-chemistry=Organic chemistry +nylon-drive-belt=Nylon drive belt + +[technology-description] + +[autoplace-control-names] + +[item-name] +adipic-acid=Adipic acid +nylon=Nylon +cobalt-ore=Cobalt ore +cobalt-plate=Cobalt plate +nylon-machine-parts=Nylon machine parts +raw-graphite=Raw graphite +coke-powder=Coke powder +povidone=Povidone + +[item-description] +povidone=Polyvinylpyrrolidone + +[fluid-name] +ketone-alcohol-oil=Ketone alcohol oil +hexamethylenediamine=Hexamethylenediamine +coal-tar=Coal tar +ethylene-oxide=Ethylene oxide +acetic-acid=Acetic acid +vinyl-acetate=Vinyl acetate +ethanolamine=Ethanolamine +ethylene-glycol=Ethylene glycol + +[fluid-description] +ketone-alcohol-oil=Cyclohexanone +ethylene-glycol=Used to make antifreeze + +[entity-name] + +[mod-setting-name] + +[mod-setting-description] + +[recipe-name] +ketone-alcohol-oil=Ketone-alcohol oil +hexamethylenediamine=Hexamethylenediamine +destructive-distillation=Destructive distillation +adipic-acid=Adipic acid +nylon=Nylon +raw-graphite=Raw graphite +synthetic-graphite=Synthetic graphite +coke-powder=Coke powder +bio-nitric-acid=Bio nitric acid +ethylene-oxide=Ethylene oxide +acetic-acid=Acetic acid +vinyl-acetate=Vinyl acetate +ethanolamine=Ethanolamine +povidone=Povidone +povidone-lubricant=Povidone lubricant +ethanolamine-air-scrubbing=Ethanolamine air scrubbing +ethylene-glycol=Ethylene glycol +solid-fuel-coal-tar=Solid fuel coal tar +nylon-drive-belt=Nylon drive belt + +[recipe-description] \ No newline at end of file diff --git a/ChemistryForYou2/prototypes/recipes.lua b/ChemistryForYou2/prototypes/recipes.lua new file mode 100644 index 0000000..69749d5 --- /dev/null +++ b/ChemistryForYou2/prototypes/recipes.lua @@ -0,0 +1,1221 @@ +local util = require("data-util") + +if mods["space-exploration"] then + data:extend({{ + type = "item-subgroup", + name = "chemical", + group = "resources", + order = "a" + }}) +else + data:extend({{ + type = "item-subgroup", + name = "chemical", + group = "intermediate-products", + order = "a" + }}) +end + +if mods["ThemTharHills-Updated"] then +if (mods["bzfoundry"] and mods["BrassTacks-Updated"]) and (mods["bzlead"] and mods["bzgold"]) then +data:extend({ + { + type = "recipe", + name = "silver-pyrometallurgi", + category = "founding", + main_product = "silver-ore", + subgroup = "raw-material", + order = "s", + enabled = false, + energy_required = 24, + ingredients = {{type="item", name="zinc-ore", amount=10}, {type="item", name="lead-ore", amount=10}}, + results = {{type="item", name="silver-ore", amount=5},{type="item", name="gold-ore", amount=1, probability=0.6}}, + } +}) +end +end +local fluidFiltrationCraft = "chemistry" +if mods["Krastorio2"] then + fluidFiltrationCraft = "kr-fluid-filtration" +end + +local sodium_aluminate_ingredients = {{type="item", name="aluminium-hydroxide", amount=10}, {type="item", name="sodium-hydroxide", amount=10}, {type="fluid", name="water", amount=50}} +if mods["EndgameCombat"] then + sodium_aluminate_ingredients = {{type="item", name="aluminium-hydroxide", amount=10}, {type="fluid", name="lye", amount=50}} +end + +local fuel_subgroup = "chemical" + if data.raw["item-subgroup"]["fuel"] then + fuel_subgroup = "fuel" + end + +local alumHydroxideSmeltIcon = (mods["Krastorio2"] and +{ + { icon = "__base__/graphics/icons/iron-plate.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/aluminium-hydroxide.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, +} or { + { icon = "__base__/graphics/icons/iron-plate.png", icon_size = 64}, +}) + +if mods["bzaluminum"] then + alumHydroxideSmeltIcon = (mods["Krastorio2"] and +{ + { icon = "__bzaluminum__/graphics/icons/alumina.png", icon_size = 128}, + { icon = "__ChemistryForYou2__/graphics/icons/aluminium-hydroxide.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, +} or { + { icon = "__bzaluminum__/graphics/icons/alumina.png", icon_size = 128}, +}) +end +local sodaLimeGlassCategory = "crafting" + +if not data.raw.item["glass"] then + data:extend({ + { + type = "item", + name = "glass", + icon = "__ChemistryForYou2__/graphics/icons/glass.png", + icon_size = 64, + group = "resources", + subgroup = "raw-resource", + order = "g", + stack_size = 200, + } + }) + if mods["Krastorio2"] then + sodaLimeGlassCategory = "smelting" + end +end + +data:extend({ + { + type = "item", + name = "sodium-hydroxide", + icon = "__ChemistryForYou2__/graphics/icons/sodium-hydroxide.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "s", + stack_size = 200, + }, + { + type = "item", + name = "sodium-diuranate", + icon = "__ChemistryForYou2__/graphics/icons/sodium-diuranate.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "s", + stack_size = 200, + }, + { + type = "item", + name = "sodium-carbonate", + icon = "__ChemistryForYou2__/graphics/icons/sodium-carbonate.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "s", + stack_size = 200, + }, + { + type = "item", + name = "aluminium-hydroxide", + icon = "__ChemistryForYou2__/graphics/icons/aluminium-hydroxide.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "a", + stack_size = 200, + }, + { + type = "item", + name = "sodium-aluminate", + icon = "__ChemistryForYou2__/graphics/icons/sodium-aluminate.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "a", + stack_size = 200, + }, + { + type = "item", + name = "zeolite", + icon = "__ChemistryForYou2__/graphics/icons/zeolite.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "z", + stack_size = 100, + }, + { + type = "item", + name = "lithium-hydroxide", + icon = "__ChemistryForYou2__/graphics/icons/lithium-hydroxide.png", + icon_size = 128, + group = "resources", + subgroup = "chemical", + order = "l", + stack_size = 200, + }, + { + type = "item", + name = "lithium-peroxide", + icon = "__ChemistryForYou2__/graphics/icons/lithium-peroxide.png", + icon_size = 128, + group = "resources", + subgroup = "chemical", + order = "l", + stack_size = 200, + }, + { + type = "item", + name = "lithium-carbonate", + icon = "__ChemistryForYou2__/graphics/icons/lithium-carbonate.png", + icon_size = 128, + group = "resources", + subgroup = "chemical", + order = "l", + stack_size = 200, + }, + { + type = "fluid", + name = "carbon-dioxide", + default_temperature = 25, + max_temperature = 100, + auto_barrel = true, + base_color = { r = 0.50, g = 0.50, b = 0.50 }, + flow_color = { r = 0.50, g = 0.50, b = 0.50 }, + gas_temperature = 25, + icon = "__ChemistryForYou2__/graphics/icons/carbon-dioxide.png", + icon_size = 128, + icon_mipmaps = 4, + order = "c" + }, + { + type = "fluid", + name = "sulfur-dioxide", + default_temperature = 25, + max_temperature = 100, + auto_barrel = true, + base_color = { r = 0.50, g = 0.50, b = 0.50 }, + flow_color = { r = 0.50, g = 0.50, b = 0.50 }, + gas_temperature = 25, + icon = "__ChemistryForYou2__/graphics/icons/sulfur-dioxide.png", + icon_size = 128, + icon_mipmaps = 4, + order = "s" + }, + { + type = "fluid", + name = "hydrogen-peroxide", + default_temperature = 25, + max_temperature = 100, + auto_barrel = true, + base_color = { r = 0.50, g = 0.50, b = 0.50 }, + flow_color = { r = 0.50, g = 0.50, b = 0.50 }, + gas_temperature = 25, + icon = "__ChemistryForYou2__/graphics/icons/hydrogen-peroxide.png", + icon_size = 128, + icon_mipmaps = 4, + order = "h" + }, + { + type = "recipe", + name = "sodium-carbonate", + category = "chemistry", + icon = "__ChemistryForYou2__/graphics/icons/sodium-carbonate.png", + icon_size = 128, + main_product = "sodium-carbonate", + subgroup = "chemical", + order = "a", + enabled = false, + energy_required = 5, + ingredients = {{type="item", name="sodium-hydroxide", amount=10},{type="fluid", name="carbon-dioxide", amount=50}}, + results = {{type="item", name="sodium-carbonate", amount=10},{type="fluid", name="water", amount=50}}, + }, + { + type = "recipe", + name = "aluminium-hydroxide", + category = "chemistry", + icon = "__ChemistryForYou2__/graphics/icons/aluminium-hydroxide.png", + icon_size = 128, + main_product = "aluminium-hydroxide", + subgroup = "chemical", + order = "a", + enabled = false, + energy_required = 10, + ingredients = {(data.raw.item["aluminum-plate"] and {type="item", name="aluminum-plate", amount=2}) or {type="item", name="iron-plate", amount=2}, {type="item", name="sodium-hydroxide", amount=2}, {type="fluid", name="water", amount=20}}, + results = {{type="item", name="aluminium-hydroxide", amount=2}, (data.raw.fluid["hydrogen"] and {type="fluid", name="hydrogen", amount=30}) or {type="fluid", name="water", amount=10}}, + }, + { + type = "recipe", + name = "aluminium-hydroxide-smelting", + category = "smelting", + order = "alumina", + icons = alumHydroxideSmeltIcon, + enabled = false, + energy_required = 18, + ingredients = {{type="item", name="aluminium-hydroxide", amount=10}}, + results = {(data.raw.item["alumina"] and {type="item", name="alumina", amount=10}) or {type="item", name="iron-plate", amount=10}} + } +}) + +local sodium_diuranate_ingredients = {{type="item", name="sodium-hydroxide", amount = 10}, { type = "fluid", name = "water", amount = 100 }} +if data.raw.item["sand"] then + table.insert(sodium_diuranate_ingredients, {type="item", name="sand", amount=1}) +end +data:extend({ + { + type = "recipe", + name = "sodium-diuranate", + category = fluidFiltrationCraft, + order = "s", + icon = "__ChemistryForYou2__/graphics/icons/sodium-diuranate.png", + icon_size = 128, + main_product = "sodium-diuranate", + subgroup = "chemical", + enabled = false, + energy_required = 12, + ingredients = sodium_diuranate_ingredients, + results = {{type = "item", name="sodium-diuranate", amount=1, probability=0.05}, (data.raw.fluid["chemical-waste"] and { type = "fluid", name = "chemical-waste", amount = 90 }) or { type = "fluid", name = "water", amount = 90 }} + }, + { + type = "recipe", + name = "sodium-diuranate-smelting", + localised_name = { "item-name.uranium-ore" }, + category = "smelting", + order = "u", + icons = (mods["Krastorio2"] and + { + { icon = "__base__/graphics/icons/uranium-ore.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/sodium-diuranate.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + } or { + { icon = "__base__/graphics/icons/uranium-ore.png", icon_size = 64}, + }), + enabled = false, + energy_required = 18, + ingredients = {{type="item", name="sodium-diuranate", amount=10}}, + results = {{type="item", name="uranium-ore", amount=1}} + }, + { + type = "recipe", + name = "carbon-dioxide", + category = "chemistry", + subgroup = "raw-material", + order = "c", + enabled = false, + energy_required = 4, + ingredients = {(data.raw.fluid["gas"] and { type = "fluid", name = "gas", amount = 20 }) or { type = "fluid", name = "crude-oil", amount = 10 }}, + results = {{ type = "fluid", name = "carbon-dioxide", amount = 100 }}, + }, + { + type = "recipe", + name = "zeolite", + category = "chemistry", + icon = "__ChemistryForYou2__/graphics/icons/zeolite.png", + icon_size = 128, + main_product = "zeolite", + subgroup = "chemical", + order = "a", + enabled = false, + energy_required = 8, + ingredients = {{type="item", name="sodium-aluminate", amount=5},(data.raw.fluid["gas"] and {type="item", name="silica", amount=5}) or {type="item", name="stone", amount=5}, {type="fluid", name="water", amount=100}}, + results = {{type="item", name="zeolite", amount=10}}, + }, + { + type = "recipe", + name = "sodium-aluminate", + category = "chemistry", + icon = "__ChemistryForYou2__/graphics/icons/sodium-aluminate.png", + icon_size = 128, + main_product = "sodium-aluminate", + subgroup = "chemical", + order = "a", + enabled = false, + energy_required = 8, + ingredients = sodium_aluminate_ingredients, + results = {{type="item", name="sodium-aluminate", amount=10}}, + }, + { + type = "recipe", + name = "lithium-hydroxide-lubricant", + category = "chemistry", + subgroup = "chemical", + order = "p", + enabled = false, + energy_required = 12, + ingredients = {{type="item", name="lithium-hydroxide", amount = 4 }, { type = "fluid", name = "light-oil", amount = 25 }}, + results = {{ type = "fluid", name = "lubricant", amount = 50 }}, + }, + { + type = "recipe", + name = "lithium-hydroxide-purification", + icons = { + { icon = "__ChemistryForYou2__/graphics/icons/lithium-hydroxide.png", icon_size = 128}, + { icon = "__ChemistryForYou2__/graphics/icons/lithium-carbonate.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + }, + category = "chemistry", + subgroup = "chemical", + main_porduct = "lithium-hydroxide", + order = "l", + enabled = false, + energy_required = 8, + ingredients = {{type="item", name="lithium-carbonate", amount = 10 }, { type = "fluid", name = "water", amount = 200 }}, + results = {{type="item", name="lithium-hydroxide", amount = 10 }, { type = "fluid", name = "carbon-dioxide", amount = 50 }, { type = "fluid", name = "water", amount = 50 }}, + }, + { + type = "recipe", + name = "lithium-peroxide", + icon = "__ChemistryForYou2__/graphics/icons/lithium-peroxide.png", + icon_size = 128, + category = "chemistry", + subgroup = "chemical", + main_porduct = "lithium-peroxide", + order = "l", + enabled = false, + energy_required = 5, + ingredients = {{type="item", name="lithium-hydroxide", amount = 10 }, { type = "fluid", name = "hydrogen-peroxide", amount = 100 }}, + results = {{type="item", name="lithium-peroxide", amount = 10 }, { type = "fluid", name = "hydrogen-peroxide", amount = 50 }, { type = "fluid", name = "water", amount = 50 }}, + }, + { + type = "recipe", + name = "lithium-hydroxide", + category = "chemistry", + subgroup = "chemical", + order = "l", + enabled = false, + energy_required = 2, + ingredients = {(data.raw.item["lithium"] and {type="item", name="lithium",amount = 10 }) or {type="item", name="stone", amount = 10 }, {type="item", name="sodium-hydroxide", amount = 10 }}, + results = {{type="item", name="lithium-hydroxide", amount = 10 }}, + } +}) + +local hydrogen_peroxide_ingredients = {(data.raw.fluid["hydrogen"] and { type = "fluid", name = "hydrogen", amount = 50 }) or { type = "fluid", name = "water", amount = 100 }} +if data.raw.fluid["oxygen"] then + table.insert(hydrogen_peroxide_ingredients, { type = "fluid", name = "oxygen", amount = 50 }) +end +if data.raw.item["palladium-ingot"] then + table.insert(hydrogen_peroxide_ingredients, {type="item", name="palladium-ingot", amount=1}) +end +data:extend({ + { + type = "recipe", + name = "hydrogen-peroxide", + icon = "__ChemistryForYou2__/graphics/icons/hydrogen-peroxide.png", + icon_size = 128, + category = "chemistry", + subgroup = "chemical", + order = "h", + enabled = false, + energy_required = 10, + ingredients = hydrogen_peroxide_ingredients, + results = {{ type = "fluid", name = "hydrogen-peroxide", amount = 50 }}, + } +}) + +local hydrogen_peroxide_disproportionation_ingredients = {{ type = "fluid", name = "hydrogen-peroxide", amount = 100 }} +local hydrogen_peroxide_disproportionation_results = {{ type = "fluid", name = "water", amount = 50 }} +if data.raw.item["platinum-ingot"] then + table.insert(hydrogen_peroxide_disproportionation_ingredients, {type="item", name="platinum-ingot", amount=1}) +end +if data.raw.fluid["oxygen"] then + table.insert(hydrogen_peroxide_disproportionation_results, { type = "fluid", name = "oxygen", amount = 25 }) +end + +data:extend({ + { + type = "recipe", + name = "hydrogen-peroxide-disproportionation", + icon = "__base__/graphics/icons/fluid/water.png", + icon_size = 64, + category = "chemistry", + subgroup = "chemical", + main_porduct = "water", + order = "h", + enabled = false, + energy_required = 8, + ingredients = hydrogen_peroxide_disproportionation_ingredients, + results = hydrogen_peroxide_disproportionation_results, + }, + { + type = "recipe", + name = "hydrogen-peroxide-rocket-fuel", + icons = { + { icon = "__base__/graphics/icons/rocket-fuel.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/hydrogen-peroxide.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + }, + category = "chemistry", + subgroup = fuel_subgroup, + order = "h", + enabled = false, + energy_required = 10, + ingredients = {{ type = "fluid", name = "hydrogen-peroxide", amount = 100 }, (data.raw.fluid["el_kerosene"] and { type = "fluid", name = "el_kerosene", amount = 200 }) or { type = "fluid", name = "light-oil", amount = 200 }}, + results = {{type="item", name="rocket-fuel", amount=1}}, + } +}) + +local nitrous_oxide_rocket_fuel_ingredients = {{ type = "fluid", name = "nitrous-oxide", amount = 1000 }} +if mods["space-exploration"] then + table.insert(nitrous_oxide_rocket_fuel_ingredients, { type = "fluid", name = "se-pyroflux", amount = 10 }) +end +data:extend({ + { + type = "recipe", + name = "nitrous-oxide-rocket-fuel", + icons = (mods["Krastorio2"] and + { + { icon = "__base__/graphics/icons/rocket-fuel.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/nitrous-oxide.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + } or { + { icon = "__base__/graphics/icons/rocket-fuel.png", icon_size = 64}, + }), + category = "chemistry", + subgroup = fuel_subgroup, + order = "h", + enabled = false, + energy_required = 6, + ingredients = nitrous_oxide_rocket_fuel_ingredients, + results = {{type="item", name="rocket-fuel", amount=1}}, + }, + { + type = "fluid", + name = "nitrous-oxide", + default_temperature = 25, + max_temperature = 100, + auto_barrel = true, + base_color = { r = 0.50, g = 0.50, b = 0.50 }, + flow_color = { r = 0.50, g = 0.50, b = 0.50 }, + gas_temperature = 25, + icon = "__ChemistryForYou2__/graphics/icons/nitrous-oxide.png", + icon_size = 128, + icon_mipmaps = 4, + order = "h" + }, + { + type = "recipe", + name = "saltpeter-sulfuric-acid", + icons = (mods["BrimStuff-Updated"] and + { + { icon = "__base__/graphics/icons/fluid/sulfuric-acid.png", icon_size = 64}, + { icon = "__BrimStuff-Updated__/graphics/icons/potassium-nitrate.png", icon_size = 64, scale=0.2, shift= {-8, -8}}, + } or { + { icon = "__base__/graphics/icons/fluid/sulfuric-acid.png", icon_size = 64}, + }), + category = "chemistry", + subgroup = "chemical", + order = "a[fluid]-g[sulfuric-acid]", + enabled = false, + energy_required = 4, + ingredients = {(data.raw.item["potassium-nitrate"] and {type="item", name="potassium-nitrate", amount=12}) or {type = "item", name = "stone", amount=12}, {type = "item", name = "sulfur", amount=9}, { type = "fluid", name = "steam", amount = 90 }}, + results = {{ type = "fluid", name = "sulfuric-acid", amount = 120 }, { type = "fluid", name = "nitrous-oxide", amount = 90 }}, + }, + { + type = "recipe", + name = "soda-lime-glass", + category = sodaLimeGlassCategory, + order = "a2[glass]", + icons = (mods["Krastorio2"] and + { + { icon = "__Krastorio2Assets__/icons/items/glass.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/sodium-carbonate.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + } or { + { icon = "__ChemistryForYou2__/graphics/icons/glass.png", icon_size = 64}, + }), + main_product = "glass", + enabled = false, + energy_required = 16, + ingredients = {{type="item", name="sodium-carbonate", amount=10}, (data.raw.item["quicklime"] and {type = "item", name = "quicklime", amount=10}) or {type = "item", name = "stone", amount=5}, (data.raw.item["alumina"] and {type = "item", name = "alumina", amount=1}) or {type = "item", name = "iron-plate", amount=1}}, + results = {{type="item", name = "glass", amount=10}} + } +}) + +local science_pack = "__ChemistryForYou2__/graphics/icons/productivity-science-pack.png" + if mods["Krastorio2"] and mods["space-exploration"] then + science_pack = "__Krastorio2Assets__/icons/cards/production-tech-card.png" + end + if mods["248k-Redux"] then + local rich_water_filtration_results = {data.raw.item["lithium"] and {type = "item", name="lithium", amount=5} or {type = "item", name="el_lithium_item", amount=5}, {type="fluid", name="water", amount=100}} + if data.raw.item["cobaltite-ore"] then + table.insert(rich_water_filtration_results, {name="cobaltite-ore", amount=1, probability=0.2}) + end + if data.raw.item["gold-ore"] then + table.insert(rich_water_filtration_results, {name="gold-ore", amount=1, probability=0.1}) + end + if data.raw.item["platinum-powder"] then + table.insert(rich_water_filtration_results, {name="platinum-powder", amount=1, probability=0.1}) + end + if data.raw.item["palladium-powder"] then + table.insert(rich_water_filtration_results, {name="palladium-powder", amount=1, probability=0.1}) + end + data:extend({ + { + type = "recipe", + name = "rich-water-filtration", + category = fluidFiltrationCraft, + icon = "__248k-Redux__/ressources/fluids/fi_dirty_water.png", + icon_size = 64, + group = "fi_item_group", + subgroup = "fi_item_subgroup_f", + order = "a-b", + enabled = false, + energy_required = 10, + ingredients = {{type="fluid", name="fi_dirty_water", amount=100}}, + results = rich_water_filtration_results, + }, + { + type = "recipe", + name = "nuclear-waste-extraction", + category = "chemistry", + icons = { + { icon = "__248k-Redux__/ressources/fission/fi_fuel/fi_fuel_plutonium239_item.png", icon_size = 64}, + { icon = "__248k-Redux__/ressources/fission/fi_materials/fi_materials_waste.png", icon_size = 64, scale=0.25, shift= {-8, -8}}, + }, + group = "fi_item_group", + subgroup = "fi_item_subgroup_f", + order = "a-b", + enabled = false, + energy_required = 60, + ingredients = {data.raw.fluid["kr-nitric-acid"] and {type="fluid", name="kr-nitric-acid", amount=100} or {type="fluid", name="sulfuric-acid", amount=100}, {type="item", name="fi_materials_waste", amount=1}}, + results = {{type="item", name="fi_plutonium239_item", amount=1, probability=0.05}, {type="item", name="uranium-238", amount=1, probability=0.1}, {type="item", name="fi_thorium232_item", amount=1, probability=0.2}}, + } + }) + end +if mods["Krastorio2"] then + local ammonium_nitrate_explosive_ingredients = {{type="item", name="ammonium-nitrate", amount = 10 }} + if data.raw.item["tnt"] then + table.insert(ammonium_nitrate_explosive_ingredients, {type="item", name="tnt", amount = 4 }) + end + if data.raw.item["nylon"] then + table.insert(ammonium_nitrate_explosive_ingredients, {type="item", name="nylon", amount = 8 }) + end + local sulfur_trioxide_ingredients = {{ type = "fluid", name = "sulfur-dioxide", amount = 100 }, { type = "fluid", name = "oxygen", amount = 50 }} + if data.raw.item["platinum-ingot"] then + table.insert(sulfur_trioxide_ingredients, {type="item", name="platinum-ingot", amount=1}) + end + local sulfur_trioxide_results = {{ type = "fluid", name = "sulfur-trioxide", amount = 100 }} + if data.raw.item["platinum-ingot"] then + table.insert(sulfur_trioxide_results, {name="platinum-ingot", amount=1, probability=0.6}) + end +data:extend({ + { + type = "fluid", + name = "sulfur-trioxide", + default_temperature = 25, + max_temperature = 100, + auto_barrel = true, + base_color = { r = 0.50, g = 0.50, b = 0.50 }, + flow_color = { r = 0.50, g = 0.50, b = 0.50 }, + gas_temperature = 25, + icon = "__ChemistryForYou2__/graphics/icons/sulfur-trioxide.png", + icon_size = 128, + icon_mipmaps = 4, + order = "s" + }, + { + type = "fluid", + name = "nitrate", + default_temperature = 25, + max_temperature = 100, + auto_barrel = true, + base_color = { r = 0.50, g = 0.50, b = 0.50 }, + flow_color = { r = 0.50, g = 0.50, b = 0.50 }, + gas_temperature = 25, + icon = "__ChemistryForYou2__/graphics/icons/nitrate.png", + icon_size = 128, + icon_mipmaps = 4, + order = "c" + }, + { + type = "item", + name = "ammonium-nitrate", + icon = "__ChemistryForYou2__/graphics/icons/ammonium-nitrate.png", + icon_size = 128, + group = "resources", + subgroup = "chemical", + order = "s", + stack_size = 200, + }, + { + type = "recipe", + name = "ammonium-nitrate", + category = "chemistry", + subgroup = "chemical", + order = "a", + enabled = false, + energy_required = 8, + ingredients = {{ type = "fluid", name = "nitrate", amount = 100 }, { type = "fluid", name = "ammonia", amount = 100 }}, + results = {{type="item", name="ammonium-nitrate",amount = 10 }}, + }, + { + type = "recipe", + name = "ammonium-nitrate-explosives", + category = "chemistry", + subgroup = "chemical", + order = "j[explosives]", + enabled = false, + energy_required = 8, + ingredients = ammonium_nitrate_explosive_ingredients, + results = {{type="item", name="explosives", amount = 8 }}, + }, + { + type = "recipe", + name = "nitrate", + category = "chemistry", + subgroup = "chemical", + order = "n", + enabled = false, + energy_required = 10, + ingredients = {{ type = "fluid", name = "nitrogen", amount = 50 }, { type = "fluid", name = "oxygen", amount = 150 }},--should be made from Nitric acid but this works for now + results = {{ type = "fluid", name = "nitrate", amount = 100 }}, + }, + { + type = "recipe", + name = "carbon-dioxide-condensation", + category = "atmosphere-condensation", + subgroup = "raw-material", + order = "c", + enabled = false, + energy_required = 18, + ingredients = {}, + results = {{ type = "fluid", name = "carbon-dioxide", amount = 200 }}, + }, + { + type = "recipe", + name = "sulfur-trioxide", + icon = "__ChemistryForYou2__/graphics/icons/sulfur-trioxide.png", + icon_size = 128, + category = "chemistry", + subgroup = "chemical", + main_porduct = "sulfur-trioxide", + order = "a[fluid]-i[sulfur]", + enabled = false, + energy_required = 14, + ingredients = sulfur_trioxide_ingredients, + results = sulfur_trioxide_results, + }, + { + type = "recipe", + name = "sulfur-trioxide-hydration", + icons = { + { icon = "__base__/graphics/icons/fluid/sulfuric-acid.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/sulfur-trioxide.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + }, + category = "chemistry", + subgroup = "chemical", + order = "a[fluid]-h[sulfuric-acid]", + enabled = false, + energy_required = 6, + ingredients = {{ type = "fluid", name = "sulfur-trioxide", amount = 100 }, { type = "fluid", name = "water", amount = 100 }}, + results = {{ type = "fluid", name = "sulfuric-acid", amount = 100 }}, + }, + { + type = "recipe", + name = "sulfur-smelting", + icons = { + { icon = "__ChemistryForYou2__/graphics/icons/sulfur-trioxide.png", icon_size = 128}, + { icon = "__base__/graphics/icons/sulfur.png", icon_size = 64, scale=0.3, shift= {-8, -8}}, + }, + category = "smelting", + subgroup = "chemical", + order = "a[fluid]-i[sulfur]", + enabled = false, + energy_required = 10, + ingredients = {{type = "item", name = "sulfur",amount = 10 }, { type = "fluid", name = "oxygen", amount = 150 }}, + results = {{ type = "fluid", name = "sulfur-trioxide", amount = 100 }}, + }, + { + type = "recipe", + name = "grow-wood-with-carbon-dioxide", + category = "bioprocessing", + subgroup = "chemical", + main_porduct = "wood", + order = "a-b", + enabled = false, + energy_required = 60, + ingredients = {{ type = "fluid", name = "water", amount = 800 }, { type = "fluid", name = "carbon-dioxide", amount = 400 }}, + results = {{type="item", name="wood", amount=40}}, + }, + { + type = "recipe", + name = "water-softening", + category = "chemistry", + subgroup = "chemical", + order = "w", + enabled = false, + energy_required = 3, + ingredients = {{type = "item", name = "sodium-carbonate", amount = 10 }, { type = "fluid", name = "mineral-water", amount = 100 }}, + results = {{ type = "fluid", name = "water", amount = 100 }}, + } +}) + +if mods["Limestone2"] then + local oil_subgroup = "chemical" + if data.raw["item-subgroup"]["oil"] then + oil_subgroup = "oil" + end + data:extend({ + { + type = "item", + name = "calcium-sulfite", + icon = "__ChemistryForYou2__/graphics/icons/calcium-sulfite.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "s", + stack_size = 100, + }, + { + type = "recipe", + name = "air-scrubing-oil-processing", + category = "oil-processing", + icons = { + { icon = "__base__/graphics/icons/fluid/light-oil.png", icon_size = 64}, + { icon = "__Limestone2__/graphics/icons/limestone-powder.png", icon_size = 64, scale=0.3, shift= {-8, -8}}, + }, + subgroup = oil_subgroup, + order = "b-c", + enabled = false, + energy_required = 4, + ingredients = {(data.raw.fluid["filterd-oil"] and { type = "fluid", name = "filterd-oil", amount = 100 }) or { type = "fluid", name = "crude-oil", amount = 100 }, { type = "fluid", name = "water", amount = 50 }, {type="item", name="limestone-powder", amount=10}}, + results = {{ type = "fluid", name = "heavy-oil", amount = 30 }, { type = "fluid", name = "light-oil", amount = 70 }, { type = "fluid", name = "carbon-dioxide", amount = 100 }, { type = "item", name = "calcium-sulfite", amount=10 }}, + }, + { + type = "recipe", + name = "calcium-sulfite-reaction", + category = "chemistry", + icons = { + { icon = "__ChemistryForYou2__/graphics/icons/sulfur-dioxide.png", icon_size = 128}, + { icon = "__ChemistryForYou2__/graphics/icons/calcium-sulfite.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + }, + subgroup = "chemical", + order = "a[fluid]-i[sulfur]", + enabled = false, + energy_required = 4, + ingredients = {{type="item", name="calcium-sulfite", amount=10}, { type = "fluid", name = "kr-hydrogen-chloride", amount = 100 }}, + results = {{ type = "fluid", name = "sulfur-dioxide", amount = 50 }, { type = "fluid", name = "water", amount = 50 }},--Hard water + } + }) +end + +if mods["Cobalt2"] then + data:extend({ + { + type = "item", + name = "cobalt-hydroxide", + icon = "__ChemistryForYou2__/graphics/icons/cobalt-hydroxide.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "c", + stack_size = 200, + }, + { + type = "item", + name = "cobalt-nanotubes", + icon = "__ChemistryForYou2__/graphics/icons/cobalt-nanotubes.png", + icon_size = 128, + group = "resources", + subgroup = "raw-resource", + order = "c", + stack_size = 200, + }, + { + type = "recipe", + name = "cobalt-hydroxide", + category = "chemistry", + subgroup = "chemical", + order = "c", + enabled = false, + energy_required = 8, + ingredients = {{type = "item", name = "cobalt-plate", amount = 10 }, {type = "item", name = "sodium-hydroxide", amount = 10 }}, + results = {{type = "item", name = "cobalt-hydroxide", amount = 5 }}, + }, + { + type = "recipe", + name = "cobalt-nanotubes", + category = "chemistry", + subgroup = "chemical", + order = "c", + enabled = false, + energy_required = 10, + ingredients = {{type = "item", name = "cobalt-hydroxide", amount = 5 }, { type = "fluid", name = "nitrate", amount = 50 }}, + results = {{type = "item", name = "cobalt-nanotubes", amount = 5 }}, + } + }) +end + +if mods["bzsilicon"] then + data:extend({ + { + type = "recipe", + name = "silica-extraction", + category = fluidFiltrationCraft, + order = "s", + icons = (mods["Krastorio2"] and + { + { icon = "__Krastorio2Assets__/icons/items-with-variations/silicon/silicon.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/sodium-aluminate.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + } or { + { icon = "__Krastorio2Assets__/icons/items-with-variations/silicon/silicon.png", icon_size = 64}, + }), + main_product = "silica", + subgroup = "chemical", + enabled = false, + energy_required = 10, + ingredients = {{type="item", name="sodium-aluminate", amount=10}, { type = "fluid", name = "water", amount = 100 }}, + results = {{type="item", name="silica", 10}, {"sodium-aluminate", amount=9}, { type = "fluid", name = "water", amount = 90 }} + }, + { + type = "recipe", + name = "advanced-silicon-processing", + category = "smelting", + order = "g", + icons = (mods["Krastorio2"] and + { + { icon = "__bzsilicon__/graphics/icons/silicon.png", icon_size = 64}, + { icon = "__bzaluminum__/graphics/icons/aluminum-plate.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + } or { + { icon = "__bzsilicon__/graphics/icons/silicon.png", icon_size = 64}, + }), + main_product = "silicon", + subgroup = "intermediate-product", + enabled = false, + energy_required = 10, + ingredients = {{type="item", name="silica", 9}, {type = "item", name = "aluminum-plate", amount=12}}, + results = {{type="item", name="silicon", 9}, {type = "item", name = "alumina", amount=6}} + }, + }) + if mods["bzgas"] then + data:extend({ + { + type = "recipe", + name = "zeolite-formaldehyde", + category = "chemistry", + order = "a[fluid]-g[formaldaehyde]", + icons = (mods["Krastorio2"] and + { + { icon = "__bzgas__/graphics/icons/formaldehyde.png", icon_size = 128}, + { icon = "__ChemistryForYou2__/graphics/icons/zeolite.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + } or { + { icon = "__bzgas__/graphics/icons/formaldehyde.png", icon_size = 128}, + }), + main_product = "formaldehyde", + subgroup = "fluid-recipes", + enabled = false, + energy_required = 4, + ingredients = {{ type = "fluid", name = "gas", amount = 50 }, {type="item", name="zeolite", amount=1}}, + results = {{type = "item", name="zeolite", amount=1, probability=0.9}, { type = "fluid", name = "sulfur-dioxide", amount = 20 }, { type = "fluid", name = "formaldehyde", amount = 30 }} + }, + }) + end + if mods["Nylon2"] then + data:extend({ + { + type = "recipe", + name = "tissue-digestion", + category = "chemistry", + order = "c", + icons = { + { icon = "__Nylon2__/graphics/icons/coal-tar.png", icon_size = 64}, + { icon = "__Krastorio2Assets__/icons/items-with-variations/biomass/biomass.png", icon_size = 64, scale=0.2, shift= {-8, -8}},}, + subgroup = "chemical", + enabled = false, + energy_required = 4, + ingredients = {{type="item", name="biomass", amount=10}, {type = "item", name = "sodium-hydroxide", amount=10}}, + results = {{ type = "fluid", name = "coal-tar", amount = 10 }} + }, + }) + end +end +if mods["bzchlorine"] then + data:extend({ + { + type = "recipe", + name = "sodium-hydroxide-reaction", + category = "chemistry", + order = "s", + icons = (mods["Krastorio2"] and + { + { icon = "__bzchlorine__/graphics/icons/salt.png", icon_size = 128}, + { icon = "__ChemistryForYou2__/graphics/icons/sodium-hydroxide.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + } or { + { icon = "__bzchlorine__/graphics/icons/salt.png", icon_size = 128}, + }), + main_product = "salt", + subgroup = "chemical", + enabled = false, + energy_required = 3, + ingredients = {{type="item", name="sodium-hydroxide", amount=10}, { type = "fluid", name = "kr-hydrogen-chloride", amount = 100 }}, + results = {{type="item", name="salt", amount=10}, { type = "fluid", name = "water", amount = 100 }} + }, + }) +end +if data.raw.fluid["chemical-waste"] and mods["BrimStuff-Updated"] then + data:extend({ + { + type = "recipe", + name = "sodium-hydroxide-waste-treatment", + icons = { + { icon = "__BrimStuff-Updated__/graphics/icons/chemical-waste.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/sodium-hydroxide.png", icon_size = 128, scale=0.125, shift= {-8, -8}},}, + category = "chemistry", + subgroup = "waste-treatment", + order = "c", + enabled = false, + energy_required = 2, + ingredients = {{ type = "fluid", name = "chemical-waste", amount = 300 }, { type="item", name="sodium-hydroxide", amount = 30}}, + results = {{ type = "fluid", name = "water", amount = 300 }}, + } + }) +end +end + +local productivity_science_pack_ingredients = {} +if data.raw.item["crt"] then + table.insert(productivity_science_pack_ingredients, {type="item", name="crt", amount=1}) +end +if data.raw.item["nylon-machine-parts"] then + table.insert(productivity_science_pack_ingredients, {type="item", name="nylon-machine-parts", amount=5}) +end +if data.raw.item["blank-advanced-tech-card"] then + table.insert(productivity_science_pack_ingredients, {type="item", name="blank-advanced-tech-card", amount=5}) +end +if data.raw.item["air-bearing"] then + table.insert(productivity_science_pack_ingredients, {type="item", name="air-bearing", amount=5}) +end +if data.raw.fluid["radon"] then + table.insert(productivity_science_pack_ingredients, { type = "fluid", name = "radon", amount = 5 }) +end +data:extend({ + { + type = "tool", + name = "productivity-science-pack", + icon = science_pack, + icon_size = 64, + subgroup = "science-pack", + stack_size = 200, + order = "d", + durability = 1, + durability_description_key = "description.science-pack-remaining-amount-key", + durability_description_value = "description.science-pack-remaining-amount-value", + }, + { + type = "recipe", + name = "productivity-science-pack", + category = "crafting-with-fluid", + enabled = false, + energy_required = 20, + ingredients = productivity_science_pack_ingredients, + results = {{type="item", name="productivity-science-pack", amount=5}}, + } +}) +util.add_productivity("productivity-science-pack") +table.insert(data.raw.lab["lab"].inputs, "productivity-science-pack") +if mods["Krastorio2"] then + table.insert(data.raw.lab["kr-advanced-lab"].inputs, "productivity-science-pack") +end +if mods["space-exploration"] then + local vitalic_extract_ingredients = {{type="item", name="se-vitamelange-extract", amount=1}, {type="fluid", name="carbon-dioxide", amount=10}} + if data.raw.item["lithium-chloride"] then + table.insert(vitalic_extract_ingredients, {"lithium-chloride", amount=1}) + end + data:extend({ + { + type = "fluid", + name = "vitalic-slurry", + default_temperature = 25, + max_temperature = 100, + auto_barrel = true, + base_color = { r = 0.50, g = 0.50, b = 0.50 }, + flow_color = { r = 0.50, g = 0.50, b = 0.50 }, + gas_temperature = 25, + icon = "__ChemistryForYou2__/graphics/icons/vitalic-slurry.png", + icon_size = 64, + icon_mipmaps = 4, + order = "v" + }, + { + type = "item", + name = "vitalic-residue", + icon = "__ChemistryForYou2__/graphics/icons/vitalic-residue.png", + icon_size = 128, + group = "resources", + subgroup = "vitamelange", + order = "v", + stack_size = 100, + }, + { + type = "item", + name = "vitalic-extract", + icon = "__ChemistryForYou2__/graphics/icons/vitalic-extract.png", + icon_size = 128, + group = "resources", + subgroup = "vitamelange", + order = "v", + stack_size = 100, + }, + { + type = "recipe", + name = "vitalic-purification", + category = "chemistry", + main_product = "se-vitalic-acid", + subgroup = "vitamelange", + order = "g", + enabled = false, + energy_required = 8, + ingredients = {{ type = "fluid", name = "vitalic-slurry", amount = 80 }, { type = "fluid", name = "water", amount = 20 }, {type="item", name="sodium-hydroxide", amount=2}}, + results = {{ type = "fluid", name = "se-vitalic-acid", amount = 100 }, {type="item", name="vitalic-residue", amount=2}}, + }, + { + type = "recipe", + name = "vitalic-residue-extract", + category = "chemistry", + subgroup = "vitamelange", + order = "g", + enabled = false, + energy_required = 10, + ingredients = {{type="item", name="vitalic-residue", amount=10}}, + results = {{type="item", name="se-vitamelange-extract", amount=1}}, + }, + { + type = "recipe", + name = "vitalic-extract", + category = "chemistry", + subgroup = "vitamelange", + order = "g", + enabled = false, + energy_required = 8, + ingredients = vitalic_extract_ingredients, + results = {{type="item", name="vitalic-extract", amount=1}}, + }, + { + type = "recipe", + name = "matter-to-particle", + icons = + { + { icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png", icon_size = 64}, + { icon = "__base__/graphics/icons/stone.png", icon_size = 64, scale=0.3, shift= {-8, -8}}, + }, + category = "space-accelerator", + subgroup = "stream", + order = "r-f", + enabled = false, + energy_required = 20, + ingredients = {{type="item", name="stone", amount=10}, { type = "fluid", name = "se-plasma-stream", amount = 20 }}, + results = {{ type = "fluid", name = "se-particle-stream", amount = 10 }}, + } + }) + util.add_unlock("se-vitalic-acid","vitalic-purification") + util.add_unlock("se-vitalic-acid","vitalic-residue-extract") + util.add_unlock("se-vitalic-reagent","vitalic-extract") + util.add_productivity("vitalic-extract") + util.add_productivity("vitalic-purification") + table.insert(data.raw.lab["se-space-science-lab"].inputs, "productivity-science-pack") + if mods["248k-Redux"] then + local deep_space_ore_enrichment_ingredients = {{type="item", name="fu_space_probe_ore_item", amount=10}} + if data.raw.item["cobalt-nanotubes"] then + table.insert(deep_space_ore_enrichment_ingredients, {type="item", name="cobalt-nanotubes", amount=8}) + end + if data.raw.item["gold-powder"] then + table.insert(deep_space_ore_enrichment_ingredients, {type="item", name="gold-powder", amount=16}) + end + if data.raw.item["se-kr-fine-imersite-powder"] then + table.insert(deep_space_ore_enrichment_ingredients, {type="item", name="se-kr-fine-imersite-powder", amount=6}) + end + data:extend({ + { + type = "recipe", + name = "vulcanite-enrichment", + category = "fu_plasma_category", + subgroup = "vulcanite", + order = "a-b", + enabled = false, + energy_required = 20, + ingredients = {{type="item", name="se-vulcanite-block", amount=1}, {"fi_thorium232_item", amount=10}}, + results = {{type="item", name="se-vulcanite-enriched", amount=5}}, + }, + { + type = "recipe", + name = "deep-space-ore-enrichment", + category = "smelting", + subgroup = "naquium", + order = "a-b", + enabled = false, + energy_required = 18, + ingredients = deep_space_ore_enrichment_ingredients, + results = {{type="item", name="se-naquium-ore", amount=5}}, + } + }) + util.add_productivity("deep-space-ore-enrichment") + end + if mods["bztungsten"] then + local smart_glass_ingredients = {{type="item", name="tungsten-trioxide", amount=10}, {type="item", name="glass", amount=10}} + if data.raw.item["graphene"] then + table.insert(smart_glass_ingredients, {type="item", name="graphene", amount=4}) + end + data:extend({ + { + type = "item", + name = "tungsten-trioxide", + icon = "__ChemistryForYou2__/graphics/icons/tungsten-trioxide.png", + icon_size = 128, + group = "resources", + subgroup = "chemical", + order = "t", + stack_size = 200, + }, + { + type = "item", + name = "smart-glass", + icon = "__ChemistryForYou2__/graphics/icons/smart-glass.png", + icon_size = 64, + group = "resources", + subgroup = "chemical", + order = "t", + stack_size = 200, + }, + { + type = "recipe", + name = "tungsten-trioxide", + icon = "__ChemistryForYou2__/graphics/icons/tungsten-trioxide.png", + icon_size = 128, + category = "smelting", + subgroup = "chemical", + order = "t", + enabled = false, + energy_required = 24, + ingredients = {{type="item", name="tungsten-ore", amount=5}, { type = "fluid", name = "kr-hydrogen-chloride", amount = 100 }}, + results = {{type="item", name="tungsten-trioxide", amount=5}, { type = "fluid", name = "water", amount = 50 }}, + }, + { + type = "recipe", + name = "tungsten-trioxide-smelting", + icons = (mods["Krastorio2"] and + { + { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 128}, + { icon = "__ChemistryForYou2__/graphics/icons/tungsten-trioxide.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + } or { + { icon = "__bztungsten__/graphics/icons/tungsten-plate.png", icon_size = 128}, + }), + category = "smelting", + subgroup = "chemical", + order = "t", + enabled = false, + energy_required = 30, + ingredients = {{type="item", name="tungsten-trioxide", amount=10}, { type = "fluid", name = "hydrogen", amount = 300 }}, + results = {{type="item", name="tungsten-plate", amount=10}, { type = "fluid", name = "water", amount = 300 }}, + }, + { + type = "recipe", + name = "smart-glass", + category = "chemistry", + subgroup = "chemical", + order = "g", + enabled = false, + energy_required = 12, + ingredients = smart_glass_ingredients, + results = {{type="item", name="smart-glass", amount=10}}, + } + }) + end +end \ No newline at end of file diff --git a/ChemistryForYou2/prototypes/technology.lua b/ChemistryForYou2/prototypes/technology.lua new file mode 100644 index 0000000..b365308 --- /dev/null +++ b/ChemistryForYou2/prototypes/technology.lua @@ -0,0 +1,862 @@ +local util = require("data-util") + +local science_pack = "__ChemistryForYou2__/graphics/icons/productivity-science-pack.png" +local science_pack_size = 64 +local sodaPrerequ = {"advanced-material-processing"} +local alumChemPrerequ = {"advanced-material-processing"} +local rich_water_filtration_pre = {"productivity-science-pack"} +local lithiumChemPrerequ = {"chemical-science-pack"} +if mods["Krastorio2"] then + sodaPrerequ = {"kr-fluids-chemistry"} + alumChemPrerequ = {"kr-fluids-chemistry"} + lithiumChemPrerequ = {"kr-advanced-chemistry"} + if mods["space-exploration"] then + science_pack = "__Krastorio2Assets__/technologies/production-tech-card.png" + science_pack_size = 256 + end +end + +local saltpeterPrerequ = {"chemical-science-pack"} +if mods["bztin"] then + saltpeterPrerequ = {"organic-chemistry"} +end + +if mods["bzsilicon"] then + rich_water_filtration_pre = {"water-filtration"} +end + +local productivityPrerequ = {"chemical-science-pack"} +if mods["Tantalite2"] then + productivityPrerequ = {"cathode-ray-tube"} +end + +local anthraquinonePrerequ = {"productivity-science-pack"} +if mods["Krastorio2"] then + anthraquinonePrerequ = {"productivity-science-pack", "kr-advanced-chemistry"} +end + +data:extend( + { + { + type = "technology", + name = "productivity-science-pack", + icon = science_pack, + icon_size = science_pack_size, + prerequisites = productivityPrerequ, + effects = { + { + type = "unlock-recipe", + recipe = "productivity-science-pack", + } + }, + unit = + { + count = 200, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "soda-lime-glass", + icons = (mods["Krastorio2"] and + { + { icon = "__Krastorio2Assets__/icons/items/glass.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/sodium-carbonate.png", icon_size = 128, scale=0.25, shift= {-8, -8}}, + } or { + { icon = "__ChemistryForYou2__/graphics/icons/sodium-carbonate.png", icon_size = 128}, + }), + prerequisites = sodaPrerequ, + effects = { + { + type = "unlock-recipe", + recipe = "sodium-carbonate", + }, + { + type = "unlock-recipe", + recipe = "carbon-dioxide", + }, + { + type = "unlock-recipe", + recipe = "soda-lime-glass", + } + }, + unit = + { + count = 75, + ingredients = + { + { "automation-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "aluminium-chemistry", + icon = "__ChemistryForYou2__/graphics/icons/sodium-hydroxide.png", + icon_size = 128, + prerequisites = alumChemPrerequ, + effects = { + { + type = "unlock-recipe", + recipe = "aluminium-hydroxide", + }, + { + type = "unlock-recipe", + recipe = "aluminium-hydroxide-smelting", + } + }, + unit = + { + count = 75, + ingredients = + { + { "automation-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "anthraquinone-process", + icon = "__ChemistryForYou2__/graphics/icons/hydrogen-peroxide.png", + icon_size = 128, + prerequisites = anthraquinonePrerequ, + effects = { + { + type = "unlock-recipe", + recipe = "hydrogen-peroxide", + }, + { + type = "unlock-recipe", + recipe = "hydrogen-peroxide-disproportionation", + } + }, + unit = + { + count = 250, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "saltpeter-sulfuric-acid", + icons = (mods["BrimStuff-Updated"] and + { + { icon = "__base__/graphics/icons/fluid/sulfuric-acid.png", icon_size = 64}, + { icon = "__BrimStuff-Updated__/graphics/icons/potassium-nitrate.png", icon_size = 64, scale=0.5, shift= {-8, -8}}, + } or { + { icon = "__base__/graphics/icons/fluid/sulfuric-acid.png", icon_size = 64}, + }), + prerequisites = saltpeterPrerequ, + effects = { + { + type = "unlock-recipe", + recipe = "saltpeter-sulfuric-acid", + } + }, + unit = + { + count = 150, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "nitrous-oxide-rocket-fuel", + icons = (mods["Krastorio2"] and + { + { icon = "__base__/graphics/technology/rocket-fuel.png", icon_size = 256}, + { icon = "__ChemistryForYou2__/graphics/icons/nitrous-oxide.png", icon_size = 128, scale=0.6, shift= {-80, -80}}, + } or { + { icon = "__base__/graphics/technology/rocket-fuel.png", icon_size = 256}, + }), + prerequisites = {"saltpeter-sulfuric-acid", "rocket-fuel"}, + effects = { + { + type = "unlock-recipe", + recipe = "nitrous-oxide-rocket-fuel", + } + }, + unit = + { + count = 125, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "lithium-chemistry", + icon = "__ChemistryForYou2__/graphics/icons/lithium-peroxide.png", + icon_size = 128, + prerequisites = lithiumChemPrerequ, + effects = { + { + type = "unlock-recipe", + recipe = "lithium-peroxide", + }, + { + type = "unlock-recipe", + recipe = "lithium-hydroxide-lubricant", + }, + { + type = "unlock-recipe", + recipe = "lithium-hydroxide-purification", + } + }, + unit = + { + count = 175, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 } + }, + time = 30 + } + } +}) + +if mods["Krastorio2"] then + util.add_unlock("soda-lime-glass","soda-lime-glass") + util.add_unlock("kr-mineral-water-gathering","water-softening") + data:extend( + { + { + type = "technology", + name = "ammonium-nitrate-explosives", + icon = "__ChemistryForYou2__/graphics/technology/ammonium-nitrate-explosives.png", + icon_size = 256, + prerequisites = {"productivity-science-pack", "kr-advanced-chemistry", "explosives"}, + effects = { + { + type = "unlock-recipe", + recipe = "ammonium-nitrate-explosives", + }, + { + type = "unlock-recipe", + recipe = "ammonium-nitrate", + }, + { + type = "unlock-recipe", + recipe = "nitrate", + } + }, + unit = + { + count = 250, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "carbon-dioxide-growing", + icon = "__ChemistryForYou2__/graphics/icons/carbon-dioxide.png", + icon_size = 128, + prerequisites = {"productivity-science-pack", "kr-bio-processing"}, + effects = { + { + type = "unlock-recipe", + recipe = "grow-wood-with-carbon-dioxide", + } + }, + unit = + { + count = 50, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "trace-uranium-extraction", + icons = { + { icon = "__base__/graphics/icons/uranium-ore.png", icon_size = 64}, + { icon = "__ChemistryForYou2__/graphics/icons/sodium-diuranate.png", icon_size = 128, scale=0.25, shift= {-8, -8}}, + }, + prerequisites = {"uranium-processing"}, + effects = { + { + type = "unlock-recipe", + recipe = "sodium-diuranate", + }, + { + type = "unlock-recipe", + recipe = "sodium-diuranate-smelting", + } + }, + unit = + { + count = 375, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "hydrogen-peroxide-rocket-fuel", + icons = (mods["Krastorio2"] and + { + { icon = "__base__/graphics/technology/rocket-fuel.png", icon_size = 256}, + { icon = "__ChemistryForYou2__/graphics/icons/hydrogen-peroxide.png", icon_size = 128, scale=0.6, shift= {-80, -80}}, + } or { + { icon = "__base__/graphics/technology/rocket-fuel.png", icon_size = 256}, + }), + prerequisites = {"anthraquinone-process", "rocket-fuel"}, + effects = { + { + type = "unlock-recipe", + recipe = "hydrogen-peroxide-rocket-fuel", + } + }, + unit = + { + count = 225, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + } + }) + if mods["bzgas"] then + data:extend( + { + { + type = "technology", + name = "microporous-material", + icon = "__ChemistryForYou2__/graphics/icons/zeolite.png", + icon_size = 128, + prerequisites = {"aluminium-chemistry"}, + effects = { + { + type = "unlock-recipe", + recipe = "zeolite", + }, + { + type = "unlock-recipe", + recipe = "zeolite-formaldehyde", + } + }, + unit = + { + count = 150, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "sulfur-gas-processing", + icon = "__ChemistryForYou2__/graphics/icons/sulfur-trioxide.png", + icon_size = 128, + prerequisites = {"microporous-material", "sulfur-processing"}, + effects = { + { + type = "unlock-recipe", + recipe = "sulfur-trioxide", + }, + { + type = "unlock-recipe", + recipe = "sulfur-trioxide-hydration", + }, + { + type = "unlock-recipe", + recipe = "sulfur-smelting", + } + }, + unit = + { + count = 150, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 } + }, + time = 30 + } + } + }) + if mods["bzchlorine"] then + util.add_unlock("aluminium-chemistry", "sodium-hydroxide-reaction") + end + --Apperently I need electrolysis-2 tech for compatibility with EndgameCombat + if mods["EndgameCombat"] then + data:extend( + { + { + type = "technology", + name = "electrolysis-2", + icon = "__EndgameCombat__/graphics/icons/lye.png", + icon_size = 32, + prerequisites = {"aluminium-chemistry"}, + effects = {}, + unit = + { + count = 50, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 } + }, + time = 30 + } + }, + }) + end + if mods["bzsilicon"] then + data:extend( + { + { + type = "technology", + name = "water-filtration", + icon = "__Krastorio2Assets__/icons/entities/filtration-plant.png", + icon_size = 64, + prerequisites = {"productivity-science-pack", "aluminium-chemistry"}, + effects = { + { + type = "unlock-recipe", + recipe = "sodium-aluminate", + }, + { + type = "unlock-recipe", + recipe = "silica-extraction", + } + }, + unit = + { + count = 200, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "advanced-silicon-processing", + icon = "__Krastorio2Assets__/icons/items-with-variations/silicon/silicon.png", + icon_size = 64, + prerequisites = {"productivity-science-pack"}, + effects = { + { + type = "unlock-recipe", + recipe = "advanced-silicon-processing", + } + }, + unit = + { + count = 250, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + } + }) + end + end + if mods["Limestone2"] then + data:extend( + { + { + type = "technology", + name = "air-scrubing-oil-processing", + icons = {{ icon = "__base__/graphics/icons/fluid/light-oil.png", icon_size = 64}, + { icon = "__Limestone2__/graphics/icons/limestone-powder.png", icon_size = 64, scale=0.3, shift= {-8, -8}},}, + prerequisites = {"productivity-science-pack", "aluminium-chemistry"}, + effects = { + { + type = "unlock-recipe", + recipe = "air-scrubing-oil-processing", + }, + { + type = "unlock-recipe", + recipe = "calcium-sulfite-reaction", + } + }, + unit = + { + count = 175, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + }) + end +end + +if mods["248k-Redux"] then + data:extend( + { + { + type = "technology", + name = "rich-water-filtration", + icon = "__248k-Redux__/ressources/fluids/fi_dirty_water.png", + icon_size = 64, + prerequisites = rich_water_filtration_pre, + effects = { + { + type = "unlock-recipe", + recipe = "rich-water-filtration", + } + }, + unit = + { + count = 200, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + { + type = "technology", + name = "nuclear-waste-extraction", + icons = (mods["Krastorio2"] and + { + { icon = "__248k-Redux__/ressources/fission/fi_fuel/fi_fuel_plutonium239_item.png", icon_size = 64}, + { icon = "__248k-Redux__/ressources/fission/fi_materials/fi_materials_waste.png", icon_size = 64, scale=0.5, shift= {-8, -8}}, + } or { + { icon = "__248k-Redux__/ressources/fission/fi_fuel/fi_fuel_plutonium239_item.png", icon_size = 64}, + } + ), + prerequisites = {"rich-water-filtration", "nuclear-power"}, + effects = { + { + type = "unlock-recipe", + recipe = "nuclear-waste-extraction", + } + }, + unit = + { + count = 225, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 30 + } + }, + }) +end + +if mods["ThemTharHills-Updated"] then + if (mods["bzfoundry"] and mods["BrassTacks-Updated"]) and (mods["bzlead"] and mods["bzgold"]) then + data:extend( + { + { + type = "technology", + name = "silver-pyrometallurgi", + icon = "__bzgold__/graphics/icons/silver-ore.png", + icon_size = 128, + prerequisites = {"productivity-science-pack"}, + effects = { + { + type = "unlock-recipe", + recipe = "silver-pyrometallurgi", + } + }, + unit = + { + count = 250, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + }, + time = 45 + } + }, + }) + end +end +if mods["space-exploration"] then + local ingMatterParticle ={ + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + {"se-rocket-science-pack", 1}, + {"space-science-pack", 1}, + {"production-science-pack", 1}, + {"se-material-science-pack-3", 1}, + {"se-energy-science-pack-3", 1} + } + local preMatterParticle = {"se-energy-science-pack-3", "se-material-science-pack-3"} + if mods["Krastorio2"] then + ingMatterParticle ={ + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + {"se-rocket-science-pack", 1}, + {"space-science-pack", 1}, + {"production-science-pack", 1}, + {"se-material-science-pack-3", 1}, + {"se-energy-science-pack-3", 1}, + {"matter-tech-card", 1} + } + preMatterParticle = {"kr-matter-tech-card", "se-material-science-pack-3"} + end + + data:extend( + { + { + type = "technology", + name = "matter-to-particle", + icons = + { + { icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png", icon_size = 64}, + { icon = "__base__/graphics/icons/stone.png", icon_size = 64, scale=0.3, shift= {-8, -8}}, + }, + prerequisites = preMatterParticle, + effects = { + { + type = "unlock-recipe", + recipe = "matter-to-particle", + } + }, + unit = + { + count = 500, + ingredients = ingMatterParticle, + time = 60 + } + }, + }) +if mods["bztungsten"] then + data:extend( + { + { + type = "technology", + name = "tungsten-chemistry", + icon = "__ChemistryForYou2__/graphics/icons/tungsten-trioxide.png", + icon_size = 128, + prerequisites = {"se-space-manufactory"}, + effects = { + { + type = "unlock-recipe", + recipe = "tungsten-trioxide", + }, + { + type = "unlock-recipe", + recipe = "tungsten-trioxide-smelting", + }, + { + type = "unlock-recipe", + recipe = "smart-glass", + } + }, + unit = + { + count = 100, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + {"se-rocket-science-pack", 1}, + {"space-science-pack", 1} + }, + time = 45 + } + }, + }) +end +if mods["Cobalt2"] then + data:extend( + { + { + type = "technology", + name = "cobalt-chemistry", + icon = "__ChemistryForYou2__/graphics/icons/cobalt-hydroxide.png", + icon_size = 128, + prerequisites = {"space-science-pack"}, + effects = { + { + type = "unlock-recipe", + recipe = "cobalt-hydroxide", + }, + { + type = "unlock-recipe", + recipe = "cobalt-nanotubes", + } + }, + unit = + { + count = 100, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + {"se-rocket-science-pack", 1}, + {"space-science-pack", 1} + }, + time = 30 + } + }, + }) + util.remove_prerequisite("cobalt-electromagnet","space-science-pack") + util.remove_prerequisite("cobalt-carbide","space-science-pack") + util.add_prerequisite("cobalt-electromagnet","cobalt-chemistry") + util.add_prerequisite("cobalt-carbide","cobalt-chemistry") +end +if mods["248k-Redux"] then + data:extend( + { + { + type = "technology", + name = "vulcanite-enrichment", + icon = "__space-exploration-graphics__/graphics/icons/vulcanite-enriched.png", + icon_size = 64, + prerequisites = {"fu_plasma_tech", "se-material-science-pack-3"}, + effects = { + { + type = "unlock-recipe", + recipe = "vulcanite-enrichment", + } + }, + unit = + { + count = 100, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + {"se-rocket-science-pack", 1}, + {"space-science-pack", 1}, + {"production-science-pack", 1}, + {"se-material-science-pack-3", 1} + }, + time = 30 + } + }, + { + type = "technology", + name = "deep-space-ore-enrichment", + icon = "__space-exploration-graphics__/graphics/icons/naquium-ore.png", + icon_size = 64, + prerequisites = {"se-deep-space-science-pack-2", "gr_stage_tech"}, + effects = { + { + type = "unlock-recipe", + recipe = "deep-space-ore-enrichment", + } + }, + unit = + { + count = 300, + ingredients = + { + {"se-rocket-science-pack", 1}, + {"space-science-pack", 1}, + {"production-science-pack", 1}, + {"se-material-science-pack-4", 1}, + {"se-deep-space-science-pack-2", 1}, + }, + time = 60 + } + } + }) +end +end + +if data.raw.technology["organic-chemistry"] then + util.add_prerequisite("organic-chemistry","productivity-science-pack") + data.raw.technology["organic-chemistry"].unit.ingredients[#data.raw.technology["organic-chemistry"].unit.ingredients+1] = {"productivity-science-pack", 1} +end + +if data.raw.technology["indium-pcb-solder"] then + util.add_prerequisite("indium-pcb-solder","productivity-science-pack") + data.raw.technology["indium-pcb-solder"].unit.ingredients[#data.raw.technology["indium-pcb-solder"].unit.ingredients+1] = {"productivity-science-pack", 1} +end + +if data.raw.technology["indium-pcb-solder"] then + util.add_prerequisite("polyethylene-plastic","productivity-science-pack") + data.raw.technology["polyethylene-plastic"].unit.ingredients[#data.raw.technology["polyethylene-plastic"].unit.ingredients+1] = {"productivity-science-pack", 1} +end + +if mods["space-exploration"] then + if mods["248k-Redux"] then + data.raw.technology["nuclear-waste-extraction"].unit.ingredients[#data.raw.technology["nuclear-waste-extraction"].unit.ingredients+1] = {"se-rocket-science-pack", 1} + end + data.raw.technology["trace-uranium-extraction"].unit.ingredients[#data.raw.technology["trace-uranium-extraction"].unit.ingredients+1] = {"se-rocket-science-pack", 1} +end \ No newline at end of file diff --git a/ChemistryForYou2/recipe-final-fix.lua b/ChemistryForYou2/recipe-final-fix.lua new file mode 100644 index 0000000..317c25d --- /dev/null +++ b/ChemistryForYou2/recipe-final-fix.lua @@ -0,0 +1,18 @@ +local util = require("data-util") + +if mods["space-exploration"] then + util.add_product("se-vitalic-acid", { type = "fluid", name = "vitalic-slurry", amount = 8 }) + util.set_main_product("se-vitalic-acid", "vitalic-slurry") + util.remove_product("se-vitalic-acid", "se-vitalic-acid") + if mods["bobassembly"] then + util.remove_prerequisite("automation-3", "space-science-pack") + util.add_prerequisite("automation-3", "productivity-science-pack") + data.raw.technology["automation-3"].unit.ingredients = { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "se-rocket-science-pack", 1 }, + { "productivity-science-pack", 1 } + } + end +end \ No newline at end of file diff --git a/ChemistryForYou2/recipe-modify.lua b/ChemistryForYou2/recipe-modify.lua new file mode 100644 index 0000000..c803813 --- /dev/null +++ b/ChemistryForYou2/recipe-modify.lua @@ -0,0 +1,163 @@ +local util = require("data-util") + +-- Main vanilla changes + + +-- Mod changes +if mods["248k-Redux"] then + util.remove_ingredient("satellite", "fu_materials_KFK") + + util.add_prerequisite("fi_ceramic_tech","productivity-science-pack") + data.raw.technology["fi_ceramic_tech"].unit.ingredients[#data.raw.technology["fi_ceramic_tech"].unit.ingredients+1] = {"productivity-science-pack", 1} + + util.add_prerequisite("fi_modules_2_tech","productivity-science-pack") + data.raw.technology["fi_modules_2_tech"].unit.ingredients[#data.raw.technology["fi_modules_2_tech"].unit.ingredients+1] = {"productivity-science-pack", 1} + + util.add_prerequisite("fi_robo_tech","productivity-science-pack") + data.raw.technology["fi_robo_tech"].unit.ingredients[#data.raw.technology["fi_robo_tech"].unit.ingredients+1] = {"productivity-science-pack", 1} + + util.add_prerequisite("fi_refinery_tech","productivity-science-pack") + data.raw.technology["fi_refinery_tech"].unit.ingredients[#data.raw.technology["fi_refinery_tech"].unit.ingredients+1] = {"productivity-science-pack", 1} + data.raw.technology["fi_refinery_2_tech"].unit.ingredients[#data.raw.technology["fi_refinery_2_tech"].unit.ingredients+1] = {"productivity-science-pack", 1} + data.raw.technology["fi_refinery_3_tech"].unit.ingredients[#data.raw.technology["fi_refinery_3_tech"].unit.ingredients+1] = {"productivity-science-pack", 1} + data.raw.technology["fi_refinery_4_tech"].unit.ingredients[#data.raw.technology["fi_refinery_4_tech"].unit.ingredients+1] = {"productivity-science-pack", 1} + + util.add_unlock("el_lithium_tech","lithium-hydroxide") + if mods["LithiumFix"] then + util.replace_ingredient("el_lithium_battery_recipe", "lithium", "lithium-hydroxide", 4) + util.replace_ingredient("el_lithium_basic_battery_recipe", "lithium", "lithium-hydroxide", 4) + else + util.replace_ingredient("el_lithium_battery_recipe", "el_lithium_item", "lithium-hydroxide", 4) + util.replace_ingredient("el_lithium_basic_battery_recipe", "el_lithium_item", "lithium-hydroxide", 4) + end +end + +if mods["Bio_Industries_2"] then + util.add_ingredient("bi-woodpulp", "sodium-hydroxide", 1) + util.add_ingredient("bi-solar-boiler-hidden-panel", "sodium-hydroxide", 200) + + util.add_prerequisite("bi-tech-advanced-biotechnology","organic-chemistry") + data.raw.technology["bi-tech-advanced-biotechnology"].unit.ingredients[#data.raw.technology["bi-tech-advanced-biotechnology"].unit.ingredients+1] = {"productivity-science-pack", 1} +end + + +if mods["RampantArsenal"] then + util.add_prerequisite("rampant-arsenal-technology-lite-artillery","productivity-science-pack") + data.raw.technology["rampant-arsenal-technology-lite-artillery"].unit.ingredients[#data.raw.technology["rampant-arsenal-technology-lite-artillery"].unit.ingredients+1] = {"productivity-science-pack", 1} +end + +if mods["Krastorio2"] then + util.add_prerequisite("kr-bio-fuel","organic-chemistry") + util.add_unlock("kr-atmosphere-condensation", "carbon-dioxide-condensation") + util.add_unlock("kr-bio-processing","tissue-digestion") + data.raw.technology["kr-bio-fuel"].unit.ingredients[#data.raw.technology["kr-bio-fuel"].unit.ingredients+1] = {"productivity-science-pack", 1} + util.add_product("kr-water-electrolysis", {type="item", name="sodium-hydroxide", amount=2}) + + if mods["BrimStuff-Updated"] then + util.add_unlock("kr-fluids-chemistry","sodium-hydroxide-waste-treatment") + end + + if mods["space-exploration"] then + util.add_prerequisite("se-lifesupport-facility", "lithium-chemistry") + util.replace_ingredient("se-lifesupport-canister-coal", "coal", "lithium-peroxide", 2) + util.remove_all_recipe_effects("se-lifesupport-canister-fish") + util.add_product("se-used-lifesupport-canister-cleaning", {type="item", name="lithium-carbonate", amount=2}) + util.add_product("se-used-lifesupport-canister-cleaning-space", {type="item", name="lithium-carbonate", amount=2}) + end + + if mods["IntermediatesForYou2"] then + util.add_prerequisite("slag-processing", "productivity-science-pack") + data.raw.technology["slag-processing"].unit.ingredients[#data.raw.technology["slag-processing"].unit.ingredients+1] = {"productivity-science-pack", 1} + end +else + util.set_category("stone-brick", "crafting") + util.set_main_product("stone-brick","stone-brick") + util.add_product("stone-brick", {type="item", name="sodium-hydroxide", amount=1}) +end + +if mods["BrimStuff-Updated"] and mods["Nylon2"] then + util.add_prerequisite("nylon-drive-belt", "productivity-science-pack") + data.raw.technology["nylon-drive-belt"].unit.ingredients[#data.raw.technology["nylon-drive-belt"].unit.ingredients+1] = {"productivity-science-pack", 1} +end + +if mods["ShockTurret"] then + util.add_prerequisite("adikings-shock-turret-to-laser-turret", "productivity-science-pack") + data.raw.technology["adikings-shock-turret-to-laser-turret"].unit.ingredients = { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 }, + { "chemical-science-pack", 1 }, + { "productivity-science-pack", 1 } + } +end + +if mods["bzgold"] and mods["ThemTharHills-Updated"] then + util.add_product("trace-gold-from-copper", {name="platinum-powder", amount=1, probability=0.1}) + util.add_unlock("gold-processing", "platinum-ingot") +end + +if mods["LasingAround-Updated"] then + util.replace_ingredient("carbon-dioxide-laser", "petroleum-gas", "carbon-dioxide", 100) +end + +if mods["bzgas"] then + util.add_product("gas-reforming", { type = "fluid", name = "carbon-dioxide", amount = 50 }) +end + +if mods["Chromium2"] then + util.add_ingredient("polyethylene-plastic", "sodium-hydroxide", 4) +end + +if mods["space-exploration"] then + + se_delivery_cannon_recipes["hydrogen-peroxide-barrel"] = {name= "hydrogen-peroxide-barrel"} + se_delivery_cannon_recipes["nitrate-barrel"] = {name= "nitrate-barrel"} + se_delivery_cannon_recipes["nitrous-oxide-barrel"] = {name= "nitrous-oxide-barrel"} + se_delivery_cannon_recipes["carbon-dioxide-barrel"] = {name= "carbon-dioxide-barrel"} + se_delivery_cannon_recipes["sulfur-dioxide-barrel"] = {name= "sulfur-dioxide-barrel"} + se_delivery_cannon_recipes["sulfur-trioxide-barrel"] = {name= "sulfur-trioxide-barrel"} + se_delivery_cannon_recipes["vitalic-slurry-barrel"] = {name= "vitalic-slurry-barrel"} + + util.replace_some_ingredient("se-bioscrubber","se-vitalic-acid", 100, "lithium-peroxide", 10) + util.add_ingredient("se-biochemical-resistance-data", "vitalic-residue", 1) + util.set_ingredient("se-biochemical-resistance-data", "se-empty-data", 2) + util.set_product_amount("se-biochemical-resistance-data", "se-biochemical-resistance-data", 2) + util.set_product_amount("se-biochemical-resistance-data", "se-junk-data", 2) + util.remove_ingredient("se-vitalic-reagent", "lithium-chloride") + util.remove_ingredient("se-vitalic-reagent", "se-vitamelange-extract") + util.add_ingredient("se-vitalic-reagent", "vitalic-extract", 4) + + if mods["Limestone2"] then + util.add_product("calcium-plate", { type = "fluid", name = "carbon-dioxide", amount = 10 }) + end + + if mods["bztungsten"] then + util.remove_ingredient("se-space-biochemical-laboratory", "graphene") + util.replace_ingredient("se-space-biochemical-laboratory", "glass", "smart-glass", 80) + + util.remove_ingredient("se-space-growth-facility", "graphene") + util.replace_ingredient("se-space-growth-facility", "glass", "smart-glass", 300) + + util.remove_ingredient("se-space-mirror", "silver-plate") + util.replace_ingredient("se-space-mirror", "glass", "smart-glass", 8) + + util.remove_ingredient("se-space-mirror-alternate", "silver-plate") + util.replace_ingredient("se-space-mirror-alternate", "glass", "smart-glass", 2) + + util.add_prerequisite("se-space-biochemical-laboratory","tungsten-chemistry") + end + if mods["Cobalt2"] then + util.replace_ingredient("cobalt-carbide", "cobalt-plate", "cobalt-nanotubes", 6) + util.replace_ingredient("cobalt-electromagnet", "cobalt-plate", "cobalt-nanotubes", 4) + + util.add_ingredient("se-tensile-strength-data","cobalt-nanotubes", 1) + util.set_ingredient("se-tensile-strength-data", "se-empty-data", 2) + util.set_product_amount("se-tensile-strength-data", "se-tensile-strength-data", 2) + + util.add_ingredient("se-holmium-cable","cobalt-nanotubes", 1) + util.set_ingredient("se-holmium-cable", "se-holmium-plate", 1) + + if mods["Chromium2"] then + util.add_ingredient("beryllium-heat-resistant-low-density-structure", "cobalt-nanotubes", 3) + end + end +end \ No newline at end of file diff --git a/ChemistryForYou2/thumbnail.png b/ChemistryForYou2/thumbnail.png new file mode 100644 index 0000000..f23bfd7 Binary files /dev/null and b/ChemistryForYou2/thumbnail.png differ diff --git a/README.md b/README.md index dda624b..ee76f80 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# ChemistryForYou2 +# ChemistryForYou +Updated for Factorio 2.0. + +Original mod: https://mods.factorio.com/mod/ChemistryForYou \ No newline at end of file