From 1e7be9c5816f997f5bb1446b81c2b52189d6b053 Mon Sep 17 00:00:00 2001 From: Brevven Date: Wed, 17 Aug 2022 09:22:37 -0700 Subject: [PATCH] se methane --- changelog.txt | 6 +++++- data.lua | 1 + info.json | 2 +- prototypes/k2-recipe.lua | 32 ++++++++++++++++++++++++---- prototypes/se-recipe.lua | 46 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 prototypes/se-recipe.lua diff --git a/changelog.txt b/changelog.txt index 12ab081..636db31 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,8 +1,12 @@ --------------------------------------------------------------------------------------------------- Version: 0.0.18 -Date: 2022-08-15 +Date: 2022-08-17 Changes: - Minor, change tech name from "bakelite" to "basic plastics" + - SE: can make methane from natural gas. + - SE: can make formaldehyde from methane + - SE: methane has a fuel value + - SE + K2: methane can be reformed to hydrogen Fixes: - Add missing locale string --------------------------------------------------------------------------------------------------- diff --git a/data.lua b/data.lua index 5613449..3fa3618 100644 --- a/data.lua +++ b/data.lua @@ -5,6 +5,7 @@ require("prototypes/formaldehyde") require("prototypes/bakelite") require("prototypes/basic-chemical-plant") require("prototypes/k2-recipe") +require("prototypes/se-recipe") local util = require("data-util"); diff --git a/info.json b/info.json index 59c5cd1..5dd4276 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzgas", - "version": "0.0.18", + "version": "0.0.19", "factorio_version": "1.1", "title": "Natural Gas", "author": "Brevven", diff --git a/prototypes/k2-recipe.lua b/prototypes/k2-recipe.lua index 3ddc4b1..2c64198 100644 --- a/prototypes/k2-recipe.lua +++ b/prototypes/k2-recipe.lua @@ -10,7 +10,7 @@ if mods.Krastorio2 then {icon = kr_fluids_icons_path.."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", + enabled = false, ingredients = { {type="fluid", name="gas", amount=25}, {type="fluid", name="water", amount=50}, @@ -29,7 +29,7 @@ if mods.Krastorio2 then {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}}, }, - enabled = "false", + enabled = false, ingredients = { {type="fluid", name="biomethanol", amount=50}, {type="fluid", name="oxygen", amount=25}, @@ -41,6 +41,30 @@ if mods.Krastorio2 then }, }, }) - util.add_effect("kr-advanced-chemistry", {type="unlock-recipe", recipe="gas-reforming"}) - util.add_effect("kr-advanced-chemistry", {type="unlock-recipe", recipe="formaldehyde-methanol"}) + if util.se6() then + data:extend({ + { + type = "recipe", + name = "methane-reforming", + category = "chemistry", + main_product = "hydrogen", + icons = { + {icon = kr_fluids_icons_path.."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, + ingredients = { + {type="fluid", name="se-methane-gas", amount=25}, + {type="fluid", name="water", amount=50}, + }, + energy_required = 2, + results = { + {type="fluid", name="hydrogen", amount = 100}, + }, + }, + }) + end + util.add_unlock("kr-advanced-chemistry", "gas-reforming") + util.add_unlock("se-space-biochemical-laboratory", "methane-reforming") + util.add_unlock("kr-advanced-chemistry", "formaldehyde-methanol") end diff --git a/prototypes/se-recipe.lua b/prototypes/se-recipe.lua new file mode 100644 index 0000000..92debc1 --- /dev/null +++ b/prototypes/se-recipe.lua @@ -0,0 +1,46 @@ +local util = require("data-util"); + +if util.se6() then + data:extend({ + { + type = "recipe", + name = "methane-pre-reforming", + category = "chemistry", + main_product = "se-methane-gas", + icons = { + {icon = "__space-exploration-graphics__/graphics/icons/fluid/methane-gas.png", icon_size = 64}, + {icon = "__bzgas__/graphics/icons/gas.png", icon_size = 128, scale = 0.125, shift={-8,-8}}, + }, + enabled = false, + ingredients = { + {type="fluid", name="gas", amount=25}, + }, + energy_required = 1, + results = { + {type="fluid", name="se-methane-gas", amount = 25}, + }, + }, + { + type = "recipe", + name = "formaldehyde-methane", + category = "chemistry", + icons = { + {icon = "__bzgas__/graphics/icons/formaldehyde.png", icon_size = 128, scale = 0.125}, + {icon = "__space-exploration-graphics__/graphics/icons/fluid/methane-gas.png", icon_size = 64, scale = 0.125, shift={-8,-8}}, + }, + enabled = false, + ingredients = { + {type="fluid", name="se-methane-gas", amount=10}, + }, + energy_required = 1, + results = { + {type="fluid", name="formaldehyde", amount = 10}, + }, + }, + }) + 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" + end +end