From af70f7e84e613914ac33a01bf22e95f7dd8b88ab Mon Sep 17 00:00:00 2001 From: Brevven Date: Tue, 9 Mar 2021 03:36:40 -0800 Subject: [PATCH] SimpleCompress support --- changelog.txt | 5 +++++ data.lua | 1 + info.json | 2 +- lead-compressed.lua | 33 +++++++++++++++++++++++++++++++++ locale/en/lead.cfg | 2 ++ 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 lead-compressed.lua diff --git a/changelog.txt b/changelog.txt index d9af733..41a8656 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.3.1 +Date: 2021-03-09 + Features: + - SimpleCompress support +--------------------------------------------------------------------------------------------------- Version: 0.3.0 Date: 2021-03-07 Changes: diff --git a/data.lua b/data.lua index b13861e..05abd07 100644 --- a/data.lua +++ b/data.lua @@ -4,4 +4,5 @@ require("lead-recipe") require("other-entities") require("lead-enriched") -- Enriched Ti for Krastorio 2 require("lead-recipe-se") -- Space Exploration special recipes (depends on K2 if present) +require("lead-compressed") diff --git a/info.json b/info.json index d7fe8fe..3c0e907 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzlead", - "version": "0.3.0", + "version": "0.3.1", "factorio_version": "1.1", "title": "Lead", "author": "Brevven", diff --git a/lead-compressed.lua b/lead-compressed.lua new file mode 100644 index 0000000..9cfa94a --- /dev/null +++ b/lead-compressed.lua @@ -0,0 +1,33 @@ + +if simpleCompress then + if simpleCompress.ores then + simpleCompress.currentSubgroup = "intermediate-product" + if data.raw.item["lead-ore"] then + SimpleCompress_AddTintedItem("lead-ore", "ore4-lead", "ore", {r=0.3, g=0.15, b=0.05}) + SimpleCompress_UnlockOreTechAndRecipe("lead-ore") + end + end + if simpleCompress.plates then + simpleCompress.currentSubgroup = "intermediate-product" + if data.raw.item["lead-plate"] then + SimpleCompress_AddTintedItem("lead-plate", "plates4-lead", "plate3", {r=0.25, g=0.15, b=0.05}) + SimpleCompress_UnlockPlateTechAndRecipe("lead-plate") + local leadRecipe = data.raw.recipe["decompress-lead-plate"] + leadRecipe.order = "d[lead-plate]" + end + end + if simpleCompress.smelting then + if data.raw.item["lead-plate"] and data.raw.item["lead-plate"] then + SimpleCompress_AddSmeltingRecipe("lead-ore", "lead-plate") + SimpleCompress_UnlockOreSmeltingTech("lead-ore") + local leadRecipe = data.raw.recipe["smelt-compressed-lead-ore"] + leadRecipe.results = { + {type="item", name = "lead-plate", amount=5/6*simpleCompress.CompressedSmeltAmount}, + {type="item", name = "copper-ore", amount=1/6*simpleCompress.CompressedSmeltAmount}, + } + leadRecipe.icons = {{ icon = "__bzlead__/graphics/icons/lead-plate.png", icon_size = 64 }} + leadRecipe.subgroup = "raw-material" + leadRecipe.order = "d[lead-plate]" + end + end +end diff --git a/locale/en/lead.cfg b/locale/en/lead.cfg index c1c9ee4..4e26983 100644 --- a/locale/en/lead.cfg +++ b/locale/en/lead.cfg @@ -12,6 +12,7 @@ lead-plate=Lead plate lead-alloy=__ITEM__lead-plate__ enriched-lead=Enriched lead lead-chest=Lead chest +compressed-lead-ore=Compressed lead ore [item-description] lead-ore=Can be smelted into lead plates @@ -27,6 +28,7 @@ enriched-lead=Enrich lead ore, purifying with sulfuric acid [fluid=sulfuric-acid [recipe-name] enriched-lead=__ITEM__enriched-lead__ lead-plate=__ITEM__lead-plate__ +smelt-compressed-lead-ore=__ITEM__lead-plate__ lead-dust=__ITEM__lead-dust__ dirty-water-filtration-lead=Filter dirty water [item=lead-ore]