From cb2d4cb2b3a1229d2b81db8ccd39e7f03f4f5a3d Mon Sep 17 00:00:00 2001 From: Brevven Date: Thu, 20 Jan 2022 00:37:33 -0800 Subject: [PATCH] lds/srp fixes, tech tree tweaks --- carbon-recipe-updates.lua | 4 --- changelog.txt | 8 +++++ data-final-fixes.lua | 48 +++++--------------------- data-updates.lua | 1 + info.json | 2 +- low-density-structure-nanotubes.lua | 53 +++++++++++++++++++++++++++++ 6 files changed, 72 insertions(+), 44 deletions(-) create mode 100644 low-density-structure-nanotubes.lua diff --git a/carbon-recipe-updates.lua b/carbon-recipe-updates.lua index 5192d6a..78d4cc3 100644 --- a/carbon-recipe-updates.lua +++ b/carbon-recipe-updates.lua @@ -12,10 +12,6 @@ util.add_prerequisite("power-armor-mk2", "graphene") util.add_prerequisite("rocket-control-unit", "graphene") util.add_prerequisite("electronics", "graphite-processing") -if mods.Krastorio2 then - util.add_prerequisite("graphite-processing", "kr-crusher") -end - -- furnace recipe rework w/ crucible, more in data-final-fixes util.add_effect("advanced-material-processing-2", {type="unlock-recipe", recipe="crucible"}) diff --git a/changelog.txt b/changelog.txt index 335069c..6188ba7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,12 @@ --------------------------------------------------------------------------------------------------- +Version: 0.0.18 +Date: 2022-01-17 + Changes: + - Minor modded tech tree tweaks + Fixes: + - Fix Schall Recipe Scaling issue with diamonds in furnaces + - Attempted to fix an issue when low density structure has no expensive recipe +--------------------------------------------------------------------------------------------------- Version: 0.0.17 Date: 2022-01-15 Fixes: diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 1c51e0d..bc6e948 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -2,10 +2,10 @@ require("carbon-recipe-final-stacking") require("carbon-recipe-final-k2") require("carbon-recipe-final-se") require("carbon-recipe-final-rrr") -require("carbon-recipe-modules") -- Should be last import +require("low-density-structure-nanotubes") +require("carbon-recipe-modules") -- Should be last import, need in both updates and final-fixes local util = require("data-util"); -local futil = require("util") -- Green circuits in final fixes due to K2 shenanigans @@ -36,56 +36,26 @@ if data.raw.recipe["low-density-structure"] and }) end -if util.me.use_fullerenes() then - data:extend({ - { - type = "recipe", - name = "low-density-structure-nanotubes", - icons = { - { icon = "__base__/graphics/icons/low-density-structure.png", icon_size = 64, icon_mipmaps = 4}, - { icon = "__bzcarbon__/graphics/icons/nanotube.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, - }, - category = "advanced-crafting", - subgroup = data.raw.item["low-density-structure"].subgroup, - order = "o[low-density-structure-nanotubes]", - normal = { - enabled = false, - energy_required = 20, - results = {{"low-density-structure", 2}}, - ingredients = { - {"nanotubes", 2}, - table.unpack(futil.table.deepcopy(data.raw.recipe["low-density-structure"].normal.ingredients)), - }, - }, - expensive = { - enabled = false, - energy_required = 20, - results = {{"low-density-structure", 2}}, - ingredients = { - {"nanotubes", 2}, - table.unpack(futil.table.deepcopy(data.raw.recipe["low-density-structure"].expensive.ingredients)), - }, - }, - }, - }) - if util.me.reuse() then - util.add_product("low-density-structure-nanotubes", {type="item", name="diamond", amount=1, probability = 0.5}) - end -end - -- Only electric smelters can make Diamonds function diamondsInElectricSmelter(entity) if entity.energy_source.type == "electric" then local isSmelter = false + local isSmelterRS = false for j, category in pairs(entity.crafting_categories) do if category == "smelting" then isSmelter = true end + if category == "smelting-RS" then + isSmelterRS = true + end end if isSmelter then table.insert(entity.crafting_categories,"diamond-synthesis") end + if isSmelterRS then + table.insert(entity.crafting_categories,"diamond-synthesis-RS") + end end end for i, entity in pairs(data.raw.furnace) do diff --git a/data-updates.lua b/data-updates.lua index 17f5f87..ec57df8 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -2,6 +2,7 @@ require("carbon-recipe-updates") require("map-gen-preset-updates") require("carbon-matter") require("strange-matter") +require("carbon-recipe-modules") -- Should be last import, need in both updates and final-fixes -- require("omni") diff --git a/info.json b/info.json index d17ba27..907cd5d 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzcarbon", - "version": "0.0.17", + "version": "0.0.18", "factorio_version": "1.1", "title": "Graphite & Diamonds", "author": "Brevven", diff --git a/low-density-structure-nanotubes.lua b/low-density-structure-nanotubes.lua new file mode 100644 index 0000000..32ccaca --- /dev/null +++ b/low-density-structure-nanotubes.lua @@ -0,0 +1,53 @@ +local util = require("data-util"); +local futil = require("util") + +if util.me.use_fullerenes() then + data:extend({ + { + type = "recipe", + name = "low-density-structure-nanotubes", + icons = { + { icon = "__base__/graphics/icons/low-density-structure.png", icon_size = 64, icon_mipmaps = 4}, + { icon = "__bzcarbon__/graphics/icons/nanotube.png", icon_size = 128, scale=0.125, shift= {-8, -8}}, + }, + category = "advanced-crafting", + subgroup = data.raw.item["low-density-structure"].subgroup, + order = "o[low-density-structure-nanotubes]", + }, + }) + if data.raw.recipe["low-density-structure"].normal and data.raw.recipe["low-density-structure"].normal.ingredients then + data.raw.recipe["low-density-structure-nanotubes"].normal = { + enabled = false, + energy_required = 20, + results = {{"low-density-structure", 2}}, + ingredients = { + {"nanotubes", 2}, + table.unpack(futil.table.deepcopy(data.raw.recipe["low-density-structure"].normal.ingredients)), + }, + } + if data.raw.recipe["low-density-structure"].expensive and data.raw.recipe["low-density-structure"].expensive.ingredients then + data.raw.recipe["low-density-structure-nanotubes"].expensive = { + enabled = false, + energy_required = 20, + results = {{"low-density-structure", 2}}, + ingredients = { + {"nanotubes", 2}, + table.unpack(futil.table.deepcopy(data.raw.recipe["low-density-structure"].expensive.ingredients)), + }, + } + end + else + local recipe = data.raw.recipe["low-density-structure-nanotubes"] + recipe.enabled = false + recipe.energy_required = 20 + recipe.results = {{"low-density-structure", 2}} + recipe.ingredients = { + {"nanotubes", 2}, + table.unpack(futil.table.deepcopy(data.raw.recipe["low-density-structure"].ingredients)), + } + end + + if util.me.reuse() then + util.add_product("low-density-structure-nanotubes", {type="item", name="diamond", amount=1, probability = 0.5}) + end +end