From 2890e6b844461d868f116643361fd6d60ca2a767 Mon Sep 17 00:00:00 2001 From: Brevven Date: Sat, 1 Jan 2022 02:44:23 -0800 Subject: [PATCH] option to use refractories --- changelog.txt | 7 +++++-- data-updates.lua | 1 + data-util.lua | 15 +++++++++++++++ info.json | 3 ++- locale/en/foundry.cfg | 7 ++++++- me.lua | 4 ++++ prototypes/foundry.lua | 26 ++++++++++++++++++++++++++ settings.lua | 7 +++++++ 8 files changed, 66 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 8a9d9c8..a5cb9fd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,8 +1,11 @@ --------------------------------------------------------------------------------------------------- Version: 0.0.6 -Date: 2021-12-30 - Changes: +Date: 2022-01-01 + Features: - Graphite compatibility - crucible + - New option to enable more efficient founding of plates using refractory materials + Fixes: + - Steel time adjustment fix --------------------------------------------------------------------------------------------------- Version: 0.0.5 Date: 2021-08-20 diff --git a/data-updates.lua b/data-updates.lua index 9540177..dbfe486 100644 --- a/data-updates.lua +++ b/data-updates.lua @@ -1 +1,2 @@ require("foundry-updates") +require("refractory-updates") diff --git a/data-util.lua b/data-util.lua index a416efc..e618ff2 100644 --- a/data-util.lua +++ b/data-util.lua @@ -8,6 +8,15 @@ local util = {} util.me = me util.get_setting = util.me.get_setting +util.titanium_plate = "" +util.titanium_processing = "" + +if mods["FactorioExtended-Plus-Core"] then + util.titanium_plate = "titanium-alloy" +else + util.titanium_plate = "titanium-plate" +end + function util.fe_plus(sub) if mods["FactorioExtended-Plus-"..sub] then return true @@ -435,4 +444,10 @@ function add_to_product(recipe, product, amount) end end +function util.add_minable_result(t, name, result) + if data.raw[t] and data.raw[t][name] and data.raw[t][name].minable and data.raw[t][name].minable.results then + table.insert(data.raw[t][name].minable.results, result) + end +end + return util diff --git a/info.json b/info.json index f656da5..f236e79 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzfoundry", - "version": "0.0.5", + "version": "0.0.6", "factorio_version": "1.1", "title": "Foundry", "author": "Brevven", @@ -11,6 +11,7 @@ "? bzsilicon", "? bztungsten", "? bzzirconium", + "rusty-locale", "base >= 1.1.0" ], "description": "Adds a foundry building for making alloys, etc." diff --git a/locale/en/foundry.cfg b/locale/en/foundry.cfg index 41083a8..4d5d275 100644 --- a/locale/en/foundry.cfg +++ b/locale/en/foundry.cfg @@ -13,7 +13,8 @@ electric-foundry=For melting and casting metals, can also heat up other things. coke=A pure fuel and source of carbon. [recipe-name] -solid-fuel-from-coal=Solid fuel from coal. +solid-fuel-from-coal=Solid fuel from coal +with-refractory=__1__ with refractory [recipe-description] solid-fuel-from-coal=Make solid fuel from coal, a wasteful process. @@ -21,13 +22,16 @@ solid-fuel-from-coal=Make solid fuel from coal, a wasteful process. [technology-name] foundry=__ITEM__foundry__ electric-foundry=__ITEM__electric-foundry__ +advanced-founding=Advanced founding [technology-description] foundry=Use heat for founding, coking, etc. +advanced-founding=Alternate, efficient recipes for founding [mod-setting-name] bzfoundry-recipe-bypass=Bypass recipes bzfoundry-smelt=Foundry can smelt +bzfoundry-plates=Add refractory recipes (experimental) bzfoundry-hydrocarbon=Hydrocarbon for founding bzfoundry-other-machines=Other machines that can do founding @@ -36,3 +40,4 @@ bzfoundry-recipe-bypass=Skip modifying these recipes (comma-separated list). bzfoundry-smelt=If true, the foundry building can also handle raw ore smelting. bzfoundry-hydrocarbon=Which hydrocarbon to use for founding. The foundry building is also used for coking.\nIf [color=cyan]coke[/color], a coke item and recipe is added, if needed.\nIf [color=cyan]solid fuel[/color], an early but inefficient recipe is added.\nIf [color=cyan]coal[/color], that is used.\nIf [color=cyan]none[/color], no hydrocarbon is used in founding (not recommended). bzfoundry-other-machines=List of other "assembling-machine" entities that can do "founding" recipes. Eg. Krastorio2's "kr-advanced-furnace", or AAII's "industrial-furnace" (comma-separated list). +bzfoundry-plates=[color=orange]EXPERIMENTAL[/color] Ingredients, products, or anything might change.\nRequires "Silica & Silicon", "Zirconium", or "Graphite & Diamonds" mod.\nUsing one or more refractories, Foundries can increase output of plates.\nBe warned, these are complex recipes. diff --git a/me.lua b/me.lua index 1812d15..e31ea7a 100644 --- a/me.lua +++ b/me.lua @@ -2,6 +2,10 @@ local me = {} me.name = "bzfoundry" +function me.founding_plates() + return me.get_setting("bzfoundry-plates") +end + function me.smelt() return me.get_setting("bzfoundry-smelt") end diff --git a/prototypes/foundry.lua b/prototypes/foundry.lua index e037e9e..7e46ff4 100644 --- a/prototypes/foundry.lua +++ b/prototypes/foundry.lua @@ -50,6 +50,7 @@ data:extend({ }, }) + if mods.Krastorio2 then util.add_prerequisite("foundry", "kr-stone-processing") elseif mods["aai-industry"] then @@ -110,3 +111,28 @@ data:extend({ }, }) + +if mods.bzcarbon and util.me.founding_plates() then +data:extend({ + { + type = "technology", + name = "advanced-founding", + icons = { + {icon = "__bzfoundry__/graphics/icons/technology/foundry.png", icon_size = 256}, + {icon = "__bzcarbon__/graphics/icons/graphite.png", icon_size = 128, shift={-32, -32}}, + }, + effects = {}, + prerequisites = {"electric-foundry", "utility-science-pack"}, + unit = { + count = 1000, + ingredients = {{"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1}, + {"production-science-pack", 1}, + {"utility-science-pack", 1}}, + time = 60, + }, + order = "foundry", + } +}) +end diff --git a/settings.lua b/settings.lua index 5d4ad4f..1b94c30 100644 --- a/settings.lua +++ b/settings.lua @@ -25,4 +25,11 @@ data:extend({ setting_type = "startup", default_value = "kr-advanced-furnace", }, + { + type = "string-setting", + name = "bzfoundry-plates", + setting_type = "startup", + default_value = "no", + allowed_values = {"yes", "no"}, + }, })