se core mining setting

This commit is contained in:
Brevven 2023-03-26 00:59:03 -07:00
parent 8770704dc1
commit 18f11ec068
8 changed files with 41 additions and 13 deletions

View file

@ -1,9 +1,11 @@
--------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------
Version: 0.0.7 Version: 0.0.7
Date: 2023-03-24 Date: 2023-03-26
Fixes: Fixes:
- Compatibility fixes for some loadouts - Compatibility fixes for some loadouts
- Fix silicon in CPUs in 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 Version: 0.0.6
Date: 2023-03-22 Date: 2023-03-22

View file

@ -12,7 +12,10 @@ local util = require("data-util");
if mods["space-exploration"] then if mods["space-exploration"] then
util.remove_product("se-core-fragment-omni", "gold-ore") util.remove_product("se-core-fragment-omni", "gold-ore")
util.remove_product("se-core-fragment-omni", "rich-copper-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 end
-- these need to be in final fixes for one reason or another -- these need to be in final fixes for one reason or another

View file

@ -533,13 +533,16 @@ end
function add_product(recipe, product) function add_product(recipe, product)
if recipe ~= nil then if recipe ~= nil then
if not recipe.normal then if (product[1] and data.raw.item[product[1]]) or
if recipe.results == nil then (product.name and data.raw[product.type][product.name]) then
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}} 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 end
recipe.result = nil
recipe.result_count = nil
table.insert(recipe.results, product)
end end
end end
end end

View file

@ -70,9 +70,11 @@ bzgold-platinum=Enable platinum processing
bzgold-palladium=Enable palladium processing bzgold-palladium=Enable palladium processing
bzgold-catalysis=Enable catalysis recipes bzgold-catalysis=Enable catalysis recipes
bzgold-alchemy=Alchemy bzgold-alchemy=Alchemy
bzgold-se-core-mining=SE core mining probability
[mod-setting-description] [mod-setting-description]
bzgold-recipe-bypass=Skip modifying these recipes (comma-separated list). 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-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-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.

4
me.lua
View file

@ -16,6 +16,10 @@ function me.alchemy()
return me.get_setting("bzgold-alchemy") return me.get_setting("bzgold-alchemy")
end end
function me.core_mining()
return me.get_setting("bzgold-se-core-mining")
end
function me.byproduct() function me.byproduct()
return me.get_setting("bzgold-byproduct") and not me.get_setting("bz-no-byproduct") return me.get_setting("bzgold-byproduct") and not me.get_setting("bz-no-byproduct")
end end

View file

@ -63,16 +63,16 @@ if util.se6() then
if util.me.platinum() then if util.me.platinum() then
util.add_ingredient("se-bioelectrics-data", "platinum-ingot", 1) 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 elseif util.me.palladium() then
util.add_ingredient("se-bioelectrics-data", "palladium-ingot", 1) 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 elseif util.me.silver() then
util.add_ingredient("se-bioelectrics-data", "silver-plate", 1) 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 else
util.add_ingredient("se-bioelectrics-data", "gold-ingot", 1) 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 end

View file

@ -137,7 +137,7 @@ if util.me.silver() then
-- small silver byproduct on copper, even if lead is enabled -- small silver byproduct on copper, even if lead is enabled
if not mods.Krastorio2 and util.me.byproduct() then 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 end
else else
if not mods.Krastorio2 then if not mods.Krastorio2 then

View file

@ -61,3 +61,17 @@ if mods.bzlead then
}, },
}) })
end 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