From fab73533b9a1aeb319e4a7552f14e15da3ebd2d4 Mon Sep 17 00:00:00 2001 From: Brevven Date: Sun, 19 Mar 2023 01:22:36 -0700 Subject: [PATCH] alchemy --- data.lua | 1 + locale/en/noble.cfg | 9 ++++--- me.lua | 4 +++ prototypes/alchemy.lua | 55 ++++++++++++++++++++++++++++++++++++++++++ settings.lua | 11 +++++++++ 5 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 prototypes/alchemy.lua diff --git a/data.lua b/data.lua index e6afa47..169c44b 100644 --- a/data.lua +++ b/data.lua @@ -11,6 +11,7 @@ require("prototypes/mainboard") require("prototypes/catalyst") require("prototypes/recipes-se") require("cables") +require("prototypes/alchemy") require("prototypes/enriched-silver") require("prototypes/enriched-gold") require("prototypes/pyroflux-gold") diff --git a/locale/en/noble.cfg b/locale/en/noble.cfg index c153af7..2982820 100644 --- a/locale/en/noble.cfg +++ b/locale/en/noble.cfg @@ -65,10 +65,11 @@ catalyzed=Catalyzed bzgold-recipe-bypass=Bypass recipes bzgold-list=Make a list of modified recipes bzgold-byproduct=Output byproducts -bzogld-silver=Enable silver processing -bzogld-platinum=Enable platinum processing -bzogld-palladium=Enable palladium processing -bzogld-catalysis=Enable catalysis recipes +bzgold-silver=Enable silver processing +bzgold-platinum=Enable platinum processing +bzgold-palladium=Enable palladium processing +bzgold-catalysis=Enable catalysis recipes +bzgold-alchemy=Alchemy [mod-setting-description] bzgold-recipe-bypass=Skip modifying these recipes (comma-separated list). diff --git a/me.lua b/me.lua index a18d3dd..be21017 100644 --- a/me.lua +++ b/me.lua @@ -12,6 +12,10 @@ me.recipes = { "molten-silver", "molten-gold", } +function me.alchemy() + return me.get_setting("bzgold-alchemy") +end + function me.byproduct() return me.get_setting("bzgold-byproduct") and not me.get_setting("bz-no-byproduct") end diff --git a/prototypes/alchemy.lua b/prototypes/alchemy.lua new file mode 100644 index 0000000..a94ddb2 --- /dev/null +++ b/prototypes/alchemy.lua @@ -0,0 +1,55 @@ +local util = require("data-util"); + + +if util.me.alchemy() then + data:extend({ + { + type = "recipe", + name = "alchemy", + main_product = "gold-ingot", + category = "smelting", + order = "d[gold-ingot]2", + enabled = false, + energy_required = 16, + ingredients = {{"lead-plate", 2}}, + results = {{"gold-ingot", 1}}, + icons = { + { + icon = "__bzgold__/graphics/icons/gold-ingot.png", + icon_size = 128, + }, + { + icon = "__bzlead__/graphics/icons/lead-plate.png", + icon_size = 64, icon_mipmaps = 4, shift = {-8,-8}, scale=0.25, + }, + }, + }, + { + type = "technology", + name = "alchemy", + icons = { + { + icon = "__bzgold__/graphics/technology/gold-processing.png", + icon_size = 256, + }, + { + icon = "__bzlead__/graphics/icons/lead-plate.png", + icon_size = 64, icon_mipmaps = 4, shift = {-48,-48}, scale=2, + }, + }, + effects = { + { type = "unlock-recipe", recipe = "alchemy" }, + }, + unit = { + count = 250, time = 30, + ingredients = { + {"automation-science-pack", 1}, + {"logistic-science-pack", 1}, + {"chemical-science-pack", 1}, + }, + }, + prerequisites = {"gold-processing"}, + order = "b-b", + }, + }) +end diff --git a/settings.lua b/settings.lua index 372b36e..c8e097b 100644 --- a/settings.lua +++ b/settings.lua @@ -50,3 +50,14 @@ data:extend({ order = "d", }, }) +if mods.bzlead then + data:extend({ + { + type = "bool-setting", + name = "bzgold-alchemy", + setting_type = "startup", + default_value = false, + order = "e", + }, + }) +end