From c2b65301fb7a17ec3150da9d881c9bada1e8e6d7 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Sat, 4 Oct 2025 21:42:12 +0200 Subject: [PATCH] Update to 2.0 --- .editorconfig | 3 + .gitignore | 1 + README.md | 1 + compatibility/248k.lua | 6 +- control.lua | 4 +- data-final-fixes.lua | 9 +- data-util.lua | 225 +++++--------------- gas-boiler/data.lua | 155 +++++--------- gas-boiler/factsheet.lua | 308 +++++++++------------------- gas-sim.lua | 4 +- info.json | 26 +-- matter.lua | 11 +- modules.lua | 10 +- prototypes/bakelite.lua | 6 +- prototypes/basic-chemical-plant.lua | 40 ++-- prototypes/formaldehyde.lua | 6 +- prototypes/gas-extractor.lua | 95 ++++----- prototypes/gas.lua | 55 ++--- prototypes/k2-recipe.lua | 18 +- prototypes/phenol.lua | 29 +-- prototypes/se-recipe.lua | 2 +- 21 files changed, 349 insertions(+), 665 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitignore diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..bbf3e21 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,3 @@ +[*] +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/README.md b/README.md index cf5db8d..351e764 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ See changelog.txt ## Thanks to - [Sakuro](https://github.com/sakuro) (expand options, icon tweaks) - [Benjah-bmm27](https://commons.wikimedia.org/wiki/User:Benjah-bmm27) ([Formaldehyde icon](https://commons.wikimedia.org/wiki/File:Formaldehyde-3D-vdW.png), public domain) +- [cackling fiend](https://mods.factorio.com/user/cackling.fiend) (Update to 2.0) ### Compatibility - [nihilistzsche](https://github.com/nihilistzsche) diff --git a/compatibility/248k.lua b/compatibility/248k.lua index bdf37ea..0bacfec 100644 --- a/compatibility/248k.lua +++ b/compatibility/248k.lua @@ -1,17 +1,17 @@ local util = require("data-util"); -if mods["248k"] then +if mods["248k-Redux"] then data:extend({ { type = "recipe", name = "acid-gas-breakdown", icons = { {icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128}, - {icon = "__248k__/ressources/fluids/fi_acid_gas.png", icon_size = 64, scale=0.25, shift={-8,-8}}, + {icon = "__248k-Redux-graphics__/ressources/fluids/fi_acid_gas.png", icon_size = 64, scale=0.25, shift={-8,-8}}, }, category = "chemistry", subgroup = "fi_item_subgroup_f", - enabled = "false", + enabled = false, energy_required = 3, ingredients = { {type="fluid", name="fi_acid_gas", amount=10}, diff --git a/control.lua b/control.lua index 107b50e..5d8088c 100644 --- a/control.lua +++ b/control.lua @@ -35,7 +35,7 @@ end script.on_event(defines.events.on_console_chat, on_console_chat) function on_init() - if global.starting_spawn then return end + if storage.starting_spawn then return end if settings.global["bzgas-force-spawn"].value then local gas = game.surfaces["nauvis"].find_entities_filtered({area = {{-100, -100}, {100, 100}}, name="gas"}) if #gas == 0 then @@ -45,7 +45,7 @@ function on_init() end end end - global.starting_spawn = true + storage.starting_spawn = true end script.on_init(on_init) diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 4806fbd..906099d 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -1,6 +1,5 @@ require("stacking") require("modules") --- require("tin-recipe-final-5d") require("compatibility/ir2") local util = require("data-util"); @@ -9,11 +8,11 @@ local util = require("data-util"); util.set_product_amount("se-core-fragment-omni", "gas", 24) -- Fix basic chemical plant fuels for K2 -if mods.Krastorio2 and -data.raw["assembling-machine"]["basic-chemical-plant"] and -data.raw["assembling-machine"]["basic-chemical-plant"].energy_source and +if mods.Krastorio2 and +data.raw["assembling-machine"]["basic-chemical-plant"] and +data.raw["assembling-machine"]["basic-chemical-plant"].energy_source and data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories then - table.insert(data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories , "vehicle-fuel") + table.insert(data.raw["assembling-machine"]["basic-chemical-plant"].energy_source.fuel_categories , "kr-vehicle-fuel") end -- Vanilla burner phase tweaks -- green circuits after electronics diff --git a/data-util.lua b/data-util.lua index 0c58ecd..b8cb028 100644 --- a/data-util.lua +++ b/data-util.lua @@ -64,17 +64,7 @@ function util.fe_plus(sub) end end -function util.get_stack_size(default) - if mods.Krastorio2 then - local size = get_setting("kr-stack-size") - if size and tonumber(size) then - return tonumber(size) - end - end - return default -end - -function util.k2assets() +function util.k2assets() if mods["Krastorio2Assets"] then return "__Krastorio2Assets__" end @@ -111,8 +101,8 @@ function util.se_landfill(params) category = "hard-recycling", order = "z-b-"..params.ore, subgroup = "terrain", - result = "landfill", - ingredients = {{params.ore, 50}}, + results = {{type="item", name="landfill", amount=1}}, + ingredients = {{type="item", name=params.ore, amount=50}}, } }) util.add_unlock("se-recycling-facility", lname) @@ -123,7 +113,7 @@ end -- k2 matter -- params: {k2matter}, k2baseicon , {icon} function util.k2matter(params) - local matter = require("__Krastorio2__/lib/public/data-stages/matter-util") + local matter = require("__Krastorio2__/prototypes/libraries/matter") if mods["space-exploration"] then params.k2matter.need_stabilizer = true end @@ -169,15 +159,15 @@ function util.k2matter(params) { {"production-science-pack", 1}, {"utility-science-pack", 1}, - {"matter-tech-card", 1} + {"kr-matter-tech-card", 1} }, time = 45, }, - -- (ignore for now) localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}}, + localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}}, }, }) end - matter.createMatterRecipe(params.k2matter) + matter.make_recipes(params.k2matter) end @@ -211,16 +201,16 @@ function util.se_matter(params) energy_required = params.energy_required, enabled = false, ingredients = { - {sedata, 1}, + {type="item", name=sedata, amount=1}, {type="fluid", name="se-particle-stream", amount=50}, {type="fluid", name="se-space-coolant-supercooled", amount=25}, }, results = { - {params.ore, params.quant_out}, - {"se-contaminated-scrap", 1}, - {type=item, name=sedata, amount=1, probability=.99}, - {type=item, name=sejunk, amount=1, probability=.01}, - {type="fluid", name="se-space-coolant-hot", amount=25, catalyst_amount=25}, + {type="item", name=params.ore, amount=params.quant_out}, + {type="item", name="se-contaminated-scrap", amount=1}, + {type="item", name=sedata, amount=1, probability=.99}, + {type="item", name=sejunk, amount=1, probability=.01}, + {type="fluid", name="se-space-coolant-hot", amount=25, ignored_by_productivity=25}, } } }) @@ -250,14 +240,14 @@ function util.se_matter(params) energy_required = 30, enabled = false, ingredients = { - {"se-kr-matter-liberation-data", 1}, - {params.ore, params.quant_in}, + {type="item", name="se-kr-matter-liberation-data", amount=1}, + {type="item", name=params.ore, amount=params.quant_in}, {type="fluid", name="se-particle-stream", amount=50}, }, results = { - {type=item, name="se-kr-matter-liberation-data", amount=1, probability=.99}, - {type=item, name=sejunk, amount=1, probability=.01}, - {type="fluid", name="se-particle-stream", amount=params.stream_out, catalyst_amount=50}, + {type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99}, + {type="item", name=sejunk, amount=1, probability=.01}, + {type="fluid", name="se-particle-stream", amount=params.stream_out, ignored_by_productivity=50}, } } }) @@ -284,7 +274,7 @@ function util.se_matter(params) {"se-astronomic-science-pack-4", 1}, {"se-energy-science-pack-4", 1}, {"se-material-science-pack-4", 1}, - {"matter-tech-card", 1}, + {"kr-matter-tech-card", 1}, {"se-deep-space-science-pack-1", 1}, } @@ -298,18 +288,6 @@ function util.se_matter(params) end end --- Get the normal prototype for a recipe -- either .normal or the recipe itself -function util.get_normal(recipe_name) - if data.raw.recipe[recipe_name] then - recipe = data.raw.recipe[recipe_name] - if recipe.normal and recipe.normal.ingredients then - return recipe.normal - elseif recipe.ingredients then - return recipe - end - end -end - -- Set/override a technology's prerequisites function util.set_prerequisite(technology_name, prerequisites) local technology = data.raw.technology[technology_name] @@ -376,7 +354,7 @@ function util.add_unlock(technology_name, recipe) end -- Check if a tech unlocks a recipe -function util.check_unlock(technology_name, recipe_name) +function util.check_unlock(technology_name, recipe) local technology = data.raw.technology[technology_name] if technology and technology.effects then for i, effect in pairs(technology.effects) do @@ -421,17 +399,13 @@ end function util.set_enabled(recipe_name, enabled) if data.raw.recipe[recipe_name] then - if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.enabled = enabled end - if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.enabled = enabled end - if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].enabled = enabled end + data.raw.recipe[recipe_name].enabled = enabled end end function util.set_hidden(recipe_name) if data.raw.recipe[recipe_name] then - if data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].normal.hidden = true end - if data.raw.recipe[recipe_name].expensive then data.raw.recipe[recipe_name].expensive.hidden = true end - if not data.raw.recipe[recipe_name].normal then data.raw.recipe[recipe_name].hidden = true end + data.raw.recipe[recipe_name].hidden = true end end @@ -441,8 +415,6 @@ function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity, option if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then me.add_modified(recipe_name) add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) - add_or_add_to_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity) - add_or_add_to_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity) end end @@ -465,8 +437,6 @@ function util.add_ingredient(recipe_name, ingredient, quantity, options) if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then me.add_modified(recipe_name) add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity, is_fluid) - add_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity, is_fluid) - add_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity, is_fluid) end end @@ -480,7 +450,7 @@ function add_ingredient(recipe, ingredient, quantity, is_fluid) if is_fluid then table.insert(recipe.ingredients, {type="fluid", name=ingredient, amount=quantity}) else - table.insert(recipe.ingredients, {ingredient, quantity}) + table.insert(recipe.ingredients, {type="item", name=ingredient, amount=quantity}) end end end @@ -491,8 +461,6 @@ function util.add_ingredient_raw(recipe_name, ingredient, options) if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then me.add_modified(recipe_name) add_ingredient_raw(data.raw.recipe[recipe_name], ingredient) - add_ingredient_raw(data.raw.recipe[recipe_name].normal, ingredient) - add_ingredient_raw(data.raw.recipe[recipe_name].expensive, ingredient) end end @@ -516,8 +484,6 @@ function util.set_ingredient(recipe_name, ingredient, quantity, options) if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then me.add_modified(recipe_name) set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity) - set_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity) - set_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity) end end @@ -541,29 +507,18 @@ end -- Only works for recipes with multiple products function util.add_product(recipe_name, product, options) if not should_force(options) and bypass(recipe_name) then return end - if data.raw.recipe[recipe_name] and - (data.raw.item[product[1]] or data.raw.item[product.name] or - data.raw.fluid[product[1]] or data.raw.fluid[product.name] - ) then + if data.raw.recipe[recipe_name] and + (data.raw.item[product.name] or data.raw.fluid[product.name]) then add_product(data.raw.recipe[recipe_name], product) - add_product(data.raw.recipe[recipe_name].normal, product) - add_product(data.raw.recipe[recipe_name].expensive, product) end end function add_product(recipe, product) if recipe ~= nil then - if (product[1] and data.raw.item[product[1]]) or - (product.name and data.raw[product.type][product.name]) then - if not recipe.normal then - if recipe.results == nil then - recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}} - end - recipe.result = nil - recipe.result_count = nil - table.insert(recipe.results, product) + if recipe.results == nil then + recipe.results = {} end - end + table.insert(recipe.results, product) end end @@ -571,18 +526,13 @@ end function util.get_ingredient_amount(recipe_name, ingredient_name) local recipe = data.raw.recipe[recipe_name] if recipe then - if recipe.normal and recipe.normal.ingredients then - for i, ingredient in pairs(recipe.normal.ingredients) do - if ingredient[1] == ingredient_name then return ingredient[2] end - if ingredient.name == ingredient_name then return ingredient.amount end - end - elseif recipe.ingredients then + if recipe.ingredients then for i, ingredient in pairs(recipe.ingredients) do if ingredient[1] == ingredient_name then return ingredient[2] end if ingredient.name == ingredient_name then return ingredient.amount end end end - return 0 + return 1 end return 0 end @@ -592,14 +542,7 @@ function util.get_amount(recipe_name, product) if not product then product = recipe_name end local recipe = data.raw.recipe[recipe_name] if recipe then - if recipe.normal and recipe.normal.results then - for i, result in pairs(recipe.normal.results) do - if result[1] == product then return result[2] end - if result.name == product then return result.amount end - end - elseif recipe.normal and recipe.normal.result_count then - return recipe.normal.result_count - elseif recipe.results then + if recipe.results then for i, result in pairs(recipe.results) do if result[1] == product then return result[2] end if result.name == product then return result.amount end @@ -617,9 +560,7 @@ function util.get_result_count(recipe_name, product) if not product then product = recipe_name end local recipe = data.raw.recipe[recipe_name] if recipe then - if recipe.normal and recipe.normal.results then - return #(recipe.normal.results) - elseif recipe.results then + if recipe.results then return #(recipe.results) end return 1 @@ -634,8 +575,6 @@ function util.replace_ingredient(recipe_name, old, new, amount, multiply, option if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then me.add_modified(recipe_name) replace_ingredient(data.raw.recipe[recipe_name], old, new, amount, multiply) - replace_ingredient(data.raw.recipe[recipe_name].normal, old, new, amount, multiply) - replace_ingredient(data.raw.recipe[recipe_name].expensive, old, new, amount, multiply) end end @@ -677,8 +616,6 @@ function util.remove_ingredient(recipe_name, old, options) if data.raw.recipe[recipe_name] then me.add_modified(recipe_name) remove_ingredient(data.raw.recipe[recipe_name], old) - remove_ingredient(data.raw.recipe[recipe_name].normal, old) - remove_ingredient(data.raw.recipe[recipe_name].expensive, old) end end @@ -704,28 +641,23 @@ function util.replace_some_product(recipe_name, old, old_amount, new, new_amount if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then me.add_modified(recipe_name) replace_some_product(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid) - replace_some_product(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount, is_fluid) - replace_some_product(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount, is_fluid) end end -function replace_some_product(recipe, old, old_amount, new, new_amount) +function replace_some_product(recipe, old, old_amount, new, new_amount, is_fluid) if recipe ~= nil then if recipe.result == new then return end if recipe.results then for i, existing in pairs(recipe.results) do - if existing[1] == new or existing.name == new then + if existing.name == new then return end end end - add_product(recipe, {new, new_amount}) + add_product(recipe, {type=is_fluid and "fluid" or "item", name=new, amount=new_amount}) for i, product in pairs(recipe.results) do if product.name == old then product.amount = math.max(1, product.amount - old_amount) - end - if product[1] == old then - product[2] = math.max(1, product[2] - old_amount) end end end @@ -738,8 +670,6 @@ function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amo if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then me.add_modified(recipe_name) replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount, is_fluid) - replace_some_ingredient(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount, is_fluid) - replace_some_ingredient(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount, is_fluid) end end @@ -768,8 +698,6 @@ function util.set_product_amount(recipe_name, product, amount, options) me.add_modified(recipe_name) if data.raw.recipe[recipe_name] then set_product_amount(data.raw.recipe[recipe_name], product, amount) - set_product_amount(data.raw.recipe[recipe_name].normal, product, amount) - set_product_amount(data.raw.recipe[recipe_name].expensive, product, amount) end end @@ -808,8 +736,6 @@ function util.multiply_recipe(recipe_name, multiple, options) me.add_modified(recipe_name) if data.raw.recipe[recipe_name] then multiply_recipe(data.raw.recipe[recipe_name], multiple) - multiply_recipe(data.raw.recipe[recipe_name].normal, multiple) - multiply_recipe(data.raw.recipe[recipe_name].expensive, multiple) end end @@ -817,8 +743,6 @@ function multiply_recipe(recipe, multiple) if recipe then if recipe.energy_required then recipe.energy_required = recipe.energy_required * multiple - else - recipe.energy_required = 0.5 * multiple -- 0.5 is factorio default end if recipe.result_count then recipe.result_count = recipe.result_count * multiple @@ -833,8 +757,8 @@ function multiply_recipe(recipe, multiple) result.amount_min = result.amount_min * multiple result.amount_max = result.amount_max * multiple end - if result.catalyst_amount then - result.catalyst_amount = result.catalyst_amount * multiple + if result.ignored_by_productivity then + result.ignored_by_productivity = result.ignored_by_productivity * multiple end end if result[1] then @@ -861,9 +785,8 @@ end -- Returns true if a recipe has an ingredient function util.has_ingredient(recipe_name, ingredient) - return data.raw.recipe[recipe_name] and ( - has_ingredient(data.raw.recipe[recipe_name], ingredient) or - has_ingredient(data.raw.recipe[recipe_name].normal, ingredient)) + return data.raw.recipe[recipe_name] and + has_ingredient(data.raw.recipe[recipe_name], ingredient) end function has_ingredient(recipe, ingredient) @@ -883,8 +806,6 @@ function util.remove_product(recipe_name, old, options) me.add_modified(recipe_name) if data.raw.recipe[recipe_name] then remove_product(data.raw.recipe[recipe_name], old) - remove_product(data.raw.recipe[recipe_name].normal, old) - remove_product(data.raw.recipe[recipe_name].expensive, old) end end @@ -907,8 +828,6 @@ function util.set_main_product(recipe_name, product, options) if not should_force(options) and bypass(recipe_name) then return end if data.raw.recipe[recipe_name] then set_main_product(data.raw.recipe[recipe_name], product) - set_main_product(data.raw.recipe[recipe_name].normal, product) - set_main_product(data.raw.recipe[recipe_name].expensive, product) end end @@ -922,13 +841,11 @@ end function util.replace_product(recipe_name, old, new, options) if not should_force(options) and bypass(recipe_name) then return end if data.raw.recipe[recipe_name] then - replace_product(data.raw.recipe[recipe_name], old, new, options) - replace_product(data.raw.recipe[recipe_name].normal, old, new, options) - replace_product(data.raw.recipe[recipe_name].expensive, old, new, options) + replace_product(data.raw.recipe[recipe_name], old, new) end end -function replace_product(recipe, old, new, options) +function replace_product(recipe, old, new) if recipe then if recipe.main_product == old then recipe.main_product = new @@ -968,8 +885,6 @@ function util.set_recipe_time(recipe_name, time, options) me.add_modified(recipe_name) if data.raw.recipe[recipe_name] then set_recipe_time(data.raw.recipe[recipe_name], time) - set_recipe_time(data.raw.recipe[recipe_name].normal, time) - set_recipe_time(data.raw.recipe[recipe_name].expensive, time) end end @@ -987,8 +902,6 @@ function util.multiply_time(recipe_name, factor, options) me.add_modified(recipe_name) if data.raw.recipe[recipe_name] then multiply_time(data.raw.recipe[recipe_name], factor) - multiply_time(data.raw.recipe[recipe_name].normal, factor) - multiply_time(data.raw.recipe[recipe_name].expensive, factor) end end @@ -1006,8 +919,6 @@ function util.add_time(recipe_name, amount, options) me.add_modified(recipe_name) if data.raw.recipe[recipe_name] then add_time(data.raw.recipe[recipe_name], amount) - add_time(data.raw.recipe[recipe_name].normal, amount) - add_time(data.raw.recipe[recipe_name].expensive, amount) end end @@ -1031,7 +942,7 @@ end -- Set recipe subgroup function util.set_subgroup(recipe_name, subgroup, options) if not should_force(options) and bypass(recipe_name) then return end - if data.raw.recipe[recipe_name] and data.raw["item-subgroup"][subgroup] then + if data.raw.recipe[recipe_name] then me.add_modified(recipe_name) data.raw.recipe[recipe_name].subgroup = subgroup end @@ -1050,34 +961,16 @@ function util.add_icon(recipe_name, icon, options) if data.raw.recipe[recipe_name] then me.add_modified(recipe_name) if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then - if data.raw.recipe[recipe_name].icon then - data.raw.recipe[recipe_name].icons = {{ - icon=data.raw.recipe[recipe_name].icon, - icon_size=data.raw.recipe[recipe_name].icon_size, - icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps, - }} - elseif data.raw.item[data.raw.recipe[recipe_name].main_product] then - data.raw.recipe[recipe_name].icons = {{ - icon=data.raw.item[data.raw.recipe[recipe_name].main_product].icon, - icon_size=data.raw.item[data.raw.recipe[recipe_name].main_product].icon_size, - icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].main_product].icon_mipmaps, - }} - elseif data.raw.item[data.raw.recipe[recipe_name].result] then - data.raw.recipe[recipe_name].icons = {{ - icon=data.raw.item[data.raw.recipe[recipe_name].result].icon, - icon_size=data.raw.item[data.raw.recipe[recipe_name].result].icon_size, - icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].result].icon_mipmaps, - }} - elseif data.raw.recipe[recipe_name].normal and - data.raw.item[data.raw.recipe[recipe_name].normal.result] then - data.raw.recipe[recipe_name].icons = {{ - icon=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon, - icon_size=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_size, - icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_mipmaps, - }} - end - data.raw.recipe[recipe_name].icon = nil - data.raw.recipe[recipe_name].icon_size = nil + data.raw.recipe[recipe_name].icons = {} + if data.raw.recipe[recipe_name].icon then + data.raw.recipe[recipe_name].icons = {{ + icon=data.raw.recipe[recipe_name].icon, + icon_size=data.raw.recipe[recipe_name].icon_size, + icon_mipmaps=data.raw.recipe[recipe_name].icon_mipmaps, + }} + data.raw.recipe[recipe_name].icon = nil + data.raw.recipe[recipe_name].icon_size = nil + end end table.insert(data.raw.recipe[recipe_name].icons, icon) end @@ -1137,8 +1030,6 @@ function util.add_to_ingredient(recipe, ingredient, amount, options) if not should_force(options) and bypass(recipe_name) then return end if data.raw.recipe[recipe] then add_to_ingredient(data.raw.recipe[recipe], ingredient, amount) - add_to_ingredient(data.raw.recipe[recipe].normal, ingredient, amount) - add_to_ingredient(data.raw.recipe[recipe].expensive, ingredient, amount) end end @@ -1161,8 +1052,6 @@ function util.add_to_product(recipe_name, product, amount, options) if not should_force(options) and bypass(recipe_name) then return end if data.raw.recipe[recipe_name] then add_to_product(data.raw.recipe[recipe_name], product, amount) - add_to_product(data.raw.recipe[recipe_name].normal, product, amount) - add_to_product(data.raw.recipe[recipe_name].expensive, product, amount) end end @@ -1285,10 +1174,8 @@ function remove_prior_unlocks(tech, recipe) util.remove_recipe_effect(tech, recipe) if technology.prerequisites then for i, prerequisite in pairs(technology.prerequisites) do - if string.sub(prerequisite, 1, 3) ~= 'ei_' then - -- log("BZZZ removing prior unlocks for " .. recipe .. " from " .. tech ..", checking " .. prerequisite) -- Handy Debug :| - remove_prior_unlocks(prerequisite, recipe) - end + -- log("BZZZ removing prior unlocks for " .. tech ..", checking " .. prerequisite) -- Handy Debug :| + remove_prior_unlocks(prerequisite, recipe) end end end @@ -1330,9 +1217,7 @@ function replace_ingredients_prior_to(tech, old, new, multiplier) if technology.prerequisites then for i, prerequisite in pairs(technology.prerequisites) do -- log("BZZZ checking " .. prerequisite) -- Handy Debug :| - if string.sub(prerequisite, 1, 3) ~= 'ei_' then - replace_ingredients_prior_to(prerequisite, old, new, multiplier) - end + replace_ingredients_prior_to(prerequisite, old, new, multiplier) end end end diff --git a/gas-boiler/data.lua b/gas-boiler/data.lua index 2018938..f328f6e 100644 --- a/gas-boiler/data.lua +++ b/gas-boiler/data.lua @@ -15,82 +15,48 @@ gf_boiler_entity.fast_replaceable_group = "boiler" gf_boiler_entity.energy_source = { type = "fluid", fluid_box = { - base_area = 1, - height = 1, - base_level = -1, + volume = 100, pipe_covers = pipecoverspictures(), pipe_picture = { north = { - filename = gd.."/graphics/entity/" - .."assembling-machine-1-pipe-N.png", - priority = "extra-high", - width = 35, - height = 18, - shift = util.by_pixel(2.5, 14), - hr_version = { - filename = gd.."/graphics/entity/" - .."hr-assembling-machine-1-pipe-N.png", - priority = "extra-high", - width = 71, - height = 38, - shift = util.by_pixel(2.25, 13.5), - scale = 0.5 - } + filename = gd.."/graphics/entity/" + .."hr-assembling-machine-1-pipe-N.png", + priority = "extra-high", + width = 71, + height = 38, + shift = util.by_pixel(2.25, 13.5), + scale = 0.5 }, east = { - filename = gd.."/graphics/entity/" - .."assembling-machine-1-pipe-E.png", - priority = "extra-high", - width = 20, - height = 38, - shift = util.by_pixel(-25, 1), - hr_version = { - filename = gd.."/graphics/entity/" - .."hr-assembling-machine-1-pipe-E.png", - priority = "extra-high", - width = 42, - height = 76, - shift = util.by_pixel(-24.5, 1), - scale = 0.5 - } + filename = gd.."/graphics/entity/" + .."hr-assembling-machine-1-pipe-E.png", + priority = "extra-high", + width = 42, + height = 76, + shift = util.by_pixel(-24.5, 1), + scale = 0.5 }, south = { - filename = gd.."/graphics/entity/" - .."assembling-machine-1-pipe-S.png", - priority = "extra-high", - width = 44, - height = 31, - shift = util.by_pixel(0, -31.5), - hr_version = { - filename = gd.."/graphics/entity/" - .."hr-assembling-machine-1-pipe-S.png", - priority = "extra-high", - width = 88, - height = 61, - shift = util.by_pixel(0, -31.25), - scale = 0.5 - } + filename = gd.."/graphics/entity/" + .."hr-assembling-machine-1-pipe-S.png", + priority = "extra-high", + width = 88, + height = 61, + shift = util.by_pixel(0, -31.25), + scale = 0.5 }, west = { - filename = gd.."/graphics/entity/" - .."assembling-machine-1-pipe-W.png", - priority = "extra-high", - width = 19, - height = 37, - shift = util.by_pixel(25.5, 1.5), - hr_version = { - filename = gd.."/graphics/entity/" - .."hr-assembling-machine-1-pipe-W.png", - priority = "extra-high", - width = 39, - height = 73, - shift = util.by_pixel(25.75, 1.25), - scale = 0.5 - } + filename = gd.."/graphics/entity/" + .."hr-assembling-machine-1-pipe-W.png", + priority = "extra-high", + width = 39, + height = 73, + shift = util.by_pixel(25.75, 1.25), + scale = 0.5 } }, pipe_connections = { - {type = "input", position = {0, 1.5}}, + {direction = defines.direction.south, flow_direction = "input", position = {0, 0.5}}, }, production_type = "input", secondary_draw_orders = { @@ -102,7 +68,7 @@ gf_boiler_entity.energy_source = { }, burns_fluid = true, scale_fluid_usage = true, - emissions_per_minute = 30, + emissions_per_minute = { pollution = 30 }, smoke = {{ name = "smoke", north_position = util.by_pixel(-38, -47.5), @@ -121,43 +87,34 @@ gf_boiler_entity.energy_source = { } gf_boiler_entity.fire_flicker_enabled = false gf_boiler_entity.fire_glow_flicker_enabled = false -gf_boiler_entity.fire = {} -gf_boiler_entity.fire_glow.north.filename = - gd.."/graphics/entity/".. - "gas-boiler-N-light.png" -gf_boiler_entity.fire_glow.south.filename = - gd.."/graphics/entity/".. - "gas-boiler-S-light.png" -gf_boiler_entity.fire_glow.east.filename = - gd.."/graphics/entity/".. - "gas-boiler-E-light.png" -gf_boiler_entity.fire_glow.west.filename = - gd.."/graphics/entity/".. - "gas-boiler-W-light.png" -gf_boiler_entity.fire_glow.north.hr_version.filename = +gf_boiler_entity.pictures.north.fire = nil +gf_boiler_entity.pictures.south.fire = nil +gf_boiler_entity.pictures.east.fire = nil +gf_boiler_entity.pictures.west.fire = nil +gf_boiler_entity.pictures.north.fire_glow.filename = gd.."/graphics/entity/".. "hr-gas-boiler-N-light.png" -gf_boiler_entity.fire_glow.south.hr_version.filename = +gf_boiler_entity.pictures.south.fire_glow.filename = gd.."/graphics/entity/".. "hr-gas-boiler-S-light.png" -gf_boiler_entity.fire_glow.east.hr_version.filename = +gf_boiler_entity.pictures.east.fire_glow.filename = gd.."/graphics/entity/".. "hr-gas-boiler-E-light.png" -gf_boiler_entity.fire_glow.west.hr_version.filename = +gf_boiler_entity.pictures.west.fire_glow.filename = gd.."/graphics/entity/".. "hr-gas-boiler-W-light.png" -gf_boiler_entity.fire_glow.north.apply_runtime_tint = true -gf_boiler_entity.fire_glow.south.apply_runtime_tint = true -gf_boiler_entity.fire_glow.east.apply_runtime_tint = true -gf_boiler_entity.fire_glow.west.apply_runtime_tint = true -gf_boiler_entity.fire_glow.north.tint={r=1,g=0.6,b=0.6,a=0.4} -gf_boiler_entity.fire_glow.south.tint={r=1,g=0.6,b=0.6,a=0.4} -gf_boiler_entity.fire_glow.east.tint={r=1,g=0.6,b=0.6,a=0.4} -gf_boiler_entity.fire_glow.west.tint={r=1,g=0.6,b=0.6,a=0.4} -gf_boiler_entity.fire_glow.north.blend_mode = "additive-soft" -gf_boiler_entity.fire_glow.south.blend_mode = "additive-soft" -gf_boiler_entity.fire_glow.east.blend_mode = "additive-soft" -gf_boiler_entity.fire_glow.west.blend_mode = "additive-soft" +gf_boiler_entity.pictures.north.fire_glow.apply_runtime_tint = true +gf_boiler_entity.pictures.south.fire_glow.apply_runtime_tint = true +gf_boiler_entity.pictures.east.fire_glow.apply_runtime_tint = true +gf_boiler_entity.pictures.west.fire_glow.apply_runtime_tint = true +gf_boiler_entity.pictures.north.fire_glow.tint={r=1,g=0.6,b=0.6,a=0.4} +gf_boiler_entity.pictures.south.fire_glow.tint={r=1,g=0.6,b=0.6,a=0.4} +gf_boiler_entity.pictures.east.fire_glow.tint={r=1,g=0.6,b=0.6,a=0.4} +gf_boiler_entity.pictures.west.fire_glow.tint={r=1,g=0.6,b=0.6,a=0.4} +gf_boiler_entity.pictures.north.fire_glow.blend_mode = "additive-soft" +gf_boiler_entity.pictures.south.fire_glow.blend_mode = "additive-soft" +gf_boiler_entity.pictures.east.fire_glow.blend_mode = "additive-soft" +gf_boiler_entity.pictures.west.fire_glow.blend_mode = "additive-soft" gf_boiler_item = util.table.deepcopy(data.raw.item.boiler) @@ -171,12 +128,10 @@ gf_boiler_recipe = { type = "recipe", name = "gas-boiler", enabled = false, - ingredients = {{ - "boiler",1 - },{ - "pump",1 - }}, - result = "gas-boiler" + ingredients = { + { type = "item", name = "boiler", amount = 1 }, + { type = "item", name = "pump", amount = 1 }}, + results = {{ type = "item", name = "gas-boiler", amount = 1 }} } data:extend({ diff --git a/gas-boiler/factsheet.lua b/gas-boiler/factsheet.lua index 37a1a60..53bfc13 100644 --- a/gas-boiler/factsheet.lua +++ b/gas-boiler/factsheet.lua @@ -1700,9 +1700,6 @@ end set_shift = function(shift, tab) tab.shift = shift - if tab.hr_version then - tab.hr_version.shift = shift - end return tab end @@ -1729,16 +1726,10 @@ end empty_sprite = function() return { - filename = "__core__/graphics/empty.png", - priority = "extra-high", - width = 1, - height = 1, - hr_version = { - filename = "__core__/graphics/empty.png", - priority = "extra-high", - width = 1, - height = 1, - } + filename = "__core__/graphics/empty.png", + priority = "extra-high", + width = 1, + height = 1, } end @@ -1750,209 +1741,104 @@ centrifuge_idle_layers = function(size,speed) local size = number_or_one(size) local speed = number_or_one(speed) return {{ - filename = - "__base__/graphics/entity/" - .."centrifuge/centrifuge-C.png", - priority = "extra-high", - line_length = 8, - width = 119, - height = 107, - scale = size, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - -0.5, - -26.5 - ), - hr_version = { - filename = - "__base__/graphics/entity/" - .."centrifuge/hr-centrifuge-C.png", - priority = "extra-high", - scale = size*0.5, - line_length = 8, - width = 237, - height = 214, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - -0.25, - -26.5 - ) - } + filename = + "__base__/graphics/entity/" + .."centrifuge/hr-centrifuge-C.png", + priority = "extra-high", + scale = size*0.5, + line_length = 8, + width = 237, + height = 214, + frame_count = 64, + animation_speed = speed, + shift = + util.by_pixel( + -0.25, + -26.5 + ) },{ - filename = - "__base__/graphics/entity/" - .."centrifuge/centrifuge-C-shadow.png", - draw_as_shadow = true, - priority = "extra-high", - line_length = 8, - width = 132, - height = 74, - frame_count = 64, - scale = size, - animation_speed = speed, - shift = - util.by_pixel( - 20, - -10 - ), - hr_version = { - filename = - "__base__/graphics/entity/" - .."centrifuge/hr-centrifuge-C-shadow.png", - draw_as_shadow = true, - priority = "extra-high", - scale = size*0.5, - line_length = 8, - width = 279, - height = 152, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - 16.75, - -10 - ) - } + filename = + "__base__/graphics/entity/" + .."centrifuge/hr-centrifuge-C-shadow.png", + draw_as_shadow = true, + priority = "extra-high", + scale = size*0.5, + line_length = 8, + width = 279, + height = 152, + frame_count = 64, + animation_speed = speed, + shift = + util.by_pixel( + 16.75, + -10 + ) },{ - filename = - "__base__/graphics/entity/" - .."centrifuge/centrifuge-B.png", - priority = "extra-high", - line_length = 8, - width = 78, - height = 117, - scale = size, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - 23, - 6.5 - ), - hr_version = { - filename = - "__base__/graphics/entity/" - .."centrifuge/hr-centrifuge-B.png", - priority = "extra-high", - scale = size*0.5, - line_length = 8, - width = 156, - height = 234, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - 23, - 6.5 - ) - } + filename = + "__base__/graphics/entity/" + .."centrifuge/hr-centrifuge-B.png", + priority = "extra-high", + scale = size*0.5, + line_length = 8, + width = 156, + height = 234, + frame_count = 64, + animation_speed = speed, + shift = + util.by_pixel( + 23, + 6.5 + ) },{ - filename = - "__base__/graphics/entity/" - .."centrifuge/centrifuge-B-shadow.png", - draw_as_shadow = true, - priority = "extra-high", - line_length = 8, - width = 124, - height = 74, - frame_count = 64, - scale = size, - animation_speed = speed, - shift = - util.by_pixel( - 63, - 16 - ), - hr_version = { - filename = - "__base__/graphics/entity/" - .."centrifuge/hr-centrifuge-B-shadow.png", - draw_as_shadow = true, - priority = "extra-high", - scale = size*0.5, - line_length = 8, - width = 251, - height = 149, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - 63.25, - 15.25 - ) - } + filename = + "__base__/graphics/entity/" + .."centrifuge/hr-centrifuge-B-shadow.png", + draw_as_shadow = true, + priority = "extra-high", + scale = size*0.5, + line_length = 8, + width = 251, + height = 149, + frame_count = 64, + animation_speed = speed, + shift = + util.by_pixel( + 63.25, + 15.25 + ) },{ - filename = - "__base__/graphics/entity/" - .."centrifuge/centrifuge-A.png", - priority = "extra-high", - line_length = 8, - width = 70, - height = 123, - scale = size, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - -26, - 3.5 - ), - hr_version = { - filename = - "__base__/graphics/entity/" - .."centrifuge/hr-centrifuge-A.png", - priority = "extra-high", - scale = size*0.5, - line_length = 8, - width = 139, - height = 246, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - -26.25, - 3.5 - ) - } + filename = + "__base__/graphics/entity/" + .."centrifuge/hr-centrifuge-A.png", + priority = "extra-high", + scale = size*0.5, + line_length = 8, + width = 139, + height = 246, + frame_count = 64, + animation_speed = speed, + shift = + util.by_pixel( + -26.25, + 3.5 + ) },{ - filename = - "__base__/graphics/entity/" - .."centrifuge/centrifuge-A-shadow.png", - priority = "extra-high", - draw_as_shadow = true, - line_length = 8, - width = 108, - height = 54, - frame_count = 64, - scale = size, - animation_speed = speed, - shift = - util.by_pixel( - 6, - 27 - ), - hr_version = { - filename = - "__base__/graphics/entity/" - .."centrifuge/hr-centrifuge-A-shadow.png", - priority = "extra-high", - draw_as_shadow = true, - scale = size*0.5, - line_length = 8, - width = 230, - height = 124, - frame_count = 64, - animation_speed = speed, - shift = - util.by_pixel( - 8.5, - 23.5 - ) - } + filename = + "__base__/graphics/entity/" + .."centrifuge/hr-centrifuge-A-shadow.png", + priority = "extra-high", + draw_as_shadow = true, + scale = size*0.5, + line_length = 8, + width = 230, + height = 124, + frame_count = 64, + animation_speed = speed, + shift = + util.by_pixel( + 8.5, + 23.5 + ) }} end diff --git a/gas-sim.lua b/gas-sim.lua index e831c70..c23cd55 100644 --- a/gas-sim.lua +++ b/gas-sim.lua @@ -15,8 +15,8 @@ data.raw["utility-constants"]["default"].main_menu_simulations["gas-rig"] = { [[ local logo = game.surfaces.nauvis.find_entities_filtered{ name = "factorio-logo-16tiles", limit = 1}[1] - game.camera_position = {logo.position.x, logo.position.y+14} - game.camera_zoom = 0.75 + game.simulation.camera_position = {logo.position.x, logo.position.y+14} + game.simulation.camera_zoom = 0.75 game.tick_paused = false game.surfaces.nauvis.daytime = 0 ]], diff --git a/info.json b/info.json index d63f5c4..7d71824 100644 --- a/info.json +++ b/info.json @@ -1,25 +1,25 @@ { "name": "bzgas", - "version": "0.1.17", - "factorio_version": "1.1", + "version": "2.0.0", + "factorio_version": "2.0", "title": "Natural Gas", "author": "Brevven", "contact": "", "homepage": "", "dependencies": [ - "base >= 1.1.0", - "? bzfoundry >= 0.2.1", - "? bztitanium >= 1.2.0", - "? bzlead >= 1.2.0", - "? bzzirconium >= 0.6.0", + "base >= 2.0.0", + "? bzfoundry >= 2.0.0", + "? bztitanium >= 2.0.26", + "? bzlead >= 2.0.28", + "? bzzirconium >= 2.1.13", "? bztungsten >= 0.6.0", - "? bzcarbon >= 0.3.0", - "? bztin", + "? bzcarbon >= 2.0.21", + "? bztin >= 2.1.15", "? warptorio2_expansion", - "? space-exploration >= 0.5.100", - "? aai-industry", - "? Krastorio2", - "? deadlock-beltboxes-loaders", + "? space-exploration >= 0.7.34", + "? aai-industry >= 0.6.13", + "? Krastorio2 >= 2.0.8", + "? deadlock-beltboxes-loaders >= 2.6.0", "? DeadlockCrating" ], "description": "Adds a natural gas resource, along with early game plastic.\nIntegrates ElAdamo's gas-fired boiler.\n\nCompatible with Krastorio 2 and Space Exploration. A standalone piece of BZ Mods." diff --git a/matter.lua b/matter.lua index 5e068b5..f0d50e9 100644 --- a/matter.lua +++ b/matter.lua @@ -1,7 +1,7 @@ -- Matter recipes for Krastorio2 if mods["Krastorio2"] then local util = require("data-util"); -local matter = require("__Krastorio2__/lib/public/data-stages/matter-util") +local matter = require("__Krastorio2__/prototypes/libraries/matter") data:extend( { @@ -28,7 +28,7 @@ data:extend( { {"production-science-pack", 1}, {"utility-science-pack", 1}, - {"matter-tech-card", 1} + {"kr-matter-tech-card", 1} }, time = 45 } @@ -37,12 +37,11 @@ data:extend( local gas_ore_matter = { - item_name = "gas", - minimum_conversion_quantity = 100, - matter_value = 5, + material = { type = "fluid", name = "gas", amount = 100 }, + matter_count = 5, energy_required = 1, need_stabilizer = false, unlocked_by_technology = "gas-matter-processing" } -matter.createMatterRecipe(gas_ore_matter) +matter.make_recipes(gas_ore_matter) end diff --git a/modules.lua b/modules.lua index f73fde1..818462f 100644 --- a/modules.lua +++ b/modules.lua @@ -2,14 +2,6 @@ local util = require("data-util"); for i, recipe in pairs(util.me.recipes) do if data.raw.recipe[recipe] then - for j, module in pairs(data.raw.module) do - if module.effect then - for effect_name, effect in pairs(module.effect) do - if effect_name == "productivity" and effect.bonus > 0 and module.limitation and #module.limitation > 0 then - table.insert(module.limitation, recipe) - end - end - end - end + data.raw.recipe[recipe].allow_productivity = true end end diff --git a/prototypes/bakelite.lua b/prototypes/bakelite.lua index 345aafb..303cdf0 100644 --- a/prototypes/bakelite.lua +++ b/prototypes/bakelite.lua @@ -13,16 +13,16 @@ data:extend({ icon_size = 128, subgroup = "raw-material", order = "g[bakelite]", - stack_size = util.get_stack_size(100), + stack_size = 100, }, { type = "recipe", name = "bakelite", category = "chemistry", main_product = "bakelite", - enabled = "false", + enabled = false, ingredients = { - {util.me.use_phenol() and "phenol" or "coal", 1}, + {type = "item", name = util.me.use_phenol() and "phenol" or "coal", amount = 1}, {type="fluid", name="formaldehyde", amount=10} }, energy_required = 2, diff --git a/prototypes/basic-chemical-plant.lua b/prototypes/basic-chemical-plant.lua index 80a4130..d9e3ab5 100644 --- a/prototypes/basic-chemical-plant.lua +++ b/prototypes/basic-chemical-plant.lua @@ -5,13 +5,13 @@ data:extend({ { type = "recipe", name = "basic-chemical-plant", - result = "basic-chemical-plant", + results = {{ type = "item", name = "basic-chemical-plant", amount = 1}}, enabled = false, ingredients = { - {"stone-brick", 5}, - {"iron-plate", 4}, - {"copper-plate", 4}, - {"pipe", 6}, + {type="item", name="stone-brick", amount=5}, + {type="item", name="iron-plate", amount=4}, + {type="item", name="copper-plate", amount=4}, + {type="item", name="pipe", amount=6}, }, } }) @@ -19,7 +19,7 @@ data:extend({ util.add_ingredient("basic-chemical-plant", "lead-plate", 4) util.replace_ingredient("basic-chemical-plant", "iron-plate", "aluminum-plate") util.replace_ingredient("basic-chemical-plant", "copper-plate", "tin-plate") -util.replace_ingredient("basic-chemical-plant", "stone-brick", "sand", 10) +util.replace_ingredient("basic-chemical-plant", "stone-brick", mods["Krastorio2"] and "kr-sand" or "sand", 10) util.replace_ingredient("basic-chemical-plant", "stone-brick", "silica", 10) -- item @@ -45,16 +45,12 @@ end local plant_e = futil.table.deepcopy(data.raw["assembling-machine"]["chemical-plant"]) plant_e.name = "basic-chemical-plant" plant_e.minable = {mining_time = 0.5, result = "basic-chemical-plant"} -plant_e.module_specification = {module_slots = 0} -plant_e.working_visualisations = {plant_e.working_visualisations[1], plant_e.working_visualisations[2]} -- no smoke -plant_e.animation.north.layers[1].filename="__bzgas__/graphics/entity/chemical-plant.png" -plant_e.animation.north.layers[1].hr_version.filename="__bzgas__/graphics/entity/hr-chemical-plant.png" -plant_e.animation.south.layers[1].filename="__bzgas__/graphics/entity/chemical-plant.png" -plant_e.animation.south.layers[1].hr_version.filename="__bzgas__/graphics/entity/hr-chemical-plant.png" -plant_e.animation.east.layers[1].filename="__bzgas__/graphics/entity/chemical-plant.png" -plant_e.animation.east.layers[1].hr_version.filename="__bzgas__/graphics/entity/hr-chemical-plant.png" -plant_e.animation.west.layers[1].filename="__bzgas__/graphics/entity/chemical-plant.png" -plant_e.animation.west.layers[1].hr_version.filename="__bzgas__/graphics/entity/hr-chemical-plant.png" +plant_e.module_slots = 0 +plant_e.graphics_set.working_visualisations = {plant_e.graphics_set.working_visualisations[1], plant_e.graphics_set.working_visualisations[2]} -- no smoke +plant_e.graphics_set.animation.north.layers[1].filename="__bzgas__/graphics/entity/hr-chemical-plant.png" +plant_e.graphics_set.animation.south.layers[1].filename="__bzgas__/graphics/entity/hr-chemical-plant.png" +plant_e.graphics_set.animation.east.layers[1].filename="__bzgas__/graphics/entity/hr-chemical-plant.png" +plant_e.graphics_set.animation.west.layers[1].filename="__bzgas__/graphics/entity/hr-chemical-plant.png" plant_e.next_upgrade="chemical-plant" plant_e.icon = nil plant_e.icon_size = nil @@ -68,7 +64,7 @@ plant_e.energy_source = { type = "burner", fuel_inventory_size = 1, effectivity = 1, - emissions_per_minute = 5, + emissions_per_minute = { pollution = 5 }, fuel_categories = {"chemical"}, smoke = { { @@ -83,15 +79,5 @@ plant_e.energy_source = { }, }, } --- NOTE: Saving alternate tint here in case this is needed. --- local ptint = {r=.7,g=0.7,b=0.9,a=1} --- plant_e.animation.north.layers[1].tint = ptint --- plant_e.animation.north.layers[1].hr_version.tint = ptint --- plant_e.animation.south.layers[1].tint = ptint --- plant_e.animation.south.layers[1].hr_version.tint = ptint --- plant_e.animation.east.layers[1].tint = ptint --- plant_e.animation.east.layers[1].hr_version.tint = ptint --- plant_e.animation.west.layers[1].tint = ptint --- plant_e.animation.west.layers[1].hr_version.tint = ptint data.raw["assembling-machine"]["basic-chemical-plant"] = plant_e -- end entity diff --git a/prototypes/formaldehyde.lua b/prototypes/formaldehyde.lua index 0ca7700..a957ee6 100644 --- a/prototypes/formaldehyde.lua +++ b/prototypes/formaldehyde.lua @@ -12,8 +12,8 @@ data:extend({ type = "fluid", name = "formaldehyde", default_temperature = 25, - heat_capacity = "0.1KJ", - fuel_value = "0.5KJ", + heat_capacity = "0.1kJ", + fuel_value = "0.5kJ", base_color = {r=0.77, g=0.87, b=0.67}, flow_color = {r=0.77, g=0.87, b=0.77}, icon = "__bzgas__/graphics/icons/formaldehyde.png", @@ -25,7 +25,7 @@ data:extend({ name = "formaldehyde", category = "chemistry", subgroup = "fluid-recipes", - enabled = "false", + enabled = false, ingredients = { {type="fluid", name="gas", amount=10} }, diff --git a/prototypes/gas-extractor.lua b/prototypes/gas-extractor.lua index 89701bf..e1ddf72 100644 --- a/prototypes/gas-extractor.lua +++ b/prototypes/gas-extractor.lua @@ -2,24 +2,24 @@ local util = require("data-util"); local futil = require("util") local ge_ingredients = { - {"iron-plate", 10}, - {"pipe", 10}, - {"stone-brick", 4}, + {type="item", name="iron-plate", amount=10}, + {type="item", name="pipe", amount=10}, + {type="item", name="stone-brick", amount=4}, } local ge_prereq = {"automation"} -if mods.bzlead then table.insert(ge_ingredients, {"lead-plate", 4}) end +if mods.bzlead then table.insert(ge_ingredients, {type="item", name="lead-plate", amount=4}) end if mods.Krastorio2 then - table.insert(ge_ingredients, {"sand", 10}) + table.insert(ge_ingredients, {type="item", name="kr-sand", amount=10}) ge_prereq = {"kr-stone-processing"} elseif mods["aai-industry"] then - table.insert(ge_ingredients, {"sand", 10}) + table.insert(ge_ingredients, {type="item", name="sand", amount=10}) ge_prereq = {"sand-processing"} elseif data.raw.item["silica"] and data.raw.technology["silica-processing"] then - table.insert(ge_ingredients, {"silica", 20}) + table.insert(ge_ingredients, {type="item", name="silica", amount=20}) ge_prereq = {"silica-processing"} end -drilling_rig_circuit_connector_definitions = circuit_connector_definitions.create +drilling_rig_circuit_connector_definitions = circuit_connector_definitions.create_vector ( universal_connector_template, { @@ -45,7 +45,7 @@ data:extend({ { type = "recipe", name = "gas-extractor", - result = "gas-extractor", + results = {{ type = "item", name = "gas-extractor", amount = 1}}, enabled = false, -- TODO change ingredients = ge_ingredients, }, @@ -54,13 +54,13 @@ data:extend({ name = "gas-extraction", icon = "__bzgas__/graphics/technology/gas-processing.png", icon_size = 256, - prerequisites = ge_prereq, + --prerequisites = ge_prereq, effects = { {type = "unlock-recipe", recipe = "gas-extractor"}, }, unit = { count = 10, - ingredients = mods.Krastorio2 and {{"basic-tech-card", 1}} or {{"automation-science-pack", 1}}, + ingredients = mods.Krastorio2 and {{"kr-basic-tech-card", 1}} or {{"automation-science-pack", 1}}, time = 20, }, }, @@ -82,18 +82,18 @@ data:extend({ energy_source = { type = "electric", - emissions_per_minute = 10, + emissions_per_minute = { pollution = 10 }, usage_priority = "secondary-input" }, output_fluid_box = { - base_area = 10, - base_level = 1, + volume = 1000, pipe_covers = pipecoverspictures(), pipe_connections = { { - positions = { {0, -2}, {2, 0}, {0, 2}, {-2, 0} } + direction = defines.direction.north, + positions = { {0, -1}, {1, 0}, {0, 1}, {-1, 0} } } } }, @@ -101,10 +101,7 @@ data:extend({ mining_speed = util.me.finite() and 2 or 1, resource_searching_radius = 0.49, vector_to_place_result = {0, 0}, - module_specification = - { - module_slots = 2 - }, + module_slots = 2, radius_visualisation_picture = { filename = "__base__/graphics/entity/pumpjack/pumpjack-radius-visualization.png", @@ -147,34 +144,38 @@ data:extend({ shift = futil.by_pixel(-8, 8), }, }, - animations = { - layers = { - { - filename = "__bzgas__/graphics/entity/gas-extractor-animated.png", - priority = "extra-high", - width = 267, - height = 604, - scale = 0.33, -- just under 1/3, for height ~200. Check why height is 604 and not 600 - frame_count = 100, - line_length = 8, - animation_speed = 0.5, - shift = futil.by_pixel(0, -60), - }, - { - stripes = futil.multiplystripes(100, {{ - filename = "__bzgas__/graphics/entity/gas-extractor-shadow.png", - width_in_frames = 1, - height_in_frames = 1, - }}), - priority = "extra-high", - width = 331, - height = 64, - draw_as_shadow = true, - frame_count = 100, - animation_speed = 0.5, - shift = futil.by_pixel(119, 8), - }, - }, + graphics_set = { + animation = { + north = { + layers = { + { + filename = "__bzgas__/graphics/entity/gas-extractor-animated.png", + priority = "extra-high", + width = 267, + height = 604, + scale = 0.33, -- just under 1/3, for height ~200. Check why height is 604 and not 600 + frame_count = 100, + line_length = 8, + animation_speed = 0.5, + shift = futil.by_pixel(0, -60), + }, + { + stripes = futil.multiplystripes(100, { { + filename = "__bzgas__/graphics/entity/gas-extractor-shadow.png", + width_in_frames = 1, + height_in_frames = 1, + } }), + priority = "extra-high", + width = 331, + height = 64, + draw_as_shadow = true, + frame_count = 100, + animation_speed = 0.5, + shift = futil.by_pixel(119, 8), + }, + }, + } + } }, vehicle_impact_sound = data.raw["mining-drill"]["pumpjack"].vehicle_impact_sound, open_sound = data.raw["mining-drill"]["pumpjack"].open_sound, diff --git a/prototypes/gas.lua b/prototypes/gas.lua index 1547738..1d1e495 100644 --- a/prototypes/gas.lua +++ b/prototypes/gas.lua @@ -1,9 +1,12 @@ local resource_autoplace = require('resource-autoplace'); -local noise = require('noise'); local util = require("data-util"); local futil = require("util") +data.raw.planet.nauvis.map_gen_settings.autoplace_controls["gas"] = {} +data.raw.planet.nauvis.map_gen_settings.autoplace_settings.entity.settings["gas"] = {} +resource_autoplace.initialize_patch_set("gas", true) + data:extend({ {type = "resource-category", name="gas"} }) data:extend({ { @@ -13,10 +16,6 @@ data:extend({ richness = true, order = "b-ez" }, - { - type = "noise-layer", - name = "gas" - }, { type = "resource", name = "gas", @@ -71,53 +70,29 @@ data:extend({ { sheet = { - filename = "__bzgas__/graphics/entity/ores/gas.png", + filename = "__bzgas__/graphics/entity/ores/hr-gas.png", priority = "extra-high", - width = 64, - height = 64, + width = 128, + height = 128, frame_count = 4, variation_count = 1, shift = futil.by_pixel(0, -12), - scale = 0.75, - hr_version = - { - filename = "__bzgas__/graphics/entity/ores/hr-gas.png", - priority = "extra-high", - width = 128, - height = 128, - frame_count = 4, - variation_count = 1, - shift = futil.by_pixel(0, -12), - scale = 0.5*0.75, - } + scale = 0.5*0.75, } }, stages_effect = { sheet = { - filename = "__bzgas__/graphics/entity/ores/gas-effect.png", + filename = "__bzgas__/graphics/entity/ores/hr-gas-effect.png", priority = "extra-high", - width = 64, - height = 64, + width = 128, + height = 128, frame_count = 4, variation_count = 1, - shift = futil.by_pixel(0, -12), - scale = 0.75, + shift = futil.by_pixel(0, -17), blend_mode = "normal", - hr_version = - { - filename = "__bzgas__/graphics/entity/ores/hr-gas-effect.png", - priority = "extra-high", - width = 128, - height = 128, - frame_count = 4, - variation_count = 1, - shift = futil.by_pixel(0, -17), - scale = 0.5, - blend_mode = "normal", - scale = 0.5*0.75, - } + scale = 0.5*0.75, } }, effect_animation_period = 3.5, @@ -130,8 +105,8 @@ data:extend({ type = "fluid", name = "gas", default_temperature = 25, - heat_capacity = "0.1KJ", - fuel_value = "1000KJ", + heat_capacity = "0.1kJ", + fuel_value = "1000kJ", emissions_multiplier = util.se6() and 1.1 or 0.75, base_color = {r=0.67, g=0.87, b=0.77}, flow_color = {r=0.67, g=0.87, b=0.87}, diff --git a/prototypes/k2-recipe.lua b/prototypes/k2-recipe.lua index 6c4a1a2..3e11b16 100644 --- a/prototypes/k2-recipe.lua +++ b/prototypes/k2-recipe.lua @@ -6,9 +6,9 @@ if mods.Krastorio2 then name = "gas-reforming", category = "chemistry", subgroup = "fluid-recipes", - main_product = "hydrogen", + main_product = "kr-hydrogen", icons = { - {icon = kr_fluids_icons_path.."hydrogen.png", icon_size = 64, icon_mipmaps = 4}, + {icon = "__Krastorio2Assets__/icons/fluids/hydrogen.png", icon_size = 64, icon_mipmaps = 4}, {icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128, scale = 0.125, shift={-8,-8}}, }, enabled = false, @@ -18,7 +18,7 @@ if mods.Krastorio2 then }, energy_required = 3, results = { - {type="fluid", name="hydrogen", amount = 100}, + {type="fluid", name="kr-hydrogen", amount = 100}, }, }, { @@ -29,12 +29,12 @@ if mods.Krastorio2 then main_product = "formaldehyde", icons = { {icon = "__bzgas__/graphics/icons/formaldehyde.png", icon_size = 128, scale = 0.125}, - {icon = kr_fluids_icons_path.."biomethanol.png", icon_size = 64, scale = 0.125, icon_mipmaps = 4, shift={-5,-5}}, + {icon ="__Krastorio2Assets__/icons/fluids/biomethanol.png", icon_size = 64, scale = 0.125, icon_mipmaps = 4, shift={-5,-5}}, }, enabled = false, ingredients = { - {type="fluid", name="biomethanol", amount=50}, - {type="fluid", name="oxygen", amount=25}, + {type="fluid", name="kr-biomethanol", amount=50}, + {type="fluid", name="kr-oxygen", amount=25}, }, energy_required = 7, results = { @@ -50,9 +50,9 @@ if mods.Krastorio2 then name = "methane-reforming", category = "chemistry", subgroup = "fluid-recipes", - main_product = "hydrogen", + main_product = "kr-hydrogen", icons = { - {icon = kr_fluids_icons_path.."hydrogen.png", icon_size = 64, icon_mipmaps = 4}, + {icon ="__Krastorio2Assets__/icons/fluids/hydrogen.png", icon_size = 64, icon_mipmaps = 4}, {icon = "__space-exploration-graphics__/graphics/icons/fluid/methane-gas.png", icon_size = 64, scale = 0.25, shift={-8,-8}}, }, enabled = false, @@ -62,7 +62,7 @@ if mods.Krastorio2 then }, energy_required = 2, results = { - {type="fluid", name="hydrogen", amount = 100}, + {type="fluid", name="kr-hydrogen", amount = 100}, }, }, }) diff --git a/prototypes/phenol.lua b/prototypes/phenol.lua index 6231be5..a70fff0 100644 --- a/prototypes/phenol.lua +++ b/prototypes/phenol.lua @@ -8,18 +8,18 @@ data:extend({ name = "phenol", icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128, pictures = { - {filename = "__bzgas__/graphics/icons/phenol.png", size = 128, scale = 0.125}, - {filename = "__bzgas__/graphics/icons/phenol-2.png", size = 128, scale = 0.125}, - {filename = "__bzgas__/graphics/icons/phenol-3.png", size = 128, scale = 0.125}, - {filename = "__bzgas__/graphics/icons/phenol-4.png", size = 128, scale = 0.125}, + {filename = "__bzgas__/graphics/icons/phenol.png", size = 128, scale = 0.25}, + {filename = "__bzgas__/graphics/icons/phenol-2.png", size = 128, scale = 0.25}, + {filename = "__bzgas__/graphics/icons/phenol-3.png", size = 128, scale = 0.25}, + {filename = "__bzgas__/graphics/icons/phenol-4.png", size = 128, scale = 0.25}, }, subgroup = "raw-material", order = "g[phenol]", - stack_size = util.get_stack_size(100), + stack_size = 100, }, }) -if data.raw.item["coke"] then +if data.raw.item[mods["Krastorio2"] and "kr-coke" or "coke"] then local cat if mods.Krastorio2 then cat = "smelting" @@ -36,14 +36,14 @@ if data.raw.item["coke"] then name = "phenol", category = cat, main_product = "phenol", - enabled = "false", + enabled = false, icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128, - ingredients = {{"coal", 6}, {"wood", 6}}, + ingredients = {{type="item", name="coal", amount=6}, {type="item", name="wood", amount=6}}, energy_required = 16, subgroup = "raw-material", results = { {type="item", name="phenol", amount = 6}, - {type="item", name="coke", amount = 3}, + {type="item", name="kr-coke", amount = 3}, }, } }) @@ -54,9 +54,9 @@ if data.raw.item["coke"] then name = "phenol", category = cat, main_product = "phenol", - enabled = "false", + enabled = false, icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128, - ingredients = {{"coal", 4}}, + ingredients = {{type="item", name="coal", amount=4}}, energy_required = 6.4, subgroup = "raw-material", results = { @@ -83,9 +83,10 @@ if data.raw.item["coke"] then { type = "recipe", name = "phenol-from-oil", + localised_name = { "item-name.phenol" }, main_product = "phenol", category = "chemistry", - enabled = "false", + enabled = false, icons = { {icon = "__bzgas__/graphics/icons/phenol.png", icon_size = 128}, light_oil_icon, @@ -107,9 +108,9 @@ else name = "phenol", category = "advanced-crafting", main_product = "phenol", - enabled = "false", + enabled = false, energy_required = 1, - ingredients = {{"coal", 1}}, + ingredients = {{type="item", name="coal", amount=1}}, results = { {type="item", name="phenol", amount=1}, }, diff --git a/prototypes/se-recipe.lua b/prototypes/se-recipe.lua index a0a8218..6302d7a 100644 --- a/prototypes/se-recipe.lua +++ b/prototypes/se-recipe.lua @@ -49,6 +49,6 @@ if util.se6() then util.add_unlock("se-space-biochemical-laboratory", "methane-pre-reforming") util.add_unlock("se-space-biochemical-laboratory", "formaldehyde-methane") if data.raw.fluid["se-methane-gas"] then - data.raw.fluid["se-methane-gas"].fuel_value = "1000KJ" + data.raw.fluid["se-methane-gas"].fuel_value = "1000kJ" end end