se matter, tech loop, prereq issue, recipes, etc
This commit is contained in:
parent
ff08e9843c
commit
d895bd8444
7 changed files with 261 additions and 92 deletions
|
|
@ -36,6 +36,10 @@ if mods.Krastorio2 then
|
|||
util.add_ingredient("basic-tech-card", "aluminum-cable", 1)
|
||||
|
||||
util.add_prerequisite("automation-science-pack", "copper-processing")
|
||||
if mods.bobassembly then
|
||||
util.set_prerequisite("basic-automation", {"kr-automation-core"})
|
||||
util.set_tech_recipe("basic-automation", {{"basic-tech-card", 1}})
|
||||
end
|
||||
end
|
||||
|
||||
if mods["aai-industry"] then
|
||||
|
|
@ -73,6 +77,9 @@ if mods["aai-industry"] and mods.Krastorio2 then
|
|||
|
||||
end
|
||||
|
||||
util.add_prerequisite("nanobots", "electronics")
|
||||
util.add_unlock_force("electronics", "RTThrower-inserter-Recipe")
|
||||
|
||||
-- Industrial Display Plates
|
||||
util.add_unlock_force("copper-processing", "copper-display-small")
|
||||
util.add_unlock_force("copper-processing", "copper-display-medium")
|
||||
|
|
@ -104,4 +111,5 @@ util.replace_ingredients_prior_to("copper-processing", "copper-cable", "aluminum
|
|||
util.replace_ingredients_prior_to("copper-processing", "copper-plate", "aluminum-plate")
|
||||
-- Any post-fixes (eg aluminum back to copper) after this block
|
||||
|
||||
|
||||
-- End of file
|
||||
|
|
|
|||
|
|
@ -5,24 +5,10 @@ if mods["space-exploration"] then
|
|||
se_delivery_cannon_recipes["aluminum-ore"] = {name= "aluminum-ore"}
|
||||
se_delivery_cannon_recipes["alumina"] = {name= "alumina"}
|
||||
se_delivery_cannon_recipes["aluminum-plate"] = {name= "aluminum-plate"}
|
||||
|
||||
data:extend({
|
||||
{
|
||||
type = "recipe",
|
||||
icons = {
|
||||
{ icon = "__base__/graphics/icons/landfill.png", icon_size = 64, icon_mipmaps = 3 },
|
||||
{ icon = "__bzaluminum__/graphics/icons/aluminum-ore.png", icon_size = 64, scale = 0.25},
|
||||
},
|
||||
name = "landfill-aluminum-ore",
|
||||
category = "hard-recycling",
|
||||
order = "z-b-aluminum",
|
||||
subgroup = "terrain",
|
||||
result = "landfill",
|
||||
ingredients = {{"aluminum-ore", 50}},
|
||||
}
|
||||
})
|
||||
util.se_landfill({ore="aluminum-ore"})
|
||||
|
||||
if string.sub(mods["space-exploration"], 1, 3) == "0.6" then
|
||||
util.se_matter({ore="aluminum-ore", energy_required=1, quant_out=10, stream_out=60})
|
||||
data:extend({
|
||||
{
|
||||
type = "item-subgroup",
|
||||
|
|
@ -125,23 +111,6 @@ else
|
|||
data.raw.item["aluminum-plate"].subgroup = "plates"
|
||||
data.raw.recipe["aluminum-plate"].subgroup = "plates"
|
||||
|
||||
|
||||
data:extend({
|
||||
{
|
||||
type = "recipe",
|
||||
icons = {
|
||||
{ icon = "__base__/graphics/icons/landfill.png", icon_size = 64, icon_mipmaps = 3 },
|
||||
{ icon = "__bzaluminum__/graphics/icons/aluminum-ore.png", icon_size = 64, scale = 0.25},
|
||||
},
|
||||
name = "landfill-aluminum-ore",
|
||||
category = "hard-recycling",
|
||||
order = "z-b-aluminum",
|
||||
subgroup = "terrain",
|
||||
result = "landfill",
|
||||
ingredients = {{"aluminum-ore", 50}},
|
||||
}
|
||||
})
|
||||
|
||||
if mods["Krastorio2"] then
|
||||
data:extend({
|
||||
{
|
||||
|
|
@ -200,7 +169,7 @@ else
|
|||
|
||||
},
|
||||
})
|
||||
if util.me.byproduct() then util.add_product("alumina-smelting-vulcanite", {"silica", 2}) end
|
||||
if util.me.byproduct() then util.add_product("alumina-smelting-vulcanite", {"silica", 2}, {force=true}) end
|
||||
table.insert(data.raw.technology["se-processing-vulcanite"].effects,
|
||||
{type = "unlock-recipe", recipe= "alumina-smelting-vulcanite"})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
local util = require("data-util");
|
||||
|
||||
|
||||
-- BZ tweak
|
||||
util.replace_some_ingredient("bronze-plate", "copper-plate", 1, "aluminum-plate", 1)
|
||||
|
||||
-- Big vanilla changes
|
||||
util.multiply_recipe("sulfur", 2)
|
||||
util.replace_some_ingredient("sulfur", "petroleum-gas", 10, "alumina", 1)
|
||||
|
|
@ -220,3 +224,11 @@ util.replace_ingredient("extreme-fast-belt", "express-transport-belt", "aluminum
|
|||
util.replace_ingredient("extreme-fast-underground-belt", "express-underground-belt", "aluminum-2219", 100)
|
||||
util.replace_ingredient("extreme-fast-belt-loader", "express-transport-belt-loader", "aluminum-2219", 50)
|
||||
|
||||
-- Bob's assembling machines
|
||||
if mods.bobassembly then
|
||||
util.replace_ingredient("burner-assembling-machine", "iron-plate", "aluminum-plate")
|
||||
util.replace_ingredient("steam-assembling-machine", "iron-plate", "aluminum-plate")
|
||||
util.add_prerequisite("electronics-machine-1", "electronics")
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ data:extend({
|
|||
},
|
||||
})
|
||||
for item, count in pairs(aluminum_6061) do
|
||||
util.add_ingredient("aluminum-6061", item, count)
|
||||
util.add_ingredient("aluminum-6061", item, count, {force=true})
|
||||
end
|
||||
util.add_prerequisite("basic-alloys", "silicon-processing")
|
||||
util.add_prerequisite("basic-alloys", "kr-silicon-processing")
|
||||
|
|
@ -400,7 +400,7 @@ data:extend({
|
|||
},
|
||||
})
|
||||
for item, count in pairs(aluminum_2219) do
|
||||
util.add_ingredient("aluminum-2219", item, count)
|
||||
util.add_ingredient("aluminum-2219", item, count, {force=true})
|
||||
end
|
||||
util.add_prerequisite("aerospace-alloys", "titanium-processing")
|
||||
util.add_prerequisite("aerospace-alloys", "zirconia-processing")
|
||||
|
|
@ -437,8 +437,8 @@ if mods.bztitanium then
|
|||
util.add_effect("laser", {type="unlock-recipe", recipe="ti-sapphire"})
|
||||
util.add_prerequisite("laser", util.titanium_processing)
|
||||
if mods.bzcarbon then
|
||||
util.add_ingredient("ti-sapphire", "diamond", 1)
|
||||
util.add_product("ti-sapphire", {type="item", name="diamond", amount=1, probability=0.8, catalyst_amount=1})
|
||||
util.add_ingredient("ti-sapphire", "diamond", 1, {force=true})
|
||||
util.add_product("ti-sapphire", {type="item", name="diamond", amount=1, probability=0.8, catalyst_amount=1}, {force=true})
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,30 @@
|
|||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.4.11
|
||||
Date: 2022-08-18
|
||||
Fixes:
|
||||
- Fix multiple prerequisite issue
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.4.10
|
||||
Date: 2022-08-17
|
||||
Fixes:
|
||||
- SE: Disable matter recipes at start
|
||||
Changes:
|
||||
- Further compatibility with bob's assemblers
|
||||
- Minor nanobots compatibility tech tree fix
|
||||
- Minor Renai Transportation compatibility tweak
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.4.9
|
||||
Date: 2022-08-16
|
||||
Features:
|
||||
- Support for SE matter fusion and SE+K2 matter liberation
|
||||
Changes:
|
||||
- With Tin, Can now bypass aluminum in bronze recipe if desired.
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.4.8
|
||||
Date: 2022-08-15
|
||||
Fixes:
|
||||
- Fix a tech loop when using Aluminum with Krastorio 2 and some of Bob's mods
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.4.6
|
||||
Date: 2022-08-15
|
||||
Fixes:
|
||||
|
|
|
|||
258
data-util.lua
258
data-util.lua
|
|
@ -47,6 +47,10 @@ function util.is_foundry()
|
|||
return mods.bzfoundry and not me.get_setting("bzfoundry-minimal")
|
||||
end
|
||||
|
||||
function should_force(options)
|
||||
return options and options.force
|
||||
end
|
||||
|
||||
|
||||
function bypass(recipe_name)
|
||||
if me.bypass[recipe_name] then return true end
|
||||
|
|
@ -85,6 +89,151 @@ function util.contains(table, sought)
|
|||
return false
|
||||
end
|
||||
|
||||
|
||||
-- se landfill
|
||||
-- params: ore, icon_size
|
||||
function util.se_landfill(params)
|
||||
if mods["space-exploration"] then
|
||||
if not params.icon_size then params.icon_size = 64 end
|
||||
local lname="landfill-"..params.ore
|
||||
data:extend({
|
||||
{
|
||||
type = "recipe",
|
||||
icons = {
|
||||
{ icon = "__base__/graphics/icons/landfill.png", icon_size = 64, icon_mipmaps = 3 },
|
||||
{ icon = "__"..me.name.."__/graphics/icons/"..params.ore..".png", icon_size = params.icon_size, scale = 0.33*64/params.icon_size},
|
||||
},
|
||||
energy_required = 1,
|
||||
enabled=false,
|
||||
name = lname,
|
||||
category = "hard-recycling",
|
||||
order = "z-b-"..params.ore,
|
||||
subgroup = "terrain",
|
||||
result = "landfill",
|
||||
ingredients = {{params.ore, 50}},
|
||||
}
|
||||
})
|
||||
util.add_unlock("se-recycling-facility", lname)
|
||||
end
|
||||
end
|
||||
|
||||
-- se matter
|
||||
-- params: ore, energy_required, quant_out, quant_in, icon_size, stream_out
|
||||
function util.se_matter(params)
|
||||
if mods["space-exploration"] > "0.6" then
|
||||
if not params.quant_in then params.quant_in = params.quant_out end
|
||||
if not params.icon_size then params.icon_size = 64 end
|
||||
local fname = "matter-fusion-"..params.ore
|
||||
local sedata = mods.Krastorio2 and "se-kr-matter-synthesis-data" or "se-fusion-test-data"
|
||||
local sejunk = mods.Krastorio2 and "se-broken-data" or "se-junk-data"
|
||||
data:extend({
|
||||
{
|
||||
type = "recipe",
|
||||
name = fname,
|
||||
localised_name = {"recipe-name.se-matter-fusion-to", {"item-name."..params.ore}},
|
||||
category = "space-materialisation",
|
||||
subgroup = "materialisation",
|
||||
order = "a-b-z",
|
||||
icons = {
|
||||
{icon = "__space-exploration-graphics__/graphics/blank.png",
|
||||
icon_size = 64, scale = 0.5},
|
||||
{icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png",
|
||||
icon_size = 64, scale = 0.33, shift = {8,-8}},
|
||||
{icon = "__"..util.me.name.."__/graphics/icons/"..params.ore..".png",
|
||||
icon_size = params.icon_size, scale = 0.33 * 64/params.icon_size, shift={-8, 8}},
|
||||
{icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png",
|
||||
icon_size = 64, scale = 0.5},
|
||||
},
|
||||
energy_required = params.energy_required,
|
||||
enabled = false,
|
||||
ingredients = {
|
||||
{sedata, 1},
|
||||
{type="fluid", name="se-particle-stream", amount=50},
|
||||
{type="fluid", name="se-space-coolant-supercooled", amount=25},
|
||||
},
|
||||
results = {
|
||||
{params.ore, params.quant_out},
|
||||
{"se-contaminated-scrap", 1},
|
||||
{type=item, name=sedata, amount=1, probability=.99},
|
||||
{type=item, name=sejunk, amount=1, probability=.01},
|
||||
{type="fluid", name="se-space-coolant-hot", amount=25, catalyst_amount=25},
|
||||
}
|
||||
}
|
||||
})
|
||||
util.add_unlock("se-space-matter-fusion", fname)
|
||||
|
||||
if mods.Krastorio2 then
|
||||
local lname = params.ore.."-to-particle-stream"
|
||||
data:extend({
|
||||
enabled = false,
|
||||
{
|
||||
type = "recipe",
|
||||
name = lname,
|
||||
localised_name = {"recipe-name.se-kr-matter-liberation", {"item-name."..params.ore}},
|
||||
category = "space-materialisation",
|
||||
subgroup = "advanced-particle-stream",
|
||||
order = "a-b-z",
|
||||
icons = {
|
||||
{icon = "__space-exploration-graphics__/graphics/blank.png",
|
||||
icon_size = 64, scale = 0.5},
|
||||
{icon = "__space-exploration-graphics__/graphics/icons/fluid/particle-stream.png",
|
||||
icon_size = 64, scale = 0.33, shift = {-8,8}},
|
||||
{icon = "__"..util.me.name.."__/graphics/icons/"..params.ore..".png",
|
||||
icon_size = params.icon_size, scale = 0.33 * 64/params.icon_size, shift={8, -8}},
|
||||
{icon = "__space-exploration-graphics__/graphics/icons/transition-arrow.png",
|
||||
icon_size = 64, scale = 0.5},
|
||||
},
|
||||
energy_required = 30,
|
||||
enabled = false,
|
||||
ingredients = {
|
||||
{"se-kr-matter-liberation-data", 1},
|
||||
{params.ore, params.quant_in},
|
||||
{type="fluid", name="se-particle-stream", amount=50},
|
||||
},
|
||||
results = {
|
||||
{type=item, name="se-kr-matter-liberation-data", amount=1, probability=.99},
|
||||
{type=item, name=sejunk, amount=1, probability=.01},
|
||||
{type="fluid", name="se-particle-stream", amount=params.stream_out, catalyst_amount=50},
|
||||
}
|
||||
}
|
||||
})
|
||||
if not data.raw.technology["bz-advanced-stream-production"] then
|
||||
data:extend({
|
||||
{
|
||||
type = "technology",
|
||||
name ="bz-advanced-stream-production",
|
||||
localised_name = {"", {"technology-name.se-kr-advanced-stream-production"}, " 2"},
|
||||
icon = "__space-exploration-graphics__/graphics/technology/material-fabricator.png",
|
||||
icon_size = 128,
|
||||
effects = {},
|
||||
unit = {
|
||||
count = 100,
|
||||
time = 15,
|
||||
ingredients = {
|
||||
{"automation-science-pack", 1},
|
||||
{"logistic-science-pack", 1},
|
||||
{"chemical-science-pack", 1},
|
||||
{"se-rocket-science-pack", 1},
|
||||
{"space-science-pack", 1},
|
||||
{"production-science-pack", 1},
|
||||
{"utility-science-pack", 1},
|
||||
{"se-astronomic-science-pack-4", 1},
|
||||
{"se-energy-science-pack-4", 1},
|
||||
{"se-material-science-pack-4", 1},
|
||||
{"matter-tech-card", 1},
|
||||
{"se-deep-space-science-pack-1", 1},
|
||||
}
|
||||
|
||||
},
|
||||
prerequisites = {"se-kr-advanced-stream-production"},
|
||||
},
|
||||
})
|
||||
end
|
||||
util.add_unlock("bz-advanced-stream-production", lname)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Set/override a technology's prerequisites
|
||||
function util.set_prerequisite(technology_name, prerequisites)
|
||||
local technology = data.raw.technology[technology_name]
|
||||
|
|
@ -103,6 +252,9 @@ function util.add_prerequisite(technology_name, prerequisite)
|
|||
local technology = data.raw.technology[technology_name]
|
||||
if technology and data.raw.technology[prerequisite] then
|
||||
if technology.prerequisites then
|
||||
for i, pre in pairs(technology.prerequisites) do
|
||||
if pre == prerequisite then return end
|
||||
end
|
||||
table.insert(technology.prerequisites, prerequisite)
|
||||
else
|
||||
technology.prerequisites = {prerequisite}
|
||||
|
|
@ -193,8 +345,8 @@ function util.set_hidden(recipe_name)
|
|||
end
|
||||
|
||||
-- Add a given quantity of ingredient to a given recipe
|
||||
function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.add_or_add_to_ingredient(recipe_name, ingredient, quantity, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
|
||||
me.add_modified(recipe_name)
|
||||
add_or_add_to_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
|
||||
|
|
@ -216,8 +368,8 @@ function add_or_add_to_ingredient(recipe, ingredient, quantity)
|
|||
end
|
||||
|
||||
-- Add a given quantity of ingredient to a given recipe
|
||||
function util.add_ingredient(recipe_name, ingredient, quantity)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.add_ingredient(recipe_name, ingredient, quantity, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
local is_fluid = not not data.raw.fluid[ingredient]
|
||||
if data.raw.recipe[recipe_name] and (data.raw.item[ingredient] or is_fluid) then
|
||||
me.add_modified(recipe_name)
|
||||
|
|
@ -243,8 +395,8 @@ function add_ingredient(recipe, ingredient, quantity, is_fluid)
|
|||
end
|
||||
|
||||
-- Add a given ingredient prototype to a given recipe
|
||||
function util.add_ingredient_raw(recipe_name, ingredient)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.add_ingredient_raw(recipe_name, ingredient, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] and (data.raw.item[ingredient.name] or data.raw.item[ingredient[1]]) then
|
||||
me.add_modified(recipe_name)
|
||||
add_ingredient_raw(data.raw.recipe[recipe_name], ingredient)
|
||||
|
|
@ -268,8 +420,8 @@ function add_ingredient_raw(recipe, ingredient)
|
|||
end
|
||||
|
||||
-- Set an ingredient to a given quantity
|
||||
function util.set_ingredient(recipe_name, ingredient, quantity)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.set_ingredient(recipe_name, ingredient, quantity, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
|
||||
me.add_modified(recipe_name)
|
||||
set_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
|
||||
|
|
@ -296,8 +448,8 @@ function set_ingredient(recipe, ingredient, quantity)
|
|||
end
|
||||
-- Add a given quantity of product to a given recipe.
|
||||
-- Only works for recipes with multiple products
|
||||
function util.add_product(recipe_name, product)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.add_product(recipe_name, product, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] and
|
||||
(data.raw.item[product[1]] or data.raw.item[product.name] or
|
||||
data.raw.fluid[product[1]] or data.raw.fluid[product.name]
|
||||
|
|
@ -368,8 +520,8 @@ end
|
|||
|
||||
-- Replace one ingredient with another in a recipe
|
||||
-- Use amount to set an amount. If that amount is a multiplier instead of an exact amount, set multiply true.
|
||||
function util.replace_ingredient(recipe_name, old, new, amount, multiply)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.replace_ingredient(recipe_name, old, new, amount, multiply, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] and (data.raw.item[new] or data.raw.fluid[new]) then
|
||||
me.add_modified(recipe_name)
|
||||
replace_ingredient(data.raw.recipe[recipe_name], old, new, amount, multiply)
|
||||
|
|
@ -411,8 +563,8 @@ function replace_ingredient(recipe, old, new, amount, multiply)
|
|||
end
|
||||
|
||||
-- Remove an ingredient from a recipe
|
||||
function util.remove_ingredient(recipe_name, old)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.remove_ingredient(recipe_name, old, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
me.add_modified(recipe_name)
|
||||
remove_ingredient(data.raw.recipe[recipe_name], old)
|
||||
|
|
@ -437,8 +589,8 @@ function remove_ingredient(recipe, old)
|
|||
end
|
||||
|
||||
-- Replace an amount of an ingredient in a recipe. Keep at least 1 of old.
|
||||
function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amount)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amount, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
local is_fluid = not not data.raw.fluid[new]
|
||||
if data.raw.recipe[recipe_name] and (data.raw.item[new] or is_fluid) then
|
||||
me.add_modified(recipe_name)
|
||||
|
|
@ -468,10 +620,10 @@ function replace_some_ingredient(recipe, old, old_amount, new, new_amount, is_fl
|
|||
end
|
||||
|
||||
-- set the amount of a product.
|
||||
function util.set_product_amount(recipe_name, product, amount)
|
||||
function util.set_product_amount(recipe_name, product, amount, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if bypass(recipe_name) then return end
|
||||
set_product_amount(data.raw.recipe[recipe_name], product, amount)
|
||||
set_product_amount(data.raw.recipe[recipe_name].normal, product, amount)
|
||||
set_product_amount(data.raw.recipe[recipe_name].expensive, product, amount)
|
||||
|
|
@ -508,10 +660,10 @@ function set_product_amount(recipe, product, amount)
|
|||
end
|
||||
|
||||
-- multiply the cost, energy, and results of a recipe by a multiple
|
||||
function util.multiply_recipe(recipe_name, multiple)
|
||||
function util.multiply_recipe(recipe_name, multiple, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if bypass(recipe_name) then return end
|
||||
multiply_recipe(data.raw.recipe[recipe_name], multiple)
|
||||
multiply_recipe(data.raw.recipe[recipe_name].normal, multiple)
|
||||
multiply_recipe(data.raw.recipe[recipe_name].expensive, multiple)
|
||||
|
|
@ -581,10 +733,10 @@ function has_ingredient(recipe, ingredient)
|
|||
end
|
||||
|
||||
-- Remove a product from a recipe, WILL NOT remove the only product
|
||||
function util.remove_product(recipe_name, old)
|
||||
function util.remove_product(recipe_name, old, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if bypass(recipe_name) then return end
|
||||
remove_product(data.raw.recipe[recipe_name], old)
|
||||
remove_product(data.raw.recipe[recipe_name].normal, old)
|
||||
remove_product(data.raw.recipe[recipe_name].expensive, old)
|
||||
|
|
@ -606,8 +758,8 @@ function remove_product(recipe, old)
|
|||
end
|
||||
end
|
||||
|
||||
function util.set_main_product(recipe_name, product)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.set_main_product(recipe_name, product, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
set_main_product(data.raw.recipe[recipe_name], product)
|
||||
set_main_product(data.raw.recipe[recipe_name].normal, product)
|
||||
|
|
@ -622,8 +774,8 @@ function set_main_product(recipe, product)
|
|||
end
|
||||
|
||||
-- Replace one product with another in a recipe
|
||||
function util.replace_product(recipe_name, old, new)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.replace_product(recipe_name, old, new, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
replace_product(data.raw.recipe[recipe_name], old, new)
|
||||
replace_product(data.raw.recipe[recipe_name].normal, old, new)
|
||||
|
|
@ -666,10 +818,10 @@ function util.remove_raw(t, name)
|
|||
end
|
||||
|
||||
-- Set energy required
|
||||
function util.set_recipe_time(recipe_name, time)
|
||||
function util.set_recipe_time(recipe_name, time, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if bypass(recipe_name) then return end
|
||||
set_recipe_time(data.raw.recipe[recipe_name], time)
|
||||
set_recipe_time(data.raw.recipe[recipe_name].normal, time)
|
||||
set_recipe_time(data.raw.recipe[recipe_name].expensive, time)
|
||||
|
|
@ -685,10 +837,10 @@ function set_recipe_time(recipe, time)
|
|||
end
|
||||
|
||||
-- Multiply energy required
|
||||
function util.multiply_time(recipe_name, factor)
|
||||
function util.multiply_time(recipe_name, factor, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if bypass(recipe_name) then return end
|
||||
multiply_time(data.raw.recipe[recipe_name], factor)
|
||||
multiply_time(data.raw.recipe[recipe_name].normal, factor)
|
||||
multiply_time(data.raw.recipe[recipe_name].expensive, factor)
|
||||
|
|
@ -704,10 +856,10 @@ function multiply_time(recipe, factor)
|
|||
end
|
||||
|
||||
-- Add to energy required
|
||||
function util.add_time(recipe_name, amount)
|
||||
function util.add_time(recipe_name, amount, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
me.add_modified(recipe_name)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if bypass(recipe_name) then return end
|
||||
add_time(data.raw.recipe[recipe_name], amount)
|
||||
add_time(data.raw.recipe[recipe_name].normal, amount)
|
||||
add_time(data.raw.recipe[recipe_name].expensive, amount)
|
||||
|
|
@ -723,8 +875,8 @@ function add_time(recipe, amount)
|
|||
end
|
||||
|
||||
-- Set recipe category
|
||||
function util.set_category(recipe_name, category)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.set_category(recipe_name, category, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw["recipe-category"][category] then
|
||||
me.add_modified(recipe_name)
|
||||
data.raw.recipe[recipe_name].category = category
|
||||
|
|
@ -732,8 +884,8 @@ function util.set_category(recipe_name, category)
|
|||
end
|
||||
|
||||
-- Set recipe subgroup
|
||||
function util.set_subgroup(recipe_name, subgroup)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.set_subgroup(recipe_name, subgroup, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
me.add_modified(recipe_name)
|
||||
data.raw.recipe[recipe_name].subgroup = subgroup
|
||||
|
|
@ -741,16 +893,16 @@ function util.set_subgroup(recipe_name, subgroup)
|
|||
end
|
||||
|
||||
-- Set item subgroup
|
||||
function util.set_item_subgroup(item, subgroup)
|
||||
if bypass(item) then return end
|
||||
function util.set_item_subgroup(item, subgroup, options)
|
||||
if not should_force(options) and bypass(item) then return end -- imperfect, close enough for now?
|
||||
if data.raw.item[item] and data.raw["item-subgroup"][subgroup] then
|
||||
data.raw.item[item].subgroup = subgroup
|
||||
end
|
||||
end
|
||||
|
||||
-- Set recipe icons
|
||||
function util.set_icons(recipe_name, icons)
|
||||
if bypass(recipe_name) then return end
|
||||
function util.set_icons(recipe_name, icons, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
me.add_modified(recipe_name)
|
||||
data.raw.recipe[recipe_name].icons = icons
|
||||
|
|
@ -768,9 +920,9 @@ function util.set_item_icons(item_name, icons)
|
|||
end
|
||||
end
|
||||
|
||||
function util.set_to_founding(recipe)
|
||||
util.set_category(recipe, "founding")
|
||||
util.set_subgroup(recipe, "foundry-intermediate")
|
||||
function util.set_to_founding(recipe, options)
|
||||
util.set_category(recipe, "founding", options)
|
||||
util.set_subgroup(recipe, "foundry-intermediate", options)
|
||||
end
|
||||
|
||||
-- Add crafting category to an entity
|
||||
|
|
@ -808,12 +960,12 @@ function add_to_ingredient(recipe, it, amount)
|
|||
end
|
||||
end
|
||||
|
||||
function util.add_to_product(recipe, product, amount)
|
||||
if bypass(recipe) then return end
|
||||
if data.raw.recipe[recipe] then
|
||||
add_to_product(data.raw.recipe[recipe], product, amount)
|
||||
add_to_product(data.raw.recipe[recipe].normal, product, amount)
|
||||
add_to_product(data.raw.recipe[recipe].expensive, product, amount)
|
||||
function util.add_to_product(recipe_name, product, amount, options)
|
||||
if not should_force(options) and bypass(recipe_name) then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
add_to_product(data.raw.recipe[recipe_name], product, amount)
|
||||
add_to_product(data.raw.recipe[recipe_name].normal, product, amount)
|
||||
add_to_product(data.raw.recipe[recipe_name].expensive, product, amount)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -936,7 +1088,7 @@ function remove_prior_unlocks(tech, recipe)
|
|||
util.remove_recipe_effect(tech, recipe)
|
||||
if technology.prerequisites then
|
||||
for i, prerequisite in pairs(technology.prerequisites) do
|
||||
-- log("BZZZ removing prior unlocks, checking " .. prerequisite)
|
||||
-- log("BZZZ removing prior unlocks for " .. tech ..", checking " .. prerequisite) -- Handy Debug :|
|
||||
remove_prior_unlocks(prerequisite, recipe)
|
||||
end
|
||||
end
|
||||
|
|
@ -954,7 +1106,7 @@ function util.replace_ingredients_prior_to(tech, old, new, multiplier)
|
|||
and (not recipe.hidden or recipe.hidden == 'true') -- probably don't want to change hidden recipes
|
||||
and string.sub(recipe.name, 1, 3) ~= 'se-' -- have to exlude SE in general :(
|
||||
then
|
||||
-- log("BZZZ due to 'enabled' replacing " .. old .. " with " .. new .." in " .. recipe.name)
|
||||
-- log("BZZZ due to 'enabled' replacing " .. old .. " with " .. new .." in " .. recipe.name) -- Handy Debug :|
|
||||
util.replace_ingredient(recipe.name, old, new, multiplier, true)
|
||||
end
|
||||
end
|
||||
|
|
@ -971,14 +1123,14 @@ function replace_ingredients_prior_to(tech, old, new, multiplier)
|
|||
if technology.effects then
|
||||
for i, effect in pairs(technology.effects) do
|
||||
if effect.type == "unlock-recipe" then
|
||||
-- log("BZZZ replacing " .. old .. " with " .. new .." in " .. effect.recipe)
|
||||
-- log("BZZZ replacing " .. old .. " with " .. new .." in " .. effect.recipe) -- Handy Debug :|
|
||||
util.replace_ingredient(effect.recipe, old, new, multiplier, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
if technology.prerequisites then
|
||||
for i, prerequisite in pairs(technology.prerequisites) do
|
||||
-- log("BZZZ checking " .. prerequisite)
|
||||
-- log("BZZZ checking " .. prerequisite) -- Handy Debug :|
|
||||
replace_ingredients_prior_to(prerequisite, old, new, multiplier)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bzaluminum",
|
||||
"version": "0.4.6",
|
||||
"version": "0.4.11",
|
||||
"factorio_version": "1.1",
|
||||
"title": "Aluminum",
|
||||
"author": "Brevven",
|
||||
|
|
@ -21,6 +21,8 @@
|
|||
"? 248k",
|
||||
"? deadlock-beltboxes-loaders",
|
||||
"? DeadlockCrating",
|
||||
"(?) bobtech",
|
||||
"(?) bobassembly",
|
||||
"(?) scattergun_turret"
|
||||
],
|
||||
"description": "Adds aluminum, alumina, cables, alloys and more to the game.\n\nCompatible with Krastorio 2 and Space Exploration. A standalone piece of BZ Mods."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue