diff --git a/me.lua b/me.lua index 5bff605..030788f 100644 --- a/me.lua +++ b/me.lua @@ -8,6 +8,9 @@ me.recipes = { "temperature-sensor", "mlcc", } +function me.byproduct() + return me.get_setting("bzgold-byproduct") and not me.get_setting("bz-no-byproduct") +end function me.silver() if me.get_setting("bz-all-intermediates") then return true end diff --git a/prototypes/palladium.lua b/prototypes/palladium.lua index b6e5f8c..56e646f 100644 --- a/prototypes/palladium.lua +++ b/prototypes/palladium.lua @@ -23,12 +23,17 @@ data:extend({ { type = "recipe", name = "palladium-ingot", + main_product = "palladium-ingot", category = "smelting", order = "d[palladium-ingot]", enabled = false, energy_required = 1.6, ingredients = {{"palladium-powder", 1}}, - results = {{"palladium-ingot", 1}}, + results = util.me.byproduct() and + { + {type="item", name="palladium-ingot", amount=1, probability=0.95}, + {type="item", name="sulfur", amount=1, probability=0.05}, + } or {{"palladium-ingot", 1}}, }, }) data:extend({ diff --git a/prototypes/platinum.lua b/prototypes/platinum.lua index d1fac20..9400255 100644 --- a/prototypes/platinum.lua +++ b/prototypes/platinum.lua @@ -23,12 +23,17 @@ data:extend({ { type = "recipe", name = "platinum-ingot", + main_product = "platinum-ingot", category = "smelting", order = "d[platinum-ingot]", enabled = false, energy_required = 1.6, ingredients = {{"platinum-powder", 1}}, - results = {{"platinum-ingot", 1}}, + results = util.me.byproduct() and + { + {type="item", name="platinum-ingot", amount=1, probability=0.95}, + {type="item", name="sulfur", amount=1, probability=0.05}, + } or {{"platinum-ingot", 1}}, }, }) data:extend({ diff --git a/settings.lua b/settings.lua index ff482b6..372b36e 100644 --- a/settings.lua +++ b/settings.lua @@ -5,14 +5,21 @@ data:extend({ setting_type = "startup", default_value = "", allow_blank = true, - order = "a", + order = "a1", }, { type = "bool-setting", name = "bzgold-list", setting_type = "startup", default_value = false, - order = "b", + order = "a2", + }, + { + type = "bool-setting", + name = "bzgold-byproduct", + setting_type = "startup", + default_value = true, + order = "a3", }, { type = "bool-setting", diff --git a/thumbnail.png b/thumbnail.png index 957ccf9..d6bec24 100644 Binary files a/thumbnail.png and b/thumbnail.png differ diff --git a/thumbnail.xcf b/thumbnail.xcf index e53e0d0..b60ed8c 100644 Binary files a/thumbnail.xcf and b/thumbnail.xcf differ