diff --git a/changelog.txt b/changelog.txt index a13e00a..d6d350a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,9 +1,11 @@ --------------------------------------------------------------------------------------------------- Version: 0.0.7 -Date: 2023-03-24 +Date: 2023-03-26 Fixes: - Compatibility fixes for some loadouts - Fix silicon in CPUs in some loadouts + Features: + - SE: Added setting to output a very small amount of ore in Nauvis core mining, default zero. --------------------------------------------------------------------------------------------------- Version: 0.0.6 Date: 2023-03-22 diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 7ef871d..06e8aba 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -12,7 +12,10 @@ local util = require("data-util"); if mods["space-exploration"] then util.remove_product("se-core-fragment-omni", "gold-ore") util.remove_product("se-core-fragment-omni", "rich-copper-ore") - -- util.add_to_product("se-core-fragment-omni", "salt", -5) + if util.me.core_mining() > 0.0 then + util.add_product("se-core-fragment-omni", {type="item", name="gold-ore", amount=1, probability = util.me.core_mining()}) + util.add_product("se-core-fragment-omni", {type="item", name="rich-copper-ore", amount=2, probability = util.me.core_mining()}) + end end -- these need to be in final fixes for one reason or another diff --git a/data-util.lua b/data-util.lua index 68cc881..4fe0c31 100644 --- a/data-util.lua +++ b/data-util.lua @@ -533,13 +533,16 @@ end function add_product(recipe, product) if recipe ~= nil then - if not recipe.normal then - if recipe.results == nil then - recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}} + if (product[1] and data.raw.item[product[1]]) or + (product.name and data.raw[product.type][product.name]) then + if not recipe.normal then + if recipe.results == nil then + recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}} + end + recipe.result = nil + recipe.result_count = nil + table.insert(recipe.results, product) end - recipe.result = nil - recipe.result_count = nil - table.insert(recipe.results, product) end end end diff --git a/locale/en/noble.cfg b/locale/en/noble.cfg index 2982820..9ea35fa 100644 --- a/locale/en/noble.cfg +++ b/locale/en/noble.cfg @@ -70,9 +70,11 @@ bzgold-platinum=Enable platinum processing bzgold-palladium=Enable palladium processing bzgold-catalysis=Enable catalysis recipes bzgold-alchemy=Alchemy +bzgold-se-core-mining=SE core mining probability [mod-setting-description] bzgold-recipe-bypass=Skip modifying these recipes (comma-separated list). bzgold-list=If enabled, the text command [color=orange]BZList[/color] will dump a file to the script-output directory with a full list of recipes modified.\nRecommended to turn this off after you are done configuring your other settings. bzgold-byproduct=More smelting recipes output byproducts +bzgold-se-core-mining=Probability of getting a result from SE core mining. It's recommended to keep this value low. diff --git a/me.lua b/me.lua index be21017..d916a45 100644 --- a/me.lua +++ b/me.lua @@ -16,6 +16,10 @@ function me.alchemy() return me.get_setting("bzgold-alchemy") end +function me.core_mining() + return me.get_setting("bzgold-se-core-mining") +end + function me.byproduct() return me.get_setting("bzgold-byproduct") and not me.get_setting("bz-no-byproduct") end diff --git a/prototypes/recipe-updates-se.lua b/prototypes/recipe-updates-se.lua index 547e844..5376f37 100644 --- a/prototypes/recipe-updates-se.lua +++ b/prototypes/recipe-updates-se.lua @@ -63,16 +63,16 @@ if util.se6() then if util.me.platinum() then util.add_ingredient("se-bioelectrics-data", "platinum-ingot", 1) - util.add_product("se-bioelectrics-data", {type=item, name="platinum-ingot", amount=1, probability=.9}) + util.add_product("se-bioelectrics-data", {type="item", name="platinum-ingot", amount=1, probability=.9}) elseif util.me.palladium() then util.add_ingredient("se-bioelectrics-data", "palladium-ingot", 1) - util.add_product("se-bioelectrics-data", {type=item, name="palladium-ingot", amount=1, probability=.9}) + util.add_product("se-bioelectrics-data", {type="item", name="palladium-ingot", amount=1, probability=.9}) elseif util.me.silver() then util.add_ingredient("se-bioelectrics-data", "silver-plate", 1) - util.add_product("se-bioelectrics-data", {type=item, name="silver-plate", amount=1, probability=.8}) + util.add_product("se-bioelectrics-data", {type="item", name="silver-plate", amount=1, probability=.8}) else util.add_ingredient("se-bioelectrics-data", "gold-ingot", 1) - util.add_product("se-bioelectrics-data", {type=item, name="gold-ingot", amount=1, probability=.8}) + util.add_product("se-bioelectrics-data", {type="item", name="gold-ingot", amount=1, probability=.8}) end diff --git a/prototypes/silver.lua b/prototypes/silver.lua index ff07721..5db4a86 100644 --- a/prototypes/silver.lua +++ b/prototypes/silver.lua @@ -137,7 +137,7 @@ if util.me.silver() then -- small silver byproduct on copper, even if lead is enabled if not mods.Krastorio2 and util.me.byproduct() then - util.add_product("copper-plate", {type=item, name="silver-ore", amount=1, probability=0.1}) + util.add_product("copper-plate", {type="item", name="silver-ore", amount=1, probability=0.1}) end else if not mods.Krastorio2 then diff --git a/settings.lua b/settings.lua index c8e097b..f970126 100644 --- a/settings.lua +++ b/settings.lua @@ -61,3 +61,17 @@ if mods.bzlead then }, }) end + +if mods["space-exploration"] then + data:extend({ + { + type = "double-setting", + name = "bzgold-se-core-mining", + setting_type = "startup", + default_value = 0.0, + minimum_value = 0.0, + maximum_value = 1.0, + order = "d2", + }, + }) +end