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
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

View file

@ -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

View file

@ -533,6 +533,8 @@ end
function add_product(recipe, product)
if recipe ~= nil then
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}}
@ -543,6 +545,7 @@ function add_product(recipe, product)
end
end
end
end
-- Get the amount of the ingredient, will check base/normal not expensive
function util.get_ingredient_amount(recipe_name, ingredient_name)

View file

@ -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.

4
me.lua
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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