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/GasGasGases2/LICENSE.md b/GasGasGases2/LICENSE.md new file mode 100644 index 0000000..ee22ee9 --- /dev/null +++ b/GasGasGases2/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/GasGasGases2/README.md b/GasGasGases2/README.md new file mode 100644 index 0000000..7db4260 --- /dev/null +++ b/GasGasGases2/README.md @@ -0,0 +1,16 @@ +# MetalsForYou + +## Version History +See changelog.txt + +## Created by + + +## Thanks to + +### Compatibility + + +### Localization + + diff --git a/GasGasGases2/changelog.txt b/GasGasGases2/changelog.txt new file mode 100644 index 0000000..df4b129 --- /dev/null +++ b/GasGasGases2/changelog.txt @@ -0,0 +1,32 @@ +--------------------------------------------------------------------------------------------------- +Version: 0.1.5 +Date: 2024-01-21 + Features: + - Removed old unused files. +--------------------------------------------------------------------------------------------------- +Version: 0.1.4 +Date: 2023-12-20 + Features: + - Added earlier argon recipe and removed optics air liquefaction prerequisite if bzgas is instaled. +--------------------------------------------------------------------------------------------------- +Version: 0.1.3 +Date: 2023-12-07 + Features: + - Fixed BZ Carbon's fullerene recipe accidentally changed to a crafting-with-fluid recipe. +--------------------------------------------------------------------------------------------------- +Version: 0.1.2 +Date: 2023-12-03 + Features: + - Fixed to work with the MetalsForYou mod split. + - Fixed cryogenic gas plant not outputting all gases. +--------------------------------------------------------------------------------------------------- +Version: 0.1.1 +Date: 2023-11-28 + Features: + - More support for MetalsForYou. + - Fixed textures alpha level. +--------------------------------------------------------------------------------------------------- +Version: 0.1.0 +Date: 2023-11-25 + Features: + - Alpha release. \ No newline at end of file diff --git a/GasGasGases2/data-final-fixes.lua b/GasGasGases2/data-final-fixes.lua new file mode 100644 index 0000000..b95c07f --- /dev/null +++ b/GasGasGases2/data-final-fixes.lua @@ -0,0 +1 @@ +local util = require("recipe-final-fix") \ No newline at end of file diff --git a/GasGasGases2/data-updates.lua b/GasGasGases2/data-updates.lua new file mode 100644 index 0000000..09f8c28 --- /dev/null +++ b/GasGasGases2/data-updates.lua @@ -0,0 +1 @@ +require("recipe-modify") \ No newline at end of file diff --git a/GasGasGases2/data-util.lua b/GasGasGases2/data-util.lua new file mode 100644 index 0000000..4b2d096 --- /dev/null +++ b/GasGasGases2/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/GasGasGases2/data.lua b/GasGasGases2/data.lua new file mode 100644 index 0000000..d9c03df --- /dev/null +++ b/GasGasGases2/data.lua @@ -0,0 +1,3 @@ +require("prototypes.recipes") +require("prototypes.entities") +require("prototypes.technology") \ No newline at end of file diff --git a/GasGasGases2/graphics/entity/cryogenic-gas-plant/cryogenic-gas-plant-reflection.png b/GasGasGases2/graphics/entity/cryogenic-gas-plant/cryogenic-gas-plant-reflection.png new file mode 100644 index 0000000..ebbb5d6 Binary files /dev/null and b/GasGasGases2/graphics/entity/cryogenic-gas-plant/cryogenic-gas-plant-reflection.png differ diff --git a/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-cold.png b/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-cold.png new file mode 100644 index 0000000..f216dd3 Binary files /dev/null and b/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-cold.png differ diff --git a/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-light.png b/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-light.png new file mode 100644 index 0000000..f6a66d7 Binary files /dev/null and b/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-light.png differ diff --git a/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-shadow.png b/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-shadow.png new file mode 100644 index 0000000..138111d Binary files /dev/null and b/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-shadow.png differ diff --git a/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant.png b/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant.png new file mode 100644 index 0000000..42fb9bf Binary files /dev/null and b/GasGasGases2/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant.png differ diff --git a/GasGasGases2/graphics/entity/cryogenic-gas-plant/remnants/hr-cryogenic-gas-plant-remnants.png b/GasGasGases2/graphics/entity/cryogenic-gas-plant/remnants/hr-cryogenic-gas-plant-remnants.png new file mode 100644 index 0000000..fa9c609 Binary files /dev/null and b/GasGasGases2/graphics/entity/cryogenic-gas-plant/remnants/hr-cryogenic-gas-plant-remnants.png differ diff --git a/GasGasGases2/graphics/icons/advanced-electronic-components.png b/GasGasGases2/graphics/icons/advanced-electronic-components.png new file mode 100644 index 0000000..dc7822d Binary files /dev/null and b/GasGasGases2/graphics/icons/advanced-electronic-components.png differ diff --git a/GasGasGases2/graphics/icons/argon.png b/GasGasGases2/graphics/icons/argon.png new file mode 100644 index 0000000..f53beee Binary files /dev/null and b/GasGasGases2/graphics/icons/argon.png differ diff --git a/GasGasGases2/graphics/icons/cryogenic-gas-plant.png b/GasGasGases2/graphics/icons/cryogenic-gas-plant.png new file mode 100644 index 0000000..133ac97 Binary files /dev/null and b/GasGasGases2/graphics/icons/cryogenic-gas-plant.png differ diff --git a/GasGasGases2/graphics/icons/helium.png b/GasGasGases2/graphics/icons/helium.png new file mode 100644 index 0000000..88105d6 Binary files /dev/null and b/GasGasGases2/graphics/icons/helium.png differ diff --git a/GasGasGases2/graphics/icons/krypton.png b/GasGasGases2/graphics/icons/krypton.png new file mode 100644 index 0000000..ad077fa Binary files /dev/null and b/GasGasGases2/graphics/icons/krypton.png differ diff --git a/GasGasGases2/graphics/icons/neon.png b/GasGasGases2/graphics/icons/neon.png new file mode 100644 index 0000000..a68119a Binary files /dev/null and b/GasGasGases2/graphics/icons/neon.png differ diff --git a/GasGasGases2/graphics/icons/radon.png b/GasGasGases2/graphics/icons/radon.png new file mode 100644 index 0000000..1c84378 Binary files /dev/null and b/GasGasGases2/graphics/icons/radon.png differ diff --git a/GasGasGases2/graphics/icons/satellite-body.png b/GasGasGases2/graphics/icons/satellite-body.png new file mode 100644 index 0000000..e679c4f Binary files /dev/null and b/GasGasGases2/graphics/icons/satellite-body.png differ diff --git a/GasGasGases2/graphics/icons/shock-absorber.png b/GasGasGases2/graphics/icons/shock-absorber.png new file mode 100644 index 0000000..b17a95f Binary files /dev/null and b/GasGasGases2/graphics/icons/shock-absorber.png differ diff --git a/GasGasGases2/graphics/icons/spring.png b/GasGasGases2/graphics/icons/spring.png new file mode 100644 index 0000000..db6fa84 Binary files /dev/null and b/GasGasGases2/graphics/icons/spring.png differ diff --git a/GasGasGases2/graphics/icons/turret-base.png b/GasGasGases2/graphics/icons/turret-base.png new file mode 100644 index 0000000..8abf650 Binary files /dev/null and b/GasGasGases2/graphics/icons/turret-base.png differ diff --git a/GasGasGases2/graphics/icons/turret-large-base.png b/GasGasGases2/graphics/icons/turret-large-base.png new file mode 100644 index 0000000..b33978d Binary files /dev/null and b/GasGasGases2/graphics/icons/turret-large-base.png differ diff --git a/GasGasGases2/graphics/icons/xenon.png b/GasGasGases2/graphics/icons/xenon.png new file mode 100644 index 0000000..97ee685 Binary files /dev/null and b/GasGasGases2/graphics/icons/xenon.png differ diff --git a/GasGasGases2/info.json b/GasGasGases2/info.json new file mode 100644 index 0000000..d37bd14 --- /dev/null +++ b/GasGasGases2/info.json @@ -0,0 +1,21 @@ +{ + "name": "GasGasGases2", + "version": "2.0.0", + "factorio_version": "2.0", + "title": "GasGasGases", + "author": "Timeken, cackling fiend", + "homepage": "https://discord.gg/ufvFUJtVwk", + "dependencies": [ + "base >= 2.0.0", + "? bzcarbon", + "? bzgas", + "? bzsilicon", + "? bztungsten", + "? Chromium2", + "? Indium2", + "? Tantalite2", + "? LasingAround-Updated", + "? Krastorio2" + ], + "description": "This mod is early in development and most if not all art is placeholder.\n\nThis mod is inspired by Brevven's BZ mods and adds the 6 noble gases plus uses for them." +} \ No newline at end of file diff --git a/GasGasGases2/locale/en/GasGasGases.cfg b/GasGasGases2/locale/en/GasGasGases.cfg new file mode 100644 index 0000000..d2d7994 --- /dev/null +++ b/GasGasGases2/locale/en/GasGasGases.cfg @@ -0,0 +1,34 @@ +[technology-name] +air-liquefaction=Air liquefaction + +[technology-description] + +[item-name] + +[fluid-name] +helium=Helium +neon=Neon +argon=Argon +krypton=Krypton +xenon=Xenon +radon=Radon + +[entity-name] +cryogenic-gas-plant=Cryogenic gas plant + +[mod-setting-name] + +[mod-setting-description] + +[recipe-name] +neon=Neon +helium=Helium +argon=Argon +krypton=Krypton +xenon=Xenon +radon=Radon +air-liquefaction=Air liquefaction +cryogenic-gas-plant=Cryogenic gas plant + +[recipe-description] + diff --git a/GasGasGases2/locale/en/IntermediatesForYou.cfg b/GasGasGases2/locale/en/IntermediatesForYou.cfg new file mode 100644 index 0000000..a5b814a --- /dev/null +++ b/GasGasGases2/locale/en/IntermediatesForYou.cfg @@ -0,0 +1,64 @@ +[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 + +[technology-description] + +[autoplace-control-names] + +[tool-name] +productivity-science-pack=Productivity science pack + +[item-name] +turret-base=Turret base +turret-large-base=Large turret base + +advanced-electronic-components=Advanced electronic components + +satellite-body=Satellite body + +spring=Spring +shock-absorber=Shock absorber + +aluminium-hydroxide=Aluminium hydroxide +sodium-hydroxide=Sodium hydroxide +sodium-aluminate=Sodium aluminate + +productivity-science-pack=Productivity science pack +[fluid-name] +hydrogen-peroxide=Hydrogen peroxide +nitrous-oxide=Nitrous oxide + +[entity-name] + +[mod-setting-name] + +[mod-setting-description] + +[recipe-name] +se-recycle-long-handed-inserter=Long handed inserter recycling +low-quality-advanced-circuit=Low quality advanced circuit +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 + +[recipe-description] +low-quality-advanced-circuit=When resources are scarce you use what you got. \ No newline at end of file diff --git a/GasGasGases2/prototypes/entities.lua b/GasGasGases2/prototypes/entities.lua new file mode 100644 index 0000000..8a5b80b --- /dev/null +++ b/GasGasGases2/prototypes/entities.lua @@ -0,0 +1,228 @@ +local hit_effects = require("__base__.prototypes.entity.hit-effects") +local sounds = require("__base__.prototypes.entity.sounds") + +data:extend({ + { + type = "assembling-machine", + name = "cryogenic-gas-plant", + icon = "__GasGasGases2__/graphics/icons/cryogenic-gas-plant.png", + icon_size = 64, + icon_mipmaps = 4, + flags = { "placeable-neutral", "player-creation" }, + minable = { mining_time = 0.2, result = "cryogenic-gas-plant" }, + max_health = 350, + corpse = "oil-refinery-remnants", + dying_explosion = "oil-refinery-explosion", + collision_box = { { -2.4, -2.4 }, { 2.4, 2.4 } }, + selection_box = { { -2.5, -2.5 }, { 2.5, 2.5 } }, + damaged_trigger_effect = hit_effects.entity(), + drawing_box = { { -2.5, -2.8 }, { 2.5, 2.5 } }, + module_slots = 3, + scale_entity_info_icon = true, + allowed_effects = { "consumption", "speed", "productivity", "pollution" }, + crafting_categories = { "cryonics" }, + crafting_speed = 1, + energy_source = { + type = "electric", + usage_priority = "secondary-input", + emissions_per_minute = { pollution = 6 } + }, + energy_usage = "420kW", + graphics_set = { + animation = make_4way_animation_from_spritesheet({ + layers = { + { + filename = "__GasGasGases2__/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant.png", + width = 386, + height = 430, + frame_count = 1, + shift = util.by_pixel(0, -7.5), + scale = 0.5 + }, + { + filename = + "__GasGasGases2__/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-shadow.png", + width = 674, + height = 426, + frame_count = 1, + shift = util.by_pixel(82.5, 26.5), + draw_as_shadow = true, + force_hr_shadow = true, + scale = 0.5 + } + } + }), + + working_visualisations = { + { + draw_as_light = true, + fadeout = true, + constant_speed = true, + north_position = util.by_pixel(34, -65), + east_position = util.by_pixel(-52, -61), + south_position = util.by_pixel(-59, -82), + west_position = util.by_pixel(57, -58), + animation = { + filename = "__GasGasGases2__/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-cold.png", + line_length = 10, + width = 40, + height = 81, + frame_count = 60, + animation_speed = 0.75, + scale = 0.5, + shift = util.by_pixel(0, -14.25) + }, + }, + { + fadeout = true, + draw_as_light = true, + north_animation = { + filename = "__GasGasGases2__/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-light.png", + width = 321, + height = 205, + blend_mode = "additive", + shift = util.by_pixel(-1, -50), + scale = 0.5, + }, + east_animation = { + filename = "__GasGasGases2__/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-light.png", + width = 321, + x = 321, + height = 205, + blend_mode = "additive", + shift = util.by_pixel(-1, -50), + scale = 0.5, + }, + south_animation = { + filename = "__GasGasGases2__/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-light.png", + width = 321, + x = 321 * 2, + height = 205, + blend_mode = "additive", + shift = util.by_pixel(-1, -50), + scale = 0.5, + }, + west_animation = { + filename = "__GasGasGases2__/graphics/entity/cryogenic-gas-plant/hr-cryogenic-gas-plant-light.png", + width = 321, + x = 321 * 3, + height = 205, + blend_mode = "additive", + shift = util.by_pixel(-1, -50), + scale = 0.5, + }, + } + }, + }, + vehicle_impact_sound = sounds.generic_impact, + open_sound = sounds.machine_open, + close_sound = sounds.machine_close, + working_sound = { + sound = { + filename = "__base__/sound/oil-refinery.ogg" + }, + --idle_sound = { filename = "__base__/sound/idle1.ogg", volume = 0.3 }, + fade_in_ticks = 4, + fade_out_ticks = 20 + }, + fluid_boxes = { + { + production_type = "output", + pipe_covers = pipecoverspictures(), + volume = 100, + pipe_connections = { + { + flow_direction = "output", + direction = defines.direction.south, + position = { -2, 2 } + } + } + }, + { + production_type = "output", + pipe_covers = pipecoverspictures(), + volume = 100, + pipe_connections = { + { + flow_direction = "output", + direction = defines.direction.south, + position = { 0, 2 } + } + } + }, + { + production_type = "output", + pipe_covers = pipecoverspictures(), + volume = 100, + pipe_connections = { + { + flow_direction = "output", + direction = defines.direction.south, + position = { 2, 2 } + } + } + }, + { + production_type = "output", + pipe_covers = pipecoverspictures(), + volume = 100, + pipe_connections = { + { + flow_direction = "output", + direction = defines.direction.north, + position = { -2, -2 } + } + } + }, + { + production_type = "output", + pipe_covers = pipecoverspictures(), + volume = 100, + pipe_connections = { + { + flow_direction = "output", + direction = defines.direction.north, + position = { 0, -2 } + } + } + }, + { + production_type = "output", + pipe_covers = pipecoverspictures(), + volume = 100, + pipe_connections = { + { + flow_direction = "output", + direction = defines.direction.north, + position = { 2, -2 } + } + } + } + }, + water_reflection = { + pictures = { + filename = "__GasGasGases2__/graphics/entity/cryogenic-gas-plant/cryogenic-gas-plant-reflection.png", + priority = "extra-high", + width = 40, + height = 48, + shift = util.by_pixel(5, 95), + variation_count = 4, + scale = 5 + }, + rotate = false, + orientation_to_variation = true + } + }, + { + type = "item", + name = "cryogenic-gas-plant", + icon = "__GasGasGases2__/graphics/icons/cryogenic-gas-plant.png", + icon_size = 64, + tint = { r = 1, g = 0, b = 0, a = 0.2 }, + icon_mipmaps = 4, + subgroup = "production-machine", + place_result = "cryogenic-gas-plant", + order = "c[cryogenic-gas-plant]", + stack_size = 10 + } +}) diff --git a/GasGasGases2/prototypes/recipes.lua b/GasGasGases2/prototypes/recipes.lua new file mode 100644 index 0000000..61ae51e --- /dev/null +++ b/GasGasGases2/prototypes/recipes.lua @@ -0,0 +1,333 @@ +local util = require("data-util") + +data:extend({ + { + type = "recipe-category", + name = "cryonics", + }, +}) + +data:extend({ + { + type = "fluid", + name = "helium", + 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 = "__GasGasGases2__/graphics/icons/helium.png", + icon_size = 64, icon_mipmaps = 4, + order = "n[helium]" + }, + { + type = "fluid", + name = "neon", + 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 = "__GasGasGases2__/graphics/icons/neon.png", + icon_size = 64, icon_mipmaps = 4, + order = "n[neon]" + }, + { + type = "fluid", + name = "argon", + 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 = "__GasGasGases2__/graphics/icons/argon.png", + icon_size = 64, icon_mipmaps = 4, + order = "n[argon]" + }, + { + type = "fluid", + name = "krypton", + 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 = "__GasGasGases2__/graphics/icons/krypton.png", + icon_size = 64, icon_mipmaps = 4, + order = "k[krypton]" + }, + { + type = "fluid", + name = "xenon", + 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 = "__GasGasGases2__/graphics/icons/xenon.png", + icon_size = 64, icon_mipmaps = 4, + order = "n[xenon]" + }, + { + type = "fluid", + name = "radon", + 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 = "__GasGasGases2__/graphics/icons/radon.png", + icon_size = 64, icon_mipmaps = 4, + order = "n[radon]" + }, +}) + + +if mods["Krastorio2"] then +data:extend({ + { + type = "recipe", + name = "helium", + category = "atmosphere-condensation", + icon = "__GasGasGases2__/graphics/icons/helium.png", + icon_size = 64, + energy_required = 25, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = {}, + results = { + { type = "fluid", name = "helium", amount = 30 }, + }, + crafting_machine_tint = { + primary = { r = 0.106, g = 0.000, b = 0.50, a = 0.250 }, + secondary = { r = 0.200, g = 0.000, b = 0.690, a = 0.127 }, + tertiary = { r = 0.210, g = 0.000, b = 0.75, a = 0.350 }, + quaternary = { r = 0.106, g = 0.000, b = 0.50, a = 0.900 }, + }, + subgroup = "fluid-recipes", + order = "n[helium]", + }, + { + type = "recipe", + name = "neon", + category = "atmosphere-condensation", + icon = "__GasGasGases2__/graphics/icons/neon.png", + icon_size = 64, + energy_required = 30, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = {}, + results = { + { type = "fluid", name = "neon", amount = 30 }, + }, + crafting_machine_tint = { + primary = { r = 0.106, g = 0.000, b = 0.50, a = 0.250 }, + secondary = { r = 0.200, g = 0.000, b = 0.690, a = 0.127 }, + tertiary = { r = 0.210, g = 0.000, b = 0.75, a = 0.350 }, + quaternary = { r = 0.106, g = 0.000, b = 0.50, a = 0.900 }, + }, + subgroup = "fluid-recipes", + order = "n[neon]", + }, + { + type = "recipe", + name = "argon", + category = "atmosphere-condensation", + icon = "__GasGasGases2__/graphics/icons/argon.png", + icon_size = 64, + energy_required = 40, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = {}, + results = { + { type = "fluid", name = "argon", amount = 30 }, + }, + crafting_machine_tint = { + primary = { r = 0.106, g = 0.000, b = 0.50, a = 0.250 }, + secondary = { r = 0.200, g = 0.000, b = 0.690, a = 0.127 }, + tertiary = { r = 0.210, g = 0.000, b = 0.75, a = 0.350 }, + quaternary = { r = 0.106, g = 0.000, b = 0.50, a = 0.900 }, + }, + subgroup = "fluid-recipes", + order = "n[argon]", + }, + { + type = "recipe", + name = "krypton", + category = "atmosphere-condensation", + icon = "__GasGasGases2__/graphics/icons/krypton.png", + icon_size = 64, + energy_required = 50, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = {}, + results = { + { type = "fluid", name = "krypton", amount = 30 }, + }, + crafting_machine_tint = { + primary = { r = 0.106, g = 0.000, b = 0.50, a = 0.250 }, + secondary = { r = 0.200, g = 0.000, b = 0.690, a = 0.127 }, + tertiary = { r = 0.210, g = 0.000, b = 0.75, a = 0.350 }, + quaternary = { r = 0.106, g = 0.000, b = 0.50, a = 0.900 }, + }, + subgroup = "fluid-recipes", + order = "k[krypton]", + }, + { + type = "recipe", + name = "xenon", + category = "atmosphere-condensation", + icon = "__GasGasGases2__/graphics/icons/xenon.png", + icon_size = 64, + energy_required = 60, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = {}, + results = { + { type = "fluid", name = "xenon", amount = 30 }, + }, + crafting_machine_tint = { + primary = { r = 0.106, g = 0.000, b = 0.50, a = 0.250 }, + secondary = { r = 0.200, g = 0.000, b = 0.690, a = 0.127 }, + tertiary = { r = 0.210, g = 0.000, b = 0.75, a = 0.350 }, + quaternary = { r = 0.106, g = 0.000, b = 0.50, a = 0.900 }, + }, + subgroup = "fluid-recipes", + order = "n[xenon]", + }, + { + type = "recipe", + name = "radon", + category = "atmosphere-condensation", + icon = "__GasGasGases2__/graphics/icons/radon.png", + icon_size = 64, + energy_required = 70, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = {}, + results = { + { type = "fluid", name = "radon", amount = 30 }, + }, + crafting_machine_tint = { + primary = { r = 0.106, g = 0.000, b = 0.50, a = 0.250 }, + secondary = { r = 0.200, g = 0.000, b = 0.690, a = 0.127 }, + tertiary = { r = 0.210, g = 0.000, b = 0.75, a = 0.350 }, + quaternary = { r = 0.106, g = 0.000, b = 0.50, a = 0.900 }, + }, + subgroup = "fluid-recipes", + order = "n[radon]", + } +}) +end + +data:extend({ + { + type = "recipe", + name = "air-liquefaction", + category = "cryonics", + icon = "__base__/graphics/icons/fluid/steam.png", + icon_size = 64, + energy_required = 60, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = {}, + results = { + { type = "fluid", name = "helium", amount = 500 }, + { type = "fluid", name = "neon", amount = 300 }, + { type = "fluid", name = "argon", amount = 100 }, + { type = "fluid", name = "krypton", amount = 50 }, + { type = "fluid", name = "xenon", amount = 30 }, + { type = "fluid", name = "radon", amount = 5 }, + }, + crafting_machine_tint = { + primary = { r = 0.106, g = 0.000, b = 0.50, a = 0.250 }, + secondary = { r = 0.200, g = 0.000, b = 0.690, a = 0.127 }, + tertiary = { r = 0.210, g = 0.000, b = 0.75, a = 0.350 }, + quaternary = { r = 0.106, g = 0.000, b = 0.50, a = 0.900 }, + }, + subgroup = "fluid-recipes", + order = "a[air-liquefaction]", + } +}) + +data:extend({ + { + type = "recipe", + name = "cryogenic-gas-plant", + energy_required = 8, + category = "crafting", + ingredients = + { + {type="item", name="steel-plate", amount=15}, + {type="item", name="engine-unit", amount=10}, + {type="item", name="concrete", amount=10}, + {type="item", name="electronic-circuit", amount=10}, + {type="item", name="pipe", amount=10} + }, + results = {{type="item", name="cryogenic-gas-plant", amount=1}}, + enabled = false + } +}) + +if mods["bzgas"] then + data:extend({ + { + type = "recipe", + name = "argon-extraction", + category = "chemistry", + icons = (mods["Krastorio2"] and + { + { icon = "__GasGasGases2__/graphics/icons/argon.png", icon_size = 64}, + { icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128, scale=0.2, shift= {-8, -8}}, + } or { + { icon = "__GasGasGases2__/graphics/icons/argon.png", icon_size = 64}, + }), + energy_required = 20, + enabled = false, + always_show_made_in = true, + always_show_products = true, + allow_productivity = true, + ingredients = {{ type = "fluid", name = "gas", amount = 30 }}, + results = { + { type = "fluid", name = "argon", amount = 10 }, + }, + crafting_machine_tint = { + primary = { r = 0.106, g = 0.000, b = 0.50, a = 0.250 }, + secondary = { r = 0.200, g = 0.000, b = 0.690, a = 0.127 }, + tertiary = { r = 0.210, g = 0.000, b = 0.75, a = 0.350 }, + quaternary = { r = 0.106, g = 0.000, b = 0.50, a = 0.900 }, + }, + subgroup = "fluid-recipes", + order = "n[argon]", + } + }) + util.add_unlock("basic-chemistry","argon-extraction") +end +if mods["Krastorio2"] then + util.add_unlock("kr-atmosphere-condensation","helium") + util.add_unlock("kr-atmosphere-condensation","neon") + util.add_unlock("kr-atmosphere-condensation","argon") + util.add_unlock("kr-atmosphere-condensation","krypton") + util.add_unlock("kr-atmosphere-condensation","xenon") + util.add_unlock("kr-atmosphere-condensation","radon") +end diff --git a/GasGasGases2/prototypes/se-recycling.lua b/GasGasGases2/prototypes/se-recycling.lua new file mode 100644 index 0000000..346168e --- /dev/null +++ b/GasGasGases2/prototypes/se-recycling.lua @@ -0,0 +1,47 @@ +local util = require("data-util") +if mods["space-exploration"] then +local se_recycle_long_handed_inserter_results = {{type="item", name="iron-stick", amount=1}, {type="item", name="inserter", amount=1, probability=0.75}} +if data.raw.item["solder"] then + table.insert(se_recycle_long_handed_inserter_results, {type="item", name="solder", amount=1}) +end +if data.raw.item["articulated-mechanism"] then + table.insert(se_recycle_long_handed_inserter_results, {type="item", name="articulated-mechanism", amount=1}) +end +data:extend({ + { + type = "recipe", + name = "se-recycle-long-handed-inserter", + icons = { + { + icon = "__space-exploration-graphics__/graphics/blank.png", + icon_size = 64 + }, + { + icon = "__base__/graphics/icons/inserter.png", + icon_size = 64, + scale = 0.33, + shift = {-8, 8} + }, + { + icon = "__base__/graphics/icons/long-handed-inserter.png", + icon_size = 64, + scale = 0.33, + shift = {8, -8} + }, + { + icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png", + icon_size = 64 + } + }, + category = "hard-recycling", + subgroup = "recycling", + main_product = "", + order = "l", + enabled = false, + energy_required = 3, + ingredients = {{type="item", name="long-handed-inserter", amount=1}}, + results = se_recycle_long_handed_inserter_results, + } +}) +util.add_unlock("se-recycling-facility", "se-recycle-long-handed-inserter") +end \ No newline at end of file diff --git a/GasGasGases2/prototypes/technology.lua b/GasGasGases2/prototypes/technology.lua new file mode 100644 index 0000000..f7e0f34 --- /dev/null +++ b/GasGasGases2/prototypes/technology.lua @@ -0,0 +1,37 @@ +local util = require("data-util") + +data:extend( +{ + { + type = "technology", + name = "air-liquefaction", + icons = { + { icon = "__base__/graphics/icons/fluid/steam.png", icon_size = 64} + }, + prerequisites = {"fluid-handling","engine"}, + effects = { + { + type = "unlock-recipe", + recipe = "air-liquefaction", + }, + { + type = "unlock-recipe", + recipe = "cryogenic-gas-plant", + }, + }, + unit = + { + count = 125, + ingredients = + { + { "automation-science-pack", 1 }, + { "logistic-science-pack", 1 } + }, + time = 30 + } + }, +}) +util.add_prerequisite("chemical-science-pack", "air-liquefaction") +if not mods["bzgas"] then + util.add_prerequisite("optics", "air-liquefaction") +end \ No newline at end of file diff --git a/GasGasGases2/recipe-final-fix.lua b/GasGasGases2/recipe-final-fix.lua new file mode 100644 index 0000000..f81c0ab --- /dev/null +++ b/GasGasGases2/recipe-final-fix.lua @@ -0,0 +1 @@ +local util = require("data-util") \ No newline at end of file diff --git a/GasGasGases2/recipe-modify.lua b/GasGasGases2/recipe-modify.lua new file mode 100644 index 0000000..2b6c15c --- /dev/null +++ b/GasGasGases2/recipe-modify.lua @@ -0,0 +1,70 @@ +local util = require("data-util") + +-- Main vanilla changes +util.set_category("fusion-reactor-equipment","crafting-with-fluid") +util.add_ingredient("fusion-reactor-equipment", "radon", 100) + +util.set_category("advanced-circuit","crafting-with-fluid") +util.add_ingredient("advanced-circuit", "argon", 5) + +util.set_category("small-lamp","crafting-with-fluid") +util.add_ingredient("small-lamp", "argon", 10) + +util.set_category("productivity-module-3","crafting-with-fluid") +util.add_ingredient("productivity-module-3", "krypton", 30) + +util.set_category("speed-module-3","crafting-with-fluid") +util.add_ingredient("speed-module-3", "xenon", 30) + +util.set_category("effectivity-module-3","crafting-with-fluid") +util.add_ingredient("effectivity-module-3", "radon", 30) + +util.set_category("uranium-fuel-cell", "chemistry") +data.raw.recipe["uranium-fuel-cell"].results = {{type="item", name="uranium-fuel-cell", amount=1},{type = "fluid", name = "krypton", amount = 30 }} +data.raw.recipe["uranium-fuel-cell"].main_product = "uranium-fuel-cell" + +-- Mod changes +if mods["Tantalite2"] then + util.set_category("electron-gun","crafting-with-fluid") + util.add_ingredient("electron-gun", "neon", 10) +end + +if mods["Chromium2"] then + util.set_category("vehicle-frame","crafting-with-fluid") + util.add_ingredient("vehicle-frame", "argon", 10) + + util.remove_ingredient("advanced-electric-motor", "lubricant") + util.remove_ingredient("air-bearing", "lubricant") + util.add_ingredient("advanced-electric-motor", "xenon", 40) + util.add_ingredient("air-bearing", "xenon", 5) +end + +if mods["Indium2"] then + util.set_category("indium-solar-cell","crafting-with-fluid") + util.add_ingredient("indium-solar-cell", "argon", 10) + + util.add_prerequisite("air-liquefaction", "indium-processing") + util.add_ingredient("cryogenic-gas-plant", "cryogenic-seal", 10) +end + +if mods["bzcarbon"] then + util.add_ingredient("fullerenes", "argon", 10) +end + +if mods["bzsilicon"] then + util.set_category("gyro","crafting-with-fluid") + util.add_ingredient("gyro", "xenon", 10) + + util.set_category("solar-cell","crafting-with-fluid") + util.add_ingredient("solar-cell", "argon", 10) +end + +if mods["bztungsten"] then + util.set_category("rocket-engine-nozzle","crafting-with-fluid") + util.add_ingredient("rocket-engine-nozzle", "argon", 10) +end + +if mods["LasingAround-Updated"] then + util.set_category("helium-laser", "chemistry") + util.add_ingredient("helium-laser", "neon", 5) +end \ No newline at end of file diff --git a/GasGasGases2/thumbnail.png b/GasGasGases2/thumbnail.png new file mode 100644 index 0000000..eae8375 Binary files /dev/null and b/GasGasGases2/thumbnail.png differ diff --git a/README.md b/README.md index 885a9e5..70ed9cd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# GasGasGases2 +# GasGasGases +Updated for Factorio 2.0. + +Original mod: https://mods.factorio.com/mod/GasGasGases \ No newline at end of file