From bf1767b726962c73af189e69de8393fe91de36ea Mon Sep 17 00:00:00 2001 From: Brevven Date: Mon, 8 Aug 2022 18:26:39 -0700 Subject: [PATCH] sintering SE --- changelog.txt | 1 + locale/en/tungsten.cfg | 3 +++ me.lua | 4 ++++ settings.lua | 13 ++++++++++++ tungsten-recipe-final-stacking.lua | 6 ++++++ tungsten-recipe-se.lua | 34 ++++++++++++++++++++++++++++-- 6 files changed, 59 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 14f0350..225a8ea 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ Date: 2022-08-09 Features: - New optional intermediate: Copper tungsten, replaces tungsten plate in some recipes. If not unlocked on settings change, use "TungstenRecipes" (no slashes) command. + - Space Exploration: New option to use tungsten powder instead of molten tungsten. - A few basic recipe tweaks for 248k Changes: - Rocketry now defaults to not requiring military science packs. Option still exists for now. diff --git a/locale/en/tungsten.cfg b/locale/en/tungsten.cfg index 9dc947b..8f5332d 100644 --- a/locale/en/tungsten.cfg +++ b/locale/en/tungsten.cfg @@ -12,6 +12,7 @@ tungsten-ore=[item=tungsten-ore] Wolframite [item-name] tungsten-ore=Wolframite +tungsten-powder=Tungsten powder tungsten-dust=Tungsten dust tungsten-plate=Tungsten plate tungsten-ingot=Tungsten ingot @@ -63,6 +64,7 @@ bztungsten-mining-fluid-amount=Mining fluid amount bztungsten-mining-fluid-amount-k2=Mining fluid amount for Krastorio2 bztungsten-starting-patch=Starting wolframite patch bztungsten-more-intermediates=Enable more intermediates +bztungsten-se-sintering=SE: Sinter powdered tungsten instead of casting [mod-setting-description] bztungsten-recipe-bypass=Skip modifying these recipes (comma-separated list). @@ -71,6 +73,7 @@ bztungsten-advanced-carbon-furnace=A furnace to smelt tungsten carbide quickly. bztungsten-mining-fluid-amount=Amount of fluid (water) needed to mine, default 10. Note, this is displayed as 1/10th the value in some parts of the game. bztungsten-mining-fluid-amount-k2=Mining fluid amount for Krastorio2, default 1. Note, this is displayed as 1/10th the value in some parts of the game. bztungsten-starting-patch=Whether a new game should have a starting wolframite patch. Disabled by default in vanilla, AAI, etc. +bztungsten-se-sintering=Due to the high melting point of tungsten, instead of creating molten tungsten and casting it, create tungsten powder and sinter it (still in a casting machine). [string-mod-setting] bztungsten-more-intermediates-no=No diff --git a/me.lua b/me.lua index 6e3e3e4..7672bb1 100644 --- a/me.lua +++ b/me.lua @@ -16,6 +16,10 @@ function me.cuw() return me.get_setting("bztungsten-more-intermediates") == "cuw" end +function me.sinter() + return me.get_setting("bztungsten-se-sintering") +end + function me.starting_patch() return mods["Krastorio2"] or me.get_setting("bztungsten-starting-patch") diff --git a/settings.lua b/settings.lua index 063733e..bed2883 100644 --- a/settings.lua +++ b/settings.lua @@ -51,5 +51,18 @@ data:extend({ default_value = 10, minimum_value = 1, maximum_value = 1000, + order = "aga", }, }) + +if mods["space-exploration"] and string.sub(mods["space-exploration"], 1, 3) >= "0.6" then +data:extend({ + { + type = "bool-setting", + name = "bztungsten-se-sintering", + setting_type = "startup", + default_value = false, + order = "acm", + } +}) +end diff --git a/tungsten-recipe-final-stacking.lua b/tungsten-recipe-final-stacking.lua index b0aed28..f4eec28 100644 --- a/tungsten-recipe-final-stacking.lua +++ b/tungsten-recipe-final-stacking.lua @@ -16,6 +16,9 @@ if deadlock then if util.me.cuw() then deadlock.add_stack("cuw", "__bztungsten__/graphics/icons/stacked/cuw-stacked.png" , "deadlock-stacking-2", 128) end + if data.raw.item["tungsten-powder"] then + deadlock.add_stack("tungsten-powder", nil, "deadlock-stacking-2", nil) + end end -- Deadlock crating recipes @@ -33,5 +36,8 @@ if deadlock_crating then if util.me.cuw() then deadlock_crating.add_crate("cuw", "deadlock-crating-2") end + if data.raw.item["tungsten-powder"] then + deadlock_crating.add_crate("tungsten-powder", "deadlock-crating-2") + end end diff --git a/tungsten-recipe-se.lua b/tungsten-recipe-se.lua index 38d5b20..523a0bc 100644 --- a/tungsten-recipe-se.lua +++ b/tungsten-recipe-se.lua @@ -46,7 +46,15 @@ if string.sub(mods["space-exploration"], 1, 3) >= "0.6" then stack_size = 50, subgroup = "tungsten", }, - { + + util.me.sinter() and { + type = "item", + name = "tungsten-powder", + icons = {{icon = "__bztungsten__/graphics/icons/tungsten-powder.png", icon_size = 64, icon_mipmaps = 3}}, + order = "b-a-x", + subgroup = "tungsten", + stack_size = util.get_stack_size(200), + } or { type = "fluid", name = "molten-tungsten", default_temperature = 3422, @@ -60,7 +68,24 @@ if string.sub(mods["space-exploration"], 1, 3) >= "0.6" then auto_barrel = false, subgroup = "fluid", }, - { + util.me.sinter() and { + type = "recipe", + category = "smelting", + name = "tungsten-powder", + subgroup = "tungsten", + results = { + {type = "item", name = "tungsten-powder", amount = mods.Krastorio2 and 30 or 36}, + }, + energy_required = 60, + ingredients = { + {name = mods.Krastorio2 and "enriched-tungsten" or "tungsten-ore", amount = 24}, + {type = "fluid", name = "se-pyroflux", amount = 10}, + }, + enabled = false, + always_show_made_in = true, + allow_as_intermediate = false, + order = "a-a" + } or { type = "recipe", category = "smelting", name = "molten-tungsten", @@ -85,6 +110,7 @@ if string.sub(mods["space-exploration"], 1, 3) >= "0.6" then results = {{"tungsten-ingot", 1}}, energy_required = 18, ingredients = { + util.me.sinter() and {type = "item", name = "tungsten-powder", amount = 15} or {type = "fluid", name = "molten-tungsten", amount = 375}, }, enabled = false, @@ -97,12 +123,15 @@ if string.sub(mods["space-exploration"], 1, 3) >= "0.6" then category = "casting", icons = { {icon = "__bztungsten__/graphics/icons/tungsten-carbide.png", icon_size = 128}, + util.me.sinter() and + {icon = "__bztungsten__/graphics/icons/tungsten-powder.png", icon_size = 64, scale = 0.25, shift = {-8, -8}} or {icon = "__bztungsten__/graphics/icons/molten-tungsten.png", icon_size = 128, scale = 0.125, shift = {-8, -8}}, }, results = {{"tungsten-carbide", 4}}, energy_required = 40, ingredients = { data.raw.item["coke"] and {"coke", 8} or {"coal", 16}, + util.me.sinter() and {type = "item", name = "tungsten-powder", amount = 15} or {type = "fluid", name = "molten-tungsten", amount = 375}, }, enabled = false, @@ -131,6 +160,7 @@ if string.sub(mods["space-exploration"], 1, 3) >= "0.6" then }, }) util.add_effect("se-pyroflux-smelting", {type = "unlock-recipe", recipe= "molten-tungsten"}) + util.add_effect("se-pyroflux-smelting", {type = "unlock-recipe", recipe= "tungsten-powder"}) util.add_effect("se-pyroflux-smelting", {type = "unlock-recipe", recipe= "tungsten-ingot"}) util.add_effect("se-pyroflux-smelting", {type = "unlock-recipe", recipe= "tungsten-ingot-to-plate"}) util.add_effect("se-pyroflux-smelting", {type = "unlock-recipe", recipe= "tungsten-carbide-casting"})