Compare commits
No commits in common. "15427d0fff4dffb2c4f2a7530ebce482f6f31719" and "7905b45347038842832c90b19de84f5d91f0b5d2" have entirely different histories.
15427d0fff
...
7905b45347
|
|
@ -1,16 +1,4 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 2.0.13
|
|
||||||
Date: 09.09.2025
|
|
||||||
Changes:
|
|
||||||
|
|
||||||
- Updated Rail to remove Decorative when placed
|
|
||||||
- Updated Bob's Compatibility
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
Version: 2.0.12
|
|
||||||
Date: 05.09.2025
|
|
||||||
Changes:
|
|
||||||
- Updated Wood Rail Graphic. No more ugly Tint. (Thanks Snouz!)
|
|
||||||
---------------------------------------------------------------------------------------------------
|
|
||||||
Version: 2.0.11
|
Version: 2.0.11
|
||||||
Date: 04.09.2025
|
Date: 04.09.2025
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
|
|
|
||||||
|
|
@ -265,11 +265,9 @@ if BI.Settings.BI_Game_Tweaks_Emissions_Multiplier then
|
||||||
["solid-fuel"] = 1.00,
|
["solid-fuel"] = 1.00,
|
||||||
["solid-carbon"] = 1.05,
|
["solid-carbon"] = 1.05,
|
||||||
["carbon"] = 1.05,
|
["carbon"] = 1.05,
|
||||||
["bob-carbon"] = 1.05,
|
["wood-bricks"] = 1.20,
|
||||||
["wood-bricks"] = 1.10,
|
|
||||||
["rocket-fuel"] = 1.20,
|
["rocket-fuel"] = 1.20,
|
||||||
["bi-seed"] = 1.30,
|
["bi-seed"] = 1.30,
|
||||||
["tree-seed"] = 1.30,
|
|
||||||
["seedling"] = 1.30,
|
["seedling"] = 1.30,
|
||||||
["bi-wooden-pole-big"] = 1.30,
|
["bi-wooden-pole-big"] = 1.30,
|
||||||
["bi-wooden-pole-huge"] = 1.30,
|
["bi-wooden-pole-huge"] = 1.30,
|
||||||
|
|
@ -318,7 +316,7 @@ if mods["Krastorio2"] or mods["Krastorio2-spaced-out"] then
|
||||||
-- require more wood/wood pulp.
|
-- require more wood/wood pulp.
|
||||||
local update = {
|
local update = {
|
||||||
"wood", "bi-woodpulp",
|
"wood", "bi-woodpulp",
|
||||||
"bi-seed", "tree-seed","seedling", "water"
|
"bi-seed", "seedling", "water",
|
||||||
}
|
}
|
||||||
local multiply = function(items)
|
local multiply = function(items)
|
||||||
for _, item in pairs(items) do
|
for _, item in pairs(items) do
|
||||||
|
|
@ -359,11 +357,11 @@ if not fertilizer.place_as_tile then
|
||||||
condition_size = 1,
|
condition_size = 1,
|
||||||
condition = { layers = { water_tile = true } }
|
condition = { layers = { water_tile = true } }
|
||||||
}
|
}
|
||||||
fertilizer.icon = ICONPATH .. "fertilizer.png"
|
fertilizer.icon = ICONPATH .. "fertilizer_64.png"
|
||||||
fertilizer.icon_size = 64
|
fertilizer.icon_size = 64
|
||||||
fertilizer.icons = {
|
fertilizer.icons = {
|
||||||
{
|
{
|
||||||
icon = ICONPATH .. "fertilizer.png",
|
icon = ICONPATH .. "fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -395,7 +393,6 @@ if mods["space-exploration"] then
|
||||||
local tweaks = {
|
local tweaks = {
|
||||||
["bi-solar-mat"] = 400,
|
["bi-solar-mat"] = 400,
|
||||||
["bi-seed"] = 800,
|
["bi-seed"] = 800,
|
||||||
["tree-seed"] = 800,
|
|
||||||
["seedling"] = 400,
|
["seedling"] = 400,
|
||||||
["bi-woodpulp"] = 800,
|
["bi-woodpulp"] = 800,
|
||||||
["bi-ash"] = 400,
|
["bi-ash"] = 400,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
local BioInd = require('common')('Bio_Industries_2')
|
local BioInd = require('common')('Bio_Industries_2')
|
||||||
|
|
||||||
|
|
||||||
for var, name in pairs({
|
for var, name in pairs({
|
||||||
Bio_Cannon = "BI_Bio_Cannon",
|
Bio_Cannon = "BI_Bio_Cannon",
|
||||||
BI_Bio_Fuel = "BI_Bio_Fuel",
|
BI_Bio_Fuel = "BI_Bio_Fuel",
|
||||||
|
|
@ -19,7 +18,6 @@ end
|
||||||
|
|
||||||
BioInd.show("BI.Settings.BI_Easy_Bio_Gardens", BI.Settings.BI_Easy_Bio_Gardens)
|
BioInd.show("BI.Settings.BI_Easy_Bio_Gardens", BI.Settings.BI_Easy_Bio_Gardens)
|
||||||
local ICONPATH = "__Bio_Industries_2__/graphics/icons/"
|
local ICONPATH = "__Bio_Industries_2__/graphics/icons/"
|
||||||
local ICONPATH = BioInd.modRoot .. "/graphics/icons/"
|
|
||||||
local ICONPATH_E = BioInd.modRoot .. "/graphics/icons/entity/"
|
local ICONPATH_E = BioInd.modRoot .. "/graphics/icons/entity/"
|
||||||
local ICONPATH_PY = "__Bio_Industries_2__/graphics/icons/mod_py/"
|
local ICONPATH_PY = "__Bio_Industries_2__/graphics/icons/mod_py/"
|
||||||
|
|
||||||
|
|
@ -136,7 +134,7 @@ end
|
||||||
--- Adds Solar Farm, Solar Plant, Musk Floor, Bio Accumulator and Substation to Tech tree
|
--- Adds Solar Farm, Solar Plant, Musk Floor, Bio Accumulator and Substation to Tech tree
|
||||||
if BI.Settings.BI_Solar_Additions then
|
if BI.Settings.BI_Solar_Additions then
|
||||||
if data.raw.technology["bob-solar-energy-2"] then
|
if data.raw.technology["bob-solar-energy-2"] then
|
||||||
thxbob.lib.tech.add_recipe_unlock("bob-electric-energy-accumulators-2", "bi-bio-accumulator")
|
thxbob.lib.tech.add_recipe_unlock("bob-electric-energy-accumulators-3", "bi-bio-accumulator")
|
||||||
thxbob.lib.tech.add_recipe_unlock("electric-energy-distribution-2", "bi-large-substation")
|
thxbob.lib.tech.add_recipe_unlock("electric-energy-distribution-2", "bi-large-substation")
|
||||||
thxbob.lib.tech.add_recipe_unlock("bob-solar-energy-2", "bi-bio-solar-farm")
|
thxbob.lib.tech.add_recipe_unlock("bob-solar-energy-2", "bi-bio-solar-farm")
|
||||||
thxbob.lib.tech.add_recipe_unlock("bob-solar-energy-2", "bi-solar-boiler-hidden-panel")
|
thxbob.lib.tech.add_recipe_unlock("bob-solar-energy-2", "bi-solar-boiler-hidden-panel")
|
||||||
|
|
@ -155,40 +153,33 @@ if BI.Settings.BI_Solar_Additions then
|
||||||
|
|
||||||
--- Electric redo if Bob' Electric
|
--- Electric redo if Bob' Electric
|
||||||
-- Huge Electric Pole
|
-- Huge Electric Pole
|
||||||
if data.raw.item["bob-tinned-copper-cable"] then
|
if data.raw.item["tinned-copper-cable"] then
|
||||||
thxbob.lib.recipe.remove_ingredient("bi-wooden-pole-huge", "wood")
|
thxbob.lib.recipe.remove_ingredient("bi-wooden-pole-huge", "wood")
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-wooden-pole-huge", {
|
thxbob.lib.recipe.add_new_ingredient("bi-wooden-pole-huge", {
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "bob-tinned-copper-cable",
|
name = "tinned-copper-cable",
|
||||||
amount = 15
|
amount = 15
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Solar Farm
|
-- Solar Farm
|
||||||
if data.raw.item["bob-solar-panel-2"] then
|
if data.raw.item["solar-panel-large"] then
|
||||||
thxbob.lib.recipe.remove_ingredient("bi-bio-solar-farm", "solar-panel")
|
thxbob.lib.recipe.remove_ingredient("bi-bio-solar-farm", "solar-panel")
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-bio-solar-farm", {
|
thxbob.lib.recipe.add_new_ingredient("bi-bio-solar-farm", {
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "bob-solar-panel-2",
|
name = "solar-panel-large",
|
||||||
amount = 30
|
amount = 30
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Huge Sub Station
|
-- Huge Sub Station
|
||||||
if data.raw.item["bob-substation-3"] then
|
if data.raw.item["substation-3"] then
|
||||||
thxbob.lib.recipe.remove_ingredient("bi-large-substation", "substation")
|
thxbob.lib.recipe.remove_ingredient("bi-large-substation", "substation")
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-large-substation", {
|
thxbob.lib.recipe.add_new_ingredient("bi-large-substation", {
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "bob-substation-3",
|
name = "substation-3",
|
||||||
amount = 6
|
|
||||||
}
|
|
||||||
)
|
|
||||||
thxbob.lib.recipe.remove_ingredient("bi-large-substation", "steel-plate")
|
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-large-substation", {
|
|
||||||
type = "item",
|
|
||||||
name = "bi-wooden-pole-huge",
|
|
||||||
amount = 6
|
amount = 6
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -215,32 +206,32 @@ if BI.Settings.BI_Solar_Additions then
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if data.raw.item["bob-aluminium-plate"] then
|
if data.raw.item["aluminium-plate"] then
|
||||||
thxbob.lib.recipe.remove_ingredient("bi-bio-accumulator", "copper-cable")
|
thxbob.lib.recipe.remove_ingredient("bi-bio-accumulator", "copper-cable")
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-bio-accumulator", {
|
thxbob.lib.recipe.add_new_ingredient("bi-bio-accumulator", {
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "bob-aluminium-plate",
|
name = "aluminium-plate",
|
||||||
amount = 50
|
amount = 50
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Solar Mat
|
-- Solar Mat
|
||||||
if data.raw.item["bob-aluminium-plate"] then
|
if data.raw.item["aluminium-plate"] then
|
||||||
thxbob.lib.recipe.remove_ingredient("bi-solar-mat", "steel-plate")
|
thxbob.lib.recipe.remove_ingredient("bi-solar-mat", "steel-plate")
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-solar-mat", {
|
thxbob.lib.recipe.add_new_ingredient("bi-solar-mat", {
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "bob-aluminium-plate",
|
name = "aluminium-plate",
|
||||||
amount = 1
|
amount = 1
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if data.raw.item["bob-silicon-wafer"] then
|
if data.raw.item["silicon-wafer"] then
|
||||||
thxbob.lib.recipe.remove_ingredient("bi-solar-mat", "copper-cable")
|
thxbob.lib.recipe.remove_ingredient("bi-solar-mat", "copper-cable")
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-solar-mat", {
|
thxbob.lib.recipe.add_new_ingredient("bi-solar-mat", {
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "bob-silicon-wafer",
|
name = "silicon-wafer",
|
||||||
amount = 4
|
amount = 4
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -261,7 +252,6 @@ end
|
||||||
require("prototypes.Bio_Farm.compatible_recipes") -- Bob and Angels mesh
|
require("prototypes.Bio_Farm.compatible_recipes") -- Bob and Angels mesh
|
||||||
require("prototypes.Bio_Farm.technology2")
|
require("prototypes.Bio_Farm.technology2")
|
||||||
|
|
||||||
|
|
||||||
-- Replace fertilizer/advanced fertilizer + water with fluid fertilizers in Bio garden recipes!
|
-- Replace fertilizer/advanced fertilizer + water with fluid fertilizers in Bio garden recipes!
|
||||||
BioInd.show("data-updates.lua -- BI.Settings.BI_Easy_Bio_Gardens", BI.Settings.BI_Easy_Bio_Gardens)
|
BioInd.show("data-updates.lua -- BI.Settings.BI_Easy_Bio_Gardens", BI.Settings.BI_Easy_Bio_Gardens)
|
||||||
if BI.Settings.BI_Easy_Bio_Gardens then
|
if BI.Settings.BI_Easy_Bio_Gardens then
|
||||||
|
|
@ -335,6 +325,22 @@ if mods["Natural_Evolution_Buildings"] then
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
------------ Support for Bob's Greenhouse
|
||||||
|
if data.raw["item"]["bob-greenhouse"] then
|
||||||
|
data.raw["item"]["seedling"].place_result = "seedling"
|
||||||
|
data.raw["item"]["seedling"].icon = ICONPATH .. "Seedling.png"
|
||||||
|
data.raw["item"]["seedling"].icon_size = 64
|
||||||
|
data.raw["item"]["fertilizer"].icon = ICONPATH .. "fertilizer.png"
|
||||||
|
data.raw["item"]["fertilizer"].icon_size = 64
|
||||||
|
|
||||||
|
data.raw["item"]["fertilizer"].place_as_tile = {
|
||||||
|
result = BioInd.AB_tiles() and "vegetation-green-grass-3" or "grass-3",
|
||||||
|
condition_size = 1,
|
||||||
|
condition = { layers = { water_tile = true } }
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if settings.startup["angels-use-angels-barreling"] and settings.startup["angels-use-angels-barreling"].value then
|
if settings.startup["angels-use-angels-barreling"] and settings.startup["angels-use-angels-barreling"].value then
|
||||||
data.raw.technology["bi-tech-fertilizer"].prerequisites = {
|
data.raw.technology["bi-tech-fertilizer"].prerequisites = {
|
||||||
"bi-tech-bio-farming",
|
"bi-tech-bio-farming",
|
||||||
|
|
@ -425,9 +431,11 @@ end
|
||||||
|
|
||||||
-- We may need liquid air and nitrogen -- but not if any of the following mods is active!
|
-- We may need liquid air and nitrogen -- but not if any of the following mods is active!
|
||||||
|
|
||||||
|
|
||||||
|
local ICONPATH = BioInd.modRoot .. "/graphics/icons/"
|
||||||
|
|
||||||
-- We only want to create nitrogen if it doesn't exist yet. We then also need to create
|
-- We only want to create nitrogen if it doesn't exist yet. We then also need to create
|
||||||
-- liquid air.
|
-- liquid air.
|
||||||
--[[ Removing this for now
|
|
||||||
if not data.raw.fluid["nitrogen"] then
|
if not data.raw.fluid["nitrogen"] then
|
||||||
data:extend({
|
data:extend({
|
||||||
{
|
{
|
||||||
|
|
@ -510,225 +518,6 @@ else
|
||||||
BioInd.writeDebug("Removed recipes for \"nitrogen\" and \"liquid air\".")
|
BioInd.writeDebug("Removed recipes for \"nitrogen\" and \"liquid air\".")
|
||||||
end
|
end
|
||||||
|
|
||||||
]]
|
|
||||||
|
|
||||||
|
|
||||||
-- Replace nitrogen (BI) with bob-nitrogen (Bob's) in recipe "bi-nitrogen"
|
|
||||||
if data.raw.fluid["bob-nitrogen"] then
|
|
||||||
|
|
||||||
thxbob.lib.recipe.remove_result("bi-nitrogen", "nitrogen")
|
|
||||||
thxbob.lib.recipe.add_result("bi-nitrogen", {
|
|
||||||
type = "fluid",
|
|
||||||
name = "bob-nitrogen",
|
|
||||||
amount = 40
|
|
||||||
})
|
|
||||||
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-fertilizer-1", "nitrogen", "bob-nitrogen")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-fertilizer-2", "nitrogen", "bob-nitrogen")
|
|
||||||
|
|
||||||
BioInd.writeDebug("Update nitrogen compatibility for Bob's")
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Replace liquid-air (BI) with bob-liquid-air (Bob's) in recipe "bi-liquid-air"
|
|
||||||
if data.raw.fluid["bob-liquid-air"] then
|
|
||||||
|
|
||||||
thxbob.lib.recipe.remove_result("bi-liquid-air", "liquid-air")
|
|
||||||
thxbob.lib.recipe.add_result("bi-liquid-air", {
|
|
||||||
type = "fluid",
|
|
||||||
name = "bob-liquid-air",
|
|
||||||
amount = 100
|
|
||||||
})
|
|
||||||
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-nitrogen", "liquid-air", "bob-liquid-air")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-biomass-2", "liquid-air", "bob-liquid-air")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-biomass-3", "liquid-air", "bob-liquid-air")
|
|
||||||
|
|
||||||
BioInd.writeDebug("Update liquid-air compatibility for Bob's")
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
------------ Support for Bob's Greenhouse
|
|
||||||
-- Replace bob-fertiliser (Bob's) with fertilizer (BI) in recipe "bob-fertiliser"
|
|
||||||
if data.raw["item"]["bob-greenhouse"] then
|
|
||||||
|
|
||||||
data.raw["item"]["bob-fertiliser"].icon = ICONPATH .. "fertilizer.png"
|
|
||||||
data.raw["item"]["bob-fertiliser"].icon_size = 64
|
|
||||||
data.raw["recipe"]["bob-fertiliser"].icon = ICONPATH .. "fertilizer.png"
|
|
||||||
data.raw["recipe"]["bob-fertiliser"].icon_size = 64
|
|
||||||
|
|
||||||
thxbob.lib.recipe.remove_result("bob-fertiliser", "bob-fertiliser")
|
|
||||||
thxbob.lib.recipe.add_result("bob-fertiliser", {
|
|
||||||
type = "item",
|
|
||||||
name = "fertilizer",
|
|
||||||
amount = 1
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bob-advanced-greenhouse-cycle", "bob-fertiliser", "fertilizer")
|
|
||||||
|
|
||||||
data.raw["item"]["bob-fertiliser"].place_as_tile = {
|
|
||||||
result = BioInd.AB_tiles() and "vegetation-green-grass-3" or "grass-3",
|
|
||||||
condition_size = 1,
|
|
||||||
condition = { layers = { water_tile = true } }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
data.raw["item"]["bob-seedling"].place_result = "seedling"
|
|
||||||
data.raw["item"]["bob-seedling"].icon = ICONPATH .. "Seedling.png"
|
|
||||||
data.raw["item"]["bob-seedling"].icon_size = 64
|
|
||||||
data.raw["recipe"]["bob-seedling"].icon = ICONPATH .. "Seedling.png"
|
|
||||||
data.raw["recipe"]["bob-seedling"].icon_size = 64
|
|
||||||
data.raw["recipe"]["bob-seedling"].main_product = "seedling"
|
|
||||||
|
|
||||||
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bob-basic-greenhouse-cycle", "bob-seedling", "seedling")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bob-advanced-greenhouse-cycle", "bob-seedling", "seedling")
|
|
||||||
thxbob.lib.recipe.remove_result("bob-seedling", "bob-seedling")
|
|
||||||
thxbob.lib.recipe.add_result("bob-seedling", {
|
|
||||||
type = "item",
|
|
||||||
name = "seedling",
|
|
||||||
amount_min = 1,
|
|
||||||
amount_max = 6
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
BioInd.writeDebug("Update fertiliser compatibility for Bob's")
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
-- Replace Bob's Resin with BI Resin
|
|
||||||
if data.raw.item["bob-resin"] then
|
|
||||||
|
|
||||||
--data.raw.item["bob-resin"] = nil -- Remove Bob's resin
|
|
||||||
thxbob.lib.recipe.remove_result("bob-resin-wood", "bob-resin")
|
|
||||||
thxbob.lib.recipe.add_result("bob-resin-wood", {
|
|
||||||
type = "item",
|
|
||||||
name = "resin",
|
|
||||||
amount = 1
|
|
||||||
})
|
|
||||||
|
|
||||||
BioInd.writeDebug("Replace Bob's Resin with BI Resin in Recipe 'bob-resin-wood'")
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.raw.recipe["bob-resin-oil"] then
|
|
||||||
|
|
||||||
thxbob.lib.recipe.remove_result("bob-resin-oil", "bob-resin")
|
|
||||||
thxbob.lib.recipe.add_result("bob-resin-oil", {
|
|
||||||
type = "item",
|
|
||||||
name = "resin",
|
|
||||||
amount = 2
|
|
||||||
})
|
|
||||||
|
|
||||||
BioInd.writeDebug("Replace Bob's Resin with BI Resin in Recipe 'bob-resin-oil'")
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.raw.recipe["bob-rubber"] then
|
|
||||||
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bob-rubber", "bob-resin", "resin")
|
|
||||||
|
|
||||||
BioInd.writeDebug("Replace Bob's Resin with BI Resin in Recipe 'bob-rubber'")
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Updaet seeds to work with Space Age if present.
|
|
||||||
|
|
||||||
if data.raw.item["tree-seed"] then
|
|
||||||
|
|
||||||
--data.raw.item["bi-seed"] = nil -- We can remove BI's seed, since it won't be used.
|
|
||||||
data.raw.item["bi-seed"].plant_result = "tree-plant"
|
|
||||||
data.raw.item["bi-seed"].place_result = "tree-plant"
|
|
||||||
data.raw.item["tree-seed"].stack_size = 200 -- Update tree seed stack size
|
|
||||||
|
|
||||||
thxbob.lib.recipe.remove_result("bi-seed-1", "bi-seed")
|
|
||||||
thxbob.lib.recipe.add_result("bi-seed-1", {
|
|
||||||
type = "item",
|
|
||||||
name = "tree-seed",
|
|
||||||
amount_min = 30,
|
|
||||||
amount_max = 50
|
|
||||||
})
|
|
||||||
thxbob.lib.recipe.remove_result("bi-seed-2", "bi-seed")
|
|
||||||
thxbob.lib.recipe.add_result("bi-seed-2", {
|
|
||||||
type = "item",
|
|
||||||
name = "tree-seed",
|
|
||||||
amount_min = 40,
|
|
||||||
amount_max = 60
|
|
||||||
})
|
|
||||||
thxbob.lib.recipe.remove_result("bi-seed-3", "bi-seed")
|
|
||||||
thxbob.lib.recipe.add_result("bi-seed-3", {
|
|
||||||
type = "item",
|
|
||||||
name = "tree-seed",
|
|
||||||
amount_min = 50,
|
|
||||||
amount_max = 70
|
|
||||||
})
|
|
||||||
thxbob.lib.recipe.remove_result("bi-seed-4", "bi-seed")
|
|
||||||
thxbob.lib.recipe.add_result("bi-seed-4", {
|
|
||||||
type = "item",
|
|
||||||
name = "tree-seed",
|
|
||||||
amount_min = 60,
|
|
||||||
amount_max = 100
|
|
||||||
})
|
|
||||||
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seed-1", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seed-2", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seed-3", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seed-4", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seedling-1", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seedling-2", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seedling-3", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seedling-4", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seed-bomb-basic", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seed-bomb-standard", "bi-seed", "tree-seed")
|
|
||||||
thxbob.lib.recipe.replace_ingredient("bi-seed-bomb-advanced", "bi-seed", "tree-seed")
|
|
||||||
|
|
||||||
if data.raw.recipe["bi-seed-bomb-basic-recycling"] then
|
|
||||||
|
|
||||||
thxbob.lib.recipe.remove_result("bi-seed-bomb-basic-recycling", "bi-seed")
|
|
||||||
thxbob.lib.recipe.add_result("bi-seed-bomb-basic-recycling", {
|
|
||||||
type = "item",
|
|
||||||
name = "tree-seed",
|
|
||||||
amount = 100,
|
|
||||||
})
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.raw.recipe["bi-seed-bomb-standard-recycling"] then
|
|
||||||
|
|
||||||
thxbob.lib.recipe.remove_result("bi-seed-bomb-standard-recycling", "bi-seed")
|
|
||||||
thxbob.lib.recipe.add_result("bi-seed-bomb-standard-recycling", {
|
|
||||||
type = "item",
|
|
||||||
name = "tree-seed",
|
|
||||||
amount = 100,
|
|
||||||
})
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.raw.recipe["bi-seed-bomb-advanced-recycling"] then
|
|
||||||
|
|
||||||
thxbob.lib.recipe.remove_result("bi-seed-bomb-advanced-recycling", "bi-seed")
|
|
||||||
thxbob.lib.recipe.add_result("bi-seed-bomb-advanced-recycling", {
|
|
||||||
type = "item",
|
|
||||||
name = "tree-seed",
|
|
||||||
amount = 100,
|
|
||||||
})
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
if data.raw.item["tree-plant"] then
|
|
||||||
bobmods.lib.recipe.update_recycling_recipe({
|
|
||||||
"bi-seed-bomb-basic",
|
|
||||||
"bi-seed-bomb-standard",
|
|
||||||
"bi-seed-bomb-advanced",
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
BioInd.writeDebug("Replace BI's Seed with Space Age Tree-seed")
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Moved here from data-final-fixes.lua for 0.18.34/1.1.4! (Fixes https://mods.factorio.com/mod/Bio_Industries/discussion/5ff570bd916993002371332a)
|
-- Moved here from data-final-fixes.lua for 0.18.34/1.1.4! (Fixes https://mods.factorio.com/mod/Bio_Industries/discussion/5ff570bd916993002371332a)
|
||||||
---- Game Tweaks ---- Recipes
|
---- Game Tweaks ---- Recipes
|
||||||
if BI.Settings.BI_Game_Tweaks_Recipe then
|
if BI.Settings.BI_Game_Tweaks_Recipe then
|
||||||
|
|
@ -748,8 +537,7 @@ if BI.Settings.BI_Game_Tweaks_Recipe then
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-rail-wood", { type = "item", name = "stone-crushed", amount = 6 })
|
thxbob.lib.recipe.add_new_ingredient("bi-rail-wood", { type = "item", name = "stone-crushed", amount = 6 })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- vanilla rail update
|
-- vanilla rail recipe update
|
||||||
--- Recipe
|
|
||||||
thxbob.lib.recipe.remove_ingredient("rail", "iron-stick")
|
thxbob.lib.recipe.remove_ingredient("rail", "iron-stick")
|
||||||
thxbob.lib.recipe.add_new_ingredient("rail", { type = "item", name = "concrete", amount = 2 })
|
thxbob.lib.recipe.add_new_ingredient("rail", { type = "item", name = "concrete", amount = 2 })
|
||||||
data.raw["legacy-straight-rail"]["legacy-straight-rail"].icon = ICONPATH_E .. "rail-concrete.png"
|
data.raw["legacy-straight-rail"]["legacy-straight-rail"].icon = ICONPATH_E .. "rail-concrete.png"
|
||||||
|
|
@ -759,39 +547,6 @@ if BI.Settings.BI_Game_Tweaks_Recipe then
|
||||||
thxbob.lib.tech.add_recipe_unlock("railway", "bi-rail-wood")
|
thxbob.lib.tech.add_recipe_unlock("railway", "bi-rail-wood")
|
||||||
thxbob.lib.tech.add_recipe_unlock("railway", "bi-rail-wood-to-concrete")
|
thxbob.lib.tech.add_recipe_unlock("railway", "bi-rail-wood-to-concrete")
|
||||||
|
|
||||||
--- Update Vanilla Images - Look more like concrete
|
|
||||||
require("prototypes.Wood_Products.rail-pictures-vanilla")
|
|
||||||
data.raw["straight-rail"]["straight-rail"].pictures = new_rail_pictures_vanilla("straight")
|
|
||||||
data.raw["half-diagonal-rail"]["half-diagonal-rail"].pictures = new_rail_pictures_vanilla("half-diagonal")
|
|
||||||
data.raw["curved-rail-a"]["curved-rail-a"].pictures = new_rail_pictures_vanilla("curved-a")
|
|
||||||
data.raw["curved-rail-b"]["curved-rail-b"].pictures = new_rail_pictures_vanilla("curved-b")
|
|
||||||
--- remnants
|
|
||||||
data.raw["rail-remnants"]["straight-rail-remnants"].pictures = new_rail_remnants_pictures_vanilla("straight")
|
|
||||||
data.raw["rail-remnants"]["half-diagonal-rail-remnants"].pictures = new_rail_remnants_pictures_vanilla("half-diagonal")
|
|
||||||
data.raw["rail-remnants"]["curved-rail-a-remnants"].pictures = new_rail_remnants_pictures_vanilla("curved-a")
|
|
||||||
data.raw["rail-remnants"]["curved-rail-b-remnants"].pictures = new_rail_remnants_pictures_vanilla("curved-b")
|
|
||||||
--- Let me try and remove decoratives at the same time
|
|
||||||
data.raw["rail-planner"]["rail"].remove_decoratives = "true"
|
|
||||||
data.raw["straight-rail"]["straight-rail"].remove_decoratives = "true"
|
|
||||||
data.raw["half-diagonal-rail"]["half-diagonal-rail"].remove_decoratives = "true"
|
|
||||||
data.raw["curved-rail-a"]["curved-rail-a"].remove_decoratives = "true"
|
|
||||||
data.raw["curved-rail-b"]["curved-rail-b"].remove_decoratives = "true"
|
|
||||||
data.raw["rail-planner"]["rail"].removes_soft_decoratives = true
|
|
||||||
data.raw["straight-rail"]["straight-rail"].removes_soft_decoratives = true
|
|
||||||
data.raw["half-diagonal-rail"]["half-diagonal-rail"].removes_soft_decoratives = true
|
|
||||||
data.raw["curved-rail-a"]["curved-rail-a"].removes_soft_decoratives = true
|
|
||||||
data.raw["curved-rail-b"]["curved-rail-b"].removes_soft_decoratives = true
|
|
||||||
|
|
||||||
data.raw["rail-planner"]["bi-rail-wood"].remove_decoratives = "true"
|
|
||||||
data.raw["straight-rail"]["bi-straight-rail-wood"].remove_decoratives = "true"
|
|
||||||
data.raw["half-diagonal-rail"]["bi-half-diagonal-rail-wood"].remove_decoratives = "true"
|
|
||||||
data.raw["curved-rail-a"]["bi-curved-rail-a-wood"].remove_decoratives = "true"
|
|
||||||
data.raw["curved-rail-b"]["bi-curved-rail-b-wood"].remove_decoratives = "true"
|
|
||||||
data.raw["rail-planner"]["bi-rail-wood"].removes_soft_decoratives = true
|
|
||||||
data.raw["straight-rail"]["bi-straight-rail-wood"].removes_soft_decoratives = true
|
|
||||||
data.raw["half-diagonal-rail"]["bi-half-diagonal-rail-wood"].removes_soft_decoratives = true
|
|
||||||
data.raw["curved-rail-a"]["bi-curved-rail-a-wood"].removes_soft_decoratives = true
|
|
||||||
data.raw["curved-rail-b"]["bi-curved-rail-b-wood"].removes_soft_decoratives = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,13 @@ end
|
||||||
|
|
||||||
|
|
||||||
--- Help Files
|
--- Help Files
|
||||||
require("libs.functions") -- From Bob's Libary
|
|
||||||
require("libs.error-functions") -- From Bob's Libary
|
|
||||||
require("libs.item-functions") -- From Bob's Libary
|
require("libs.item-functions") -- From Bob's Libary
|
||||||
require("libs.recipe-functions") -- From Bob's Libary
|
require("libs.recipe-functions") -- From Bob's Libary
|
||||||
require("libs.technology-functions") -- From Bob's Libary
|
require("libs.technology-functions") -- From Bob's Libary
|
||||||
|
require("libs.functions") -- From Bob's Libary
|
||||||
require("libs.category-functions") -- From Bob's Libary
|
require("libs.category-functions") -- From Bob's Libary
|
||||||
require("libs.bi_functions") -- Functions
|
require("libs.bi_functions") -- Functions
|
||||||
|
|
||||||
require("prototypes.category")
|
require("prototypes.category")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 3.4 MiB |
|
Before Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 3.4 MiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 9 KiB After Width: | Height: | Size: 9 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 8 KiB After Width: | Height: | Size: 8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 8 KiB After Width: | Height: | Size: 8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "Bio_Industries_2",
|
"name": "Bio_Industries_2",
|
||||||
"version": "2.0.13",
|
"version": "2.0.11",
|
||||||
"factorio_version": "2.0",
|
"factorio_version": "2.0",
|
||||||
"title": "Bio Industries",
|
"title": "Bio Industries",
|
||||||
"author": "TheSAguy - Had a few Ideas, Pi-C (Programming Genius), Snouz (Graphics Wizard), Cackling Fiend - Conversion to F2.0",
|
"author": "TheSAguy - Had a few Ideas, Pi-C (Programming Genius), Snouz (Graphics Wizard), Cackling Fiend - Conversion to F2.0",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
local BioInd = require('common')('Bio_Industries_2')
|
local BioInd = require('common')('Bio_Industries_2')
|
||||||
|
|
||||||
if not thxbob.lib.machine then
|
if not thxbob.lib.machine then thxbob.lib.machine = {} end
|
||||||
thxbob.lib.machine = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.machine.has_category(machine, category_in)
|
function thxbob.lib.machine.has_category(machine, category_in)
|
||||||
local hasit = false
|
local hasit = false
|
||||||
|
|
@ -19,13 +18,13 @@ end
|
||||||
function thxbob.lib.machine.add_category(machine, category)
|
function thxbob.lib.machine.add_category(machine, category)
|
||||||
if machine and data.raw["recipe-category"][category] then
|
if machine and data.raw["recipe-category"][category] then
|
||||||
if not machine.crafting_categories then
|
if not machine.crafting_categories then
|
||||||
machine.crafting_categories = { category }
|
machine.crafting_categories = {category}
|
||||||
elseif not thxbob.lib.machine.has_category(machine, category) then
|
elseif not thxbob.lib.machine.has_category(machine, category) then
|
||||||
table.insert(machine.crafting_categories, category)
|
table.insert(machine.crafting_categories, category)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not data.raw["recipe-category"][category] then
|
if not data.raw["recipe-category"][category] then
|
||||||
log("Crafting category " .. category .. " does not exist.")
|
BioInd.writeDebug("Crafting category %s does not exist.", {category})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -37,10 +36,10 @@ function thxbob.lib.machine.if_add_category(machine, category, category_to_add)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not data.raw["recipe-category"][category] then
|
if not data.raw["recipe-category"][category] then
|
||||||
log("Crafting category " .. category .. " does not exist.")
|
BioInd.writeDebug("Crafting category %s does not exist.", {category})
|
||||||
end
|
end
|
||||||
if not data.raw["recipe-category"][category_to_add] then
|
if not data.raw["recipe-category"][category_to_add] then
|
||||||
log("Crafting category " .. category_to_add .. " does not exist.")
|
BioInd.writeDebug("Crafting category %s does not exist.", {category_to_add})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -52,14 +51,15 @@ function thxbob.lib.machine.type_if_add_category(machine_type, category, categor
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not data.raw["recipe-category"][category] then
|
if not data.raw["recipe-category"][category] then
|
||||||
log("Crafting category " .. category .. " does not exist.")
|
BioInd.writeDebug("Crafting category %s does not exist.", {category})
|
||||||
end
|
end
|
||||||
if not data.raw["recipe-category"][category_to_add] then
|
if not data.raw["recipe-category"][category_to_add] then
|
||||||
log("Crafting category " .. category_to_add .. " does not exist.")
|
BioInd.writeDebug("Crafting category %s does not exist.", {category_to_add})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function thxbob.lib.machine.has_resource_category(machine, category_in)
|
function thxbob.lib.machine.has_resource_category(machine, category_in)
|
||||||
local hasit = false
|
local hasit = false
|
||||||
if machine and machine.resource_categories then
|
if machine and machine.resource_categories then
|
||||||
|
|
@ -75,13 +75,13 @@ end
|
||||||
function thxbob.lib.machine.add_resource_category(machine, category)
|
function thxbob.lib.machine.add_resource_category(machine, category)
|
||||||
if machine and data.raw["resource-category"][category] then
|
if machine and data.raw["resource-category"][category] then
|
||||||
if not machine.resource_categories then
|
if not machine.resource_categories then
|
||||||
machine.resource_categories = { category }
|
machine.resource_categories = {category}
|
||||||
elseif not thxbob.lib.machine.has_resource_category(machine, category) then
|
elseif not thxbob.lib.machine.has_resource_category(machine, category) then
|
||||||
table.insert(machine.resource_categories, category)
|
table.insert(machine.resource_categories, category)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not data.raw["resource-category"][category] then
|
if not data.raw["resource-category"][category] then
|
||||||
log("Resource category " .. category .. " does not exist.")
|
BioInd.writeDebug("Resource category %s does not exist.", {category})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -93,10 +93,10 @@ function thxbob.lib.machine.if_add_resource_category(machine, category, category
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not data.raw["resource-category"][category] then
|
if not data.raw["resource-category"][category] then
|
||||||
log("Resource category " .. category .. " does not exist.")
|
BioInd.writeDebug("Resource category %s does not exist.", {category})
|
||||||
end
|
end
|
||||||
if not data.raw["resource-category"][category_to_add] then
|
if not data.raw["resource-category"][category_to_add] then
|
||||||
log("Resource category " .. category_to_add .. " does not exist.")
|
BioInd.writeDebug("Resource category %s does not exist.", {category_to_add})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -108,23 +108,10 @@ function thxbob.lib.machine.type_if_add_resource_category(machine_type, category
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if not data.raw["resource-category"][category] then
|
if not data.raw["resource-category"][category] then
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Resource category %s does not exist.", {category})
|
||||||
log("Resource category " .. category .. " does not exist.")
|
|
||||||
end
|
end
|
||||||
if not data.raw["resource-category"][category_to_add] then
|
if not data.raw["resource-category"][category_to_add] then
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Resource category %s does not exist.", {category_to_add})
|
||||||
log("Resource category " .. category_to_add .. " does not exist.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.machine.copy_categories_from(machine_type, from_name, to_name)
|
|
||||||
local from_machine = data.raw[machine_type][from_name]
|
|
||||||
local to_machine = data.raw[machine_type][to_name]
|
|
||||||
|
|
||||||
if from_machine and to_machine then
|
|
||||||
for _, category in pairs(from_machine.crafting_categories) do
|
|
||||||
thxbob.lib.machine.add_category(to_machine, category)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,154 +0,0 @@
|
||||||
local BioInd = require('common')('Bio_Industries_2')
|
|
||||||
|
|
||||||
if not thxbob.lib.error then
|
|
||||||
thxbob.lib.error = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.error.technology(technology, name, desc)
|
|
||||||
if name == nil then
|
|
||||||
name = "Technology"
|
|
||||||
end
|
|
||||||
if desc == nil then
|
|
||||||
desc = name
|
|
||||||
end
|
|
||||||
if technology == nil then
|
|
||||||
log(name .. " variable not passed")
|
|
||||||
elseif type(technology) == "table" then
|
|
||||||
log(name .. " variable is a table.")
|
|
||||||
elseif not (type(technology) == "string") then
|
|
||||||
log(name .. " variable not a string.")
|
|
||||||
elseif not data.raw.technology[technology] then
|
|
||||||
log(desc .. " " .. technology .. " does not exist.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.error.recipe(recipe, name, desc)
|
|
||||||
if name == nil then
|
|
||||||
name = "Recipe"
|
|
||||||
end
|
|
||||||
if desc == nil then
|
|
||||||
desc = name
|
|
||||||
end
|
|
||||||
if recipe == nil then
|
|
||||||
log(name .. " variable not passed")
|
|
||||||
elseif type(recipe) == "table" then
|
|
||||||
log(name .. " variable is a table.")
|
|
||||||
elseif not (type(recipe) == "string") then
|
|
||||||
log(name .. " variable not a string.")
|
|
||||||
elseif not data.raw.recipe[recipe] then
|
|
||||||
log(desc .. " " .. recipe .. " does not exist.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.error.resource(resource, name, desc)
|
|
||||||
if name == nil then
|
|
||||||
name = "Resource"
|
|
||||||
end
|
|
||||||
if desc == nil then
|
|
||||||
desc = name
|
|
||||||
end
|
|
||||||
if resource == nil then
|
|
||||||
log(name .. " variable not passed")
|
|
||||||
elseif type(resource) == "table" then
|
|
||||||
log(name .. " variable is a table.")
|
|
||||||
elseif not (type(resource) == "string") then
|
|
||||||
log(name .. " variable not a string.")
|
|
||||||
elseif not data.raw.resource[resource] then
|
|
||||||
log(desc .. " " .. resource .. " does not exist.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.error.item(item, name)
|
|
||||||
if name == nil then
|
|
||||||
name = "Item"
|
|
||||||
end
|
|
||||||
if item == nil then
|
|
||||||
log(name .. " variable not passed")
|
|
||||||
elseif type(item) == "table" then
|
|
||||||
log(name .. " variable is a table.")
|
|
||||||
elseif not (type(item) == "string") then
|
|
||||||
log(name .. " variable not a string.")
|
|
||||||
else
|
|
||||||
local item_type = thxbob.lib.item.get_type(item)
|
|
||||||
if not item_type then
|
|
||||||
log(name .. " " .. item .. " not a valid item of any type.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.error.item_of_type(item, item_type_in, name)
|
|
||||||
if name == nil then
|
|
||||||
name = "Item"
|
|
||||||
end
|
|
||||||
if item == nil then
|
|
||||||
log(name .. " variable not passed")
|
|
||||||
elseif type(item) == "table" then
|
|
||||||
log(name .. " variable is a table.")
|
|
||||||
elseif not (type(item) == "string") then
|
|
||||||
log(name .. " variable not a string.")
|
|
||||||
else
|
|
||||||
local item_type = thxbob.lib.item.get_type(item)
|
|
||||||
if not item_type then
|
|
||||||
log(name .. " " .. item .. " does not exist.")
|
|
||||||
elseif item_type ~= item_type_in then
|
|
||||||
log(name .. " " .. item .. " is of type: " .. item_type .. ", expected: " .. item_type_in)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.error.ingredient(ingredient, name)
|
|
||||||
if name == nil then
|
|
||||||
name = "Ingredient"
|
|
||||||
end
|
|
||||||
if ingredient == nil then
|
|
||||||
log(name .. " variable not passed")
|
|
||||||
elseif not (type(ingredient == "table")) then
|
|
||||||
log(name .. " variable not a table")
|
|
||||||
elseif not (type(ingredient.name) == "string") then
|
|
||||||
log(name .. ".name variable not a string.")
|
|
||||||
elseif thxbob.lib.item.get_type(ingredient.name) == nil then
|
|
||||||
log(name .. ".name not a valid item of any type.")
|
|
||||||
end
|
|
||||||
if not (type(ingredient.amount) == "number") then
|
|
||||||
log(name .. ".amount variable not a number.")
|
|
||||||
end
|
|
||||||
if not (ingredient.type == "item" or ingredient.type == "fluid") then
|
|
||||||
log(name .. ".type not a valid ingredient item type")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.error.result(result, name)
|
|
||||||
if name == nil then
|
|
||||||
name = "Result"
|
|
||||||
end
|
|
||||||
if result == nil then
|
|
||||||
log(name .. " variable not passed")
|
|
||||||
return
|
|
||||||
elseif not (type(result == "table")) then
|
|
||||||
log(name .. " variable not a table")
|
|
||||||
elseif not (type(result.name) == "string") then
|
|
||||||
log(name .. ".name variable not a string.")
|
|
||||||
elseif thxbob.lib.item.get_type(result.name) == nil then
|
|
||||||
log(name .. ".name not a valid item of any type.")
|
|
||||||
end
|
|
||||||
if result.amount then
|
|
||||||
if type(result.amount) == "number" then
|
|
||||||
log(name .. ".amount variable not a number.")
|
|
||||||
end
|
|
||||||
elseif result.amount_min and result.amount_max then
|
|
||||||
if not (type(result.amount_min) == "number") then
|
|
||||||
log(name .. ".amount_min variable not a number.")
|
|
||||||
end
|
|
||||||
if not (type(result.amount_max) == "number") then
|
|
||||||
log(name .. ".amount_max variable not a number.")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if result.probability then
|
|
||||||
if not (type(result.probability) == "number") then
|
|
||||||
log(name .. ".probability not a number")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if not (result.type == "item" or result.type == "fluid") then
|
|
||||||
log(name .. ".type not a valid result item type")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
local BioInd = require('common')('Bio_Industries_2')
|
local BioInd = require('common')('Bio_Industries_2')
|
||||||
|
|
||||||
|
|
||||||
-- Merges table2's contents into table1.
|
-- Merges table2's contents into table1.
|
||||||
function thxbob.lib.table_merge(table1, table2)
|
function thxbob.lib.table_merge(table1, table2)
|
||||||
for index, value in pairs(table2) do
|
for index, value in pairs(table2) do
|
||||||
|
|
@ -15,66 +16,65 @@ function thxbob.lib.table_merge(table1, table2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.minable_result_check(object)
|
|
||||||
|
-- Converts recipe.result to recipe.results!
|
||||||
|
function thxbob.lib.result_check(object)
|
||||||
|
BioInd.show("Entered function result_check", object)
|
||||||
if object then
|
if object then
|
||||||
if object.results == nil then
|
object.results = object.results or {}
|
||||||
object.results = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
if object.result then
|
if object.result then
|
||||||
local item = thxbob.lib.item.ingredient({ type = "item", name = object.result, amount = 1 })
|
local item = thxbob.lib.item.basic_item({name = object.result})
|
||||||
if object.count then
|
BioInd.show("item", item)
|
||||||
item.amount = object.count
|
if object.result_count then
|
||||||
object.count = nil
|
item.amount = object.result_count
|
||||||
|
object.result_count = nil
|
||||||
end
|
end
|
||||||
thxbob.lib.item.add_new(object.results, item)
|
|
||||||
|
|
||||||
|
BioInd.show("object.result", object.result)
|
||||||
|
thxbob.lib.item.add_new(object.results, item)
|
||||||
|
BioInd.show("object.results after add_new", object.results)
|
||||||
|
|
||||||
|
if object.ingredients then -- It's a recipe
|
||||||
|
if not object.main_product then
|
||||||
|
if object.icon or object.subgroup or object.order or item.type ~= "item" then -- if we already have one, add the rest
|
||||||
|
BioInd.writeDebug("data.raw[%s][%s]: %s", {item.type, object.result, data.raw[item.type][object.result] or "nil"})
|
||||||
|
if (not object.icon) and data.raw[item.type][object.result] and
|
||||||
|
data.raw[item.type][object.result].icon then
|
||||||
|
object.icon = data.raw[item.type][object.result].icon
|
||||||
|
object.icon_size = data.raw[item.type][object.result].icon_size
|
||||||
|
-- Make sure objects also have an icons definition
|
||||||
|
elseif not object.icons and data.raw[item.type][object.result] and
|
||||||
|
data.raw[item.type][object.result].icons and
|
||||||
|
-- Don't assume that an icon already exists,
|
||||||
|
-- it could be set later on!
|
||||||
|
data.raw[item.type][object.result].icon then
|
||||||
|
object.icons = {
|
||||||
|
{icon = data.raw[item.type][object.result].icon, icon_size = 64}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
if not object.subgroup and data.raw[item.type][object.result] and
|
||||||
|
data.raw[item.type][object.result].subgroup then
|
||||||
|
object.subgroup = data.raw[item.type][object.result].subgroup
|
||||||
|
end
|
||||||
|
if not object.order and data.raw[item.type][object.result] and
|
||||||
|
data.raw[item.type][object.result].order then
|
||||||
|
object.order = data.raw[item.type][object.result].order
|
||||||
|
end
|
||||||
|
else -- otherwise just use main_product as a cheap way to set them all.
|
||||||
|
object.main_product = object.result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
object.result = nil
|
object.result = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
log(object .. " does not exist.")
|
BioInd.writeDebug("%s does not exist.", {object})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function thxbob.lib.belt_speed_ips(ips)
|
function thxbob.lib.belt_speed_ips(ips)
|
||||||
return ips * 1 / 480
|
return ips * 1/480
|
||||||
end
|
|
||||||
|
|
||||||
--Inserts the new item into the table only if it doesn't already exist. (Index optional. Designed to insert strings only.)
|
|
||||||
function thxbob.lib.safe_insert(array, new_item, index)
|
|
||||||
local addit = true
|
|
||||||
for i, item in pairs(array) do
|
|
||||||
if item == new_item then
|
|
||||||
addit = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if addit then
|
|
||||||
if index then
|
|
||||||
table.insert(array, index, new_item)
|
|
||||||
else
|
|
||||||
table.insert(array, new_item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--takes an item/fluid/entity(maybe even recipe) and returns a complete icons array.
|
|
||||||
--if it has no icons= tag, it builds one from icon and icon_size.
|
|
||||||
--Example use thxbob.lib.icons_from_item(data.raw.item.wood)
|
|
||||||
function thxbob.lib.icons_from_item(item)
|
|
||||||
if item and type(item) == "table" then
|
|
||||||
local icons = {}
|
|
||||||
if item.icons then
|
|
||||||
icons = item.icons
|
|
||||||
elseif item.icon then
|
|
||||||
icons = { { icon = item.icon, icon_size = item.icon_size or 64 } }
|
|
||||||
else
|
|
||||||
icons = nil
|
|
||||||
log(debug.traceback())
|
|
||||||
log(item.name .. " has no valid icons.")
|
|
||||||
end
|
|
||||||
return icons
|
|
||||||
end
|
|
||||||
log(debug.traceback())
|
|
||||||
log("object does not exist.")
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,214 +1,112 @@
|
||||||
local BioInd = require('common')('Bio_Industries_2')
|
local BioInd = require('common')('Bio_Industries_2')
|
||||||
|
|
||||||
|
if not thxbob.lib.item then thxbob.lib.item = {} end
|
||||||
|
|
||||||
if not thxbob.lib.item then
|
|
||||||
thxbob.lib.item = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.item.get_type(name) --returns actual item type
|
function thxbob.lib.item.get_type(name)
|
||||||
|
local item_types = {
|
||||||
|
"ammo",
|
||||||
|
"armor",
|
||||||
|
"capsule",
|
||||||
|
"fluid",
|
||||||
|
"gun",
|
||||||
|
"item",
|
||||||
|
"module",
|
||||||
|
"tool",
|
||||||
|
"item-with-entity-data"
|
||||||
|
}
|
||||||
local item_type = nil
|
local item_type = nil
|
||||||
if type(name) == "string" then
|
for i, type_name in pairs(item_types) do
|
||||||
for type_name, _ in pairs(defines.prototypes["item"]) do
|
if data.raw[type_name][name] then item_type = type_name end
|
||||||
if data.raw[type_name] and data.raw[type_name][name] then
|
|
||||||
item_type = type_name
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if data.raw.fluid and data.raw.fluid[name] then
|
|
||||||
item_type = "fluid"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log("Item name is not a string")
|
|
||||||
end
|
end
|
||||||
return item_type
|
return item_type
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.item.get_basic_type(name) --returns fluid for fluid, item for all other types.
|
function thxbob.lib.item.get_basic_type(name)
|
||||||
local item_type = thxbob.lib.item.get_type(name)
|
|
||||||
if not (item_type == "fluid" or item_type == nil) then
|
|
||||||
item_type = "item"
|
|
||||||
end
|
|
||||||
return item_type
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.item.get_basic_type_simple(name) --assumes type is item, even if the item doesn't exist
|
|
||||||
local item_type = "item"
|
local item_type = "item"
|
||||||
if data.raw.fluid[name] then
|
if data.raw.fluid[name] then item_type = "fluid" end
|
||||||
item_type = "fluid"
|
|
||||||
end
|
|
||||||
return item_type
|
return item_type
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.item.ingredient_simple(inputs) --doesn't care if the item actually exists or not, returns if a valid ingredient structure can be determined.
|
|
||||||
|
function thxbob.lib.item.basic_item(inputs)
|
||||||
local item = {}
|
local item = {}
|
||||||
|
|
||||||
if type(inputs) == "table" then
|
if inputs.name then
|
||||||
if inputs.name and type(inputs.name) == "string" then
|
|
||||||
item.name = inputs.name
|
item.name = inputs.name
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
item.name = inputs[1]
|
||||||
log("Unable to determine an ingredient name")
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if inputs.amount and type(inputs.amount) == "number" then
|
if inputs.amount then
|
||||||
item.amount = inputs.amount
|
item.amount = inputs.amount
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
if inputs[2] then
|
||||||
log("Unable to determine an ingredient amount")
|
item.amount = inputs[2]
|
||||||
return nil
|
end
|
||||||
|
end
|
||||||
|
if not item.amount then
|
||||||
|
item.amount = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if inputs.type then
|
if inputs.type then
|
||||||
item.type = inputs.type
|
item.type = inputs.type
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
item.type = thxbob.lib.item.get_basic_type(item.name)
|
||||||
log("Unable to determine an ingredient type")
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if item.type == "item" then
|
if item.type == "item" then
|
||||||
if type(item.amount) ~= "number" or item.amount < 1 then
|
if item.amount > 0 and item.amount < 1 then
|
||||||
item.amount = 1
|
item.amount = 1
|
||||||
else
|
else
|
||||||
item.amount = math.floor(item.amount)
|
item.amount = math.floor(item.amount)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if item.type == "fluid" then
|
|
||||||
item.temperature = inputs.temperature
|
|
||||||
item.minimum_temperature = inputs.minimum_temperature
|
|
||||||
item.maximum_temperature = inputs.maximum_temperature
|
|
||||||
item.fluidbox_index = inputs.fluidbox_index
|
|
||||||
item.fluidbox_multiplier = inputs.fluidbox_multiplier
|
|
||||||
end
|
|
||||||
|
|
||||||
item.ignored_by_stats = inputs.ignored_by_stats
|
|
||||||
|
|
||||||
return item
|
return item
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.ingredient(item)
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.item.ingredient(inputs) --returns a valid ingredient only if the item exists.
|
function thxbob.lib.item.item(inputs)
|
||||||
local item = thxbob.lib.item.ingredient_simple(inputs)
|
|
||||||
if item then
|
|
||||||
return item
|
|
||||||
else
|
|
||||||
if inputs and inputs.name then
|
|
||||||
log(inputs.name)
|
|
||||||
end
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.ingredient(inputs)
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--Same as ingredient, but has support for amount_min, amount_max and probability
|
|
||||||
function thxbob.lib.item.result_simple(inputs)
|
|
||||||
local item = {}
|
local item = {}
|
||||||
|
|
||||||
if type(inputs) == "table" then
|
if inputs.name then
|
||||||
if inputs.name and type(inputs.name) == "string" then
|
|
||||||
item.name = inputs.name
|
item.name = inputs.name
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
item.name = inputs[1]
|
||||||
log("Unable to determine a result name")
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if inputs.amount and type(inputs.amount) == "number" then
|
if inputs.amount then
|
||||||
item.amount = inputs.amount
|
item.amount = inputs.amount
|
||||||
elseif inputs.amount_min and inputs.amount_max then
|
else
|
||||||
|
if inputs[2] then
|
||||||
|
item.amount = inputs[2]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not item.amount then
|
||||||
|
if inputs.amount_min and inputs.amount_max then
|
||||||
item.amount_min = inputs.amount_min
|
item.amount_min = inputs.amount_min
|
||||||
item.amount_max = inputs.amount_max
|
item.amount_max = inputs.amount_max
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
item.amount = 1
|
||||||
log("Unable to determine a result amount")
|
|
||||||
return nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if inputs.probability then
|
|
||||||
item.probability = inputs.probability
|
|
||||||
end
|
end
|
||||||
|
if inputs.probability then item.probability = inputs.probability end
|
||||||
|
|
||||||
if inputs.type then
|
if inputs.type then
|
||||||
item.type = inputs.type
|
item.type = inputs.type
|
||||||
else
|
else
|
||||||
item.type = thxbob.lib.item.get_basic_type_simple(item.name)
|
item.type = thxbob.lib.item.get_basic_type(item.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
if item.type == "item" then
|
|
||||||
if item.amount then
|
|
||||||
if type(item.amount) ~= "number" or item.amount < 1 then
|
|
||||||
item.amount = 1
|
|
||||||
else
|
|
||||||
item.amount = math.floor(item.amount)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if item.amount_min then
|
|
||||||
if type(item.amount_min) ~= "number" or item.amount_min < 1 then
|
|
||||||
item.amount_min = 0
|
|
||||||
else
|
|
||||||
item.amount_min = math.floor(item.amount_min)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if item.amount_max then
|
|
||||||
if type(item.amount_max) ~= "number" or item.amount_max < 1 then
|
|
||||||
item.amount_max = 1
|
|
||||||
else
|
|
||||||
item.amount_max = math.ceil(item.amount_max)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if item.type == "fluid" then
|
|
||||||
item.fluidbox_index = inputs.fluidbox_index
|
|
||||||
item.temperature = inputs.temperature
|
|
||||||
else
|
|
||||||
item.extra_count_fraction = inputs.extra_count_fraction
|
|
||||||
item.percent_spoiled = inputs.percent_spoiled
|
|
||||||
end
|
|
||||||
|
|
||||||
item.ignored_by_stats = inputs.ignored_by_stats
|
|
||||||
item.ignored_by_productivity = inputs.ignored_by_productivity
|
|
||||||
item.show_details_in_recipe_tooltip = inputs.show_details_in_recipe_tooltip
|
|
||||||
end
|
|
||||||
|
|
||||||
if
|
|
||||||
type(item.name) == "string"
|
|
||||||
and (type(item.amount) == "number" or (type(item.amount_min) == "number" and type(item.amount_max) == "number"))
|
|
||||||
and (item.probability == nil or type(item.probability) == "number")
|
|
||||||
and (item.type == "item" or item.type == "fluid")
|
|
||||||
then
|
|
||||||
return item
|
return item
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.result(item)
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.item.result(inputs) --returns a valid result only if the item exists.
|
|
||||||
local item = thxbob.lib.item.result_simple(inputs)
|
|
||||||
if item then
|
|
||||||
return item
|
|
||||||
else
|
|
||||||
if inputs and inputs.name then
|
|
||||||
log(inputs.name)
|
|
||||||
end
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.result(inputs)
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.item.combine(item1_in, item2_in)
|
function thxbob.lib.item.combine(item1_in, item2_in)
|
||||||
local item = {}
|
local item = {}
|
||||||
local item1 = thxbob.lib.item.result(item1_in)
|
local item1 = thxbob.lib.item.item(item1_in)
|
||||||
local item2 = thxbob.lib.item.result(item2_in)
|
local item2 = thxbob.lib.item.item(item2_in)
|
||||||
|
|
||||||
if item1 and item2 then
|
|
||||||
item.name = item1.name
|
item.name = item1.name
|
||||||
item.type = item1.type
|
item.type = item1.type
|
||||||
|
|
||||||
|
|
@ -217,13 +115,15 @@ function thxbob.lib.item.combine(item1_in, item2_in)
|
||||||
elseif item1.amount_min and item1.amount_max and item2.amount_min and item2.amount_max then
|
elseif item1.amount_min and item1.amount_max and item2.amount_min and item2.amount_max then
|
||||||
item.amount_min = item1.amount_min + item2.amount_min
|
item.amount_min = item1.amount_min + item2.amount_min
|
||||||
item.amount_max = item1.amount_max + item2.amount_max
|
item.amount_max = item1.amount_max + item2.amount_max
|
||||||
elseif item1.amount_min and item1.amount_max and item2.amount then
|
else
|
||||||
|
if item1.amount_min and item1.amount_max and item2.amount then
|
||||||
item.amount_min = item1.amount_min + item2.amount
|
item.amount_min = item1.amount_min + item2.amount
|
||||||
item.amount_max = item1.amount_max + item2.amount
|
item.amount_max = item1.amount_max + item2.amount
|
||||||
elseif item1.amount and item2.amount_min and item2.amount_max then
|
elseif item1.amount and item2.amount_min and item2.amount_max then
|
||||||
item.amount_min = item1.amount + item2.amount_min
|
item.amount_min = item1.amount + item2.amount_min
|
||||||
item.amount_max = item1.amount + item2.amount_max
|
item.amount_max = item1.amount + item2.amount_max
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if item1.probability and item2.probability then
|
if item1.probability and item2.probability then
|
||||||
item.probability = (item1.probability + item2.probability) / 2
|
item.probability = (item1.probability + item2.probability) / 2
|
||||||
|
|
@ -233,131 +133,46 @@ function thxbob.lib.item.combine(item1_in, item2_in)
|
||||||
item.probability = (item2.probability + 1) / 2
|
item.probability = (item2.probability + 1) / 2
|
||||||
end
|
end
|
||||||
|
|
||||||
if item1.ignored_by_productivity and item2.ignored_by_productivity then
|
|
||||||
item.ignored_by_productivity = item1.ignored_by_productivity + item2.ignored_by_productivity
|
|
||||||
elseif item1.ignored_by_productivity then
|
|
||||||
item.ignored_by_productivity = item1.ignored_by_productivity
|
|
||||||
elseif item2.ignored_by_productivity then
|
|
||||||
item.ignored_by_productivity = item2.ignored_by_productivity
|
|
||||||
end
|
|
||||||
|
|
||||||
if item1.ignored_by_stats and item2.ignored_by_stats then
|
|
||||||
item.ignored_by_stats = item1.ignored_by_stats + item2.ignored_by_stats
|
|
||||||
elseif item1.ignored_by_stats then
|
|
||||||
item.ignored_by_stats = item1.ignored_by_stats
|
|
||||||
elseif item2.ignored_by_stats then
|
|
||||||
item.ignored_by_stats = item2.ignored_by_stats
|
|
||||||
end
|
|
||||||
|
|
||||||
item.fluidbox_index = item1.fluidbox_index or item2.fluidbox_index
|
|
||||||
|
|
||||||
return item
|
return item
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function thxbob.lib.item.add(list, item_in) --increments amount if exists
|
function thxbob.lib.item.add(list, item_in) --increments amount if exists
|
||||||
local item = thxbob.lib.item.result(item_in)
|
local item = thxbob.lib.item.item(item_in)
|
||||||
if type(list) == "table" and item then
|
|
||||||
local addit = true
|
local addit = true
|
||||||
for i, object in pairs(list) do
|
for i, object in pairs(list) do
|
||||||
if object.name == item.name then
|
if object[1] == item.name or object.name == item.name then
|
||||||
addit = false
|
addit = false
|
||||||
list[i] = thxbob.lib.item.combine(object, item)
|
list[i] = thxbob.lib.item.combine(object, item)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if addit then
|
if addit then table.insert(list, item) end
|
||||||
table.insert(list, item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.item.add_new(list, item_in) --ignores if exists
|
function thxbob.lib.item.add_new(list, item_in) --ignores if exists
|
||||||
local item = thxbob.lib.item.result(item_in)
|
local item = thxbob.lib.item.item(item_in)
|
||||||
if type(list) == "table" and item then
|
|
||||||
local addit = true
|
local addit = true
|
||||||
for i, object in pairs(list) do
|
for i, object in pairs(list) do
|
||||||
local basic_object = thxbob.lib.item.result(object)
|
if item.name == thxbob.lib.item.basic_item(object).name then addit = false end
|
||||||
if basic_object and item.name == basic_object.name then
|
|
||||||
addit = false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
if addit then
|
if addit then
|
||||||
table.insert(list, item)
|
table.insert(list, item)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.item.remove(list, item)
|
function thxbob.lib.item.remove(list, item)
|
||||||
if type(list) == "table" and type(item) == "string" then
|
|
||||||
for i, object in ipairs(list) do
|
for i, object in ipairs(list) do
|
||||||
if object.name == item then
|
if object[1] == item or object.name == item then
|
||||||
table.remove(list, i)
|
table.remove(list, i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.item(item)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.item.set(list, item_in)
|
function thxbob.lib.item.set(list, item_in)
|
||||||
local item = thxbob.lib.item.result(item_in)
|
local item = thxbob.lib.item.item(item_in)
|
||||||
if type(list) == "table" and item then
|
|
||||||
local addit = true
|
|
||||||
for i, object in pairs(list) do
|
for i, object in pairs(list) do
|
||||||
if object.name == item.name then
|
if object[1] == item.name or object.name == item.name then
|
||||||
list[i] = item
|
list[i] = item
|
||||||
addit = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if addit then
|
|
||||||
table.insert(list, item)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.item.hide(item_name)
|
|
||||||
if type(item_name) == "string" then
|
|
||||||
local item = data.raw.item[item_name] or data.raw.fluid[item_name]
|
|
||||||
if item then
|
|
||||||
item.hidden = true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.item(item_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.item.hide_entity(type_name, entity_name)
|
|
||||||
if type(type_name) == "string" and type(entity_name) == "string" then
|
|
||||||
local entities = data.raw[type_name]
|
|
||||||
if entities then
|
|
||||||
local entity = entities[entity_name]
|
|
||||||
if entity then
|
|
||||||
entity.hidden = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.item(entity_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.item.set_subgroup(item_name, subgroup)
|
|
||||||
if type(item_name) == "string" and type(subgroup) == "string" then
|
|
||||||
local item = data.raw.item[item_name]
|
|
||||||
if item then
|
|
||||||
item.subgroup = subgroup
|
|
||||||
else
|
|
||||||
item = data.raw.fluid[item_name]
|
|
||||||
if item then
|
|
||||||
item.subgroup = subgroup
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.item(item_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
||||||
|
|
@ -1,560 +1,163 @@
|
||||||
local BioInd = require('common')('Bio_Industries_2')
|
local BioInd = require('common')('Bio_Industries_2')
|
||||||
|
|
||||||
if not thxbob.lib.recipe then
|
if not thxbob.lib.recipe then thxbob.lib.recipe = {} end
|
||||||
thxbob.lib.recipe = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function quantity_convertion(amount, old, new)
|
|
||||||
|
function thxbob.lib.recipe.replace_ingredient(recipe, old, new)
|
||||||
|
local retval = false
|
||||||
|
if data.raw.recipe[recipe] and thxbob.lib.item.get_type(new) then
|
||||||
|
|
||||||
|
local amount = 0
|
||||||
|
if data.raw.recipe[recipe].ingredients then
|
||||||
|
for i, ingredient in pairs(data.raw.recipe[recipe].ingredients) do
|
||||||
|
local item = thxbob.lib.item.basic_item(ingredient)
|
||||||
|
if item.name == old then
|
||||||
|
amount = item.amount + amount
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if amount > 0 then
|
||||||
if thxbob.lib.item.get_type(old) == "fluid" and thxbob.lib.item.get_type(new) == "item" then
|
if thxbob.lib.item.get_type(old) == "fluid" and thxbob.lib.item.get_type(new) == "item" then
|
||||||
amount = math.ceil(amount / 10)
|
amount = math.ceil(amount / 10)
|
||||||
end
|
end
|
||||||
if thxbob.lib.item.get_type(old) == "item" and thxbob.lib.item.get_type(new) == "fluid" then
|
if thxbob.lib.item.get_type(old) == "item" and thxbob.lib.item.get_type(new) == "fluid" then
|
||||||
amount = amount * 10
|
amount = amount * 10
|
||||||
end
|
end
|
||||||
return amount
|
thxbob.lib.recipe.remove_ingredient(recipe, old)
|
||||||
end
|
thxbob.lib.recipe.add_ingredient(recipe, {new, amount})
|
||||||
|
return true
|
||||||
local function get_old_quantity(ingredients, old)
|
else
|
||||||
local amount = 0
|
return false
|
||||||
for i, ingredient in pairs(ingredients) do
|
end
|
||||||
local item = thxbob.lib.item.ingredient_simple(ingredient)
|
|
||||||
if item then
|
|
||||||
if item.name == old then
|
|
||||||
amount = item.amount + amount
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log("recipe contains an invalid ingredient")
|
if not data.raw.recipe[recipe] then
|
||||||
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
end
|
end
|
||||||
end
|
if not thxbob.lib.item.get_type(new) then
|
||||||
return amount
|
BioInd.writeDebug("Ingredient %s does not exist.", {new})
|
||||||
end
|
|
||||||
|
|
||||||
local function replace_ingredient(ingredients, old, new, new_type)
|
|
||||||
local amount = get_old_quantity(ingredients, old)
|
|
||||||
if amount > 0 then
|
|
||||||
amount = quantity_convertion(amount, old, new)
|
|
||||||
thxbob.lib.item.remove(ingredients, old)
|
|
||||||
thxbob.lib.item.add(ingredients, { type = new_type, name = new, amount = amount })
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.replace_ingredient(recipe, old, new)
|
|
||||||
if type(recipe) == "string" and type(old) == "string" and type(new) == "string" and data.raw.recipe[recipe] then
|
|
||||||
local retval = false
|
|
||||||
local new_type = thxbob.lib.item.get_type(new)
|
|
||||||
|
|
||||||
if new_type and data.raw.recipe[recipe].ingredients then
|
|
||||||
new_type = new_type == "fluid" and "fluid" or "item"
|
|
||||||
if replace_ingredient(data.raw.recipe[recipe].ingredients, old, new, new_type) then
|
|
||||||
retval = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
thxbob.lib.error.item(old)
|
|
||||||
thxbob.lib.error.item(new)
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.replace_ingredient_in_all(old, new)
|
function thxbob.lib.recipe.replace_ingredient_in_all(old, new)
|
||||||
if type(old) == "string" and type(new) == "string" and thxbob.lib.item.get_type(new) then
|
if thxbob.lib.item.get_basic_type(new) then
|
||||||
for i, recipe in pairs(data.raw.recipe) do
|
for i, recipe in pairs(data.raw.recipe) do
|
||||||
thxbob.lib.recipe.replace_ingredient(recipe.name, old, new)
|
thxbob.lib.recipe.replace_ingredient(recipe.name, old, new)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Ingredient %s does not exist.", {new})
|
||||||
thxbob.lib.error.item(old)
|
|
||||||
thxbob.lib.error.item(new)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.remove_ingredient(recipe, item)
|
function thxbob.lib.recipe.remove_ingredient(recipe, item)
|
||||||
if type(recipe) == "string" and type(item) == "string" and data.raw.recipe[recipe] then
|
if data.raw.recipe[recipe] then
|
||||||
if data.raw.recipe[recipe].ingredients then
|
if data.raw.recipe[recipe].ingredients then
|
||||||
thxbob.lib.item.remove(data.raw.recipe[recipe].ingredients, item)
|
thxbob.lib.item.remove(data.raw.recipe[recipe].ingredients, item)
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
thxbob.lib.error.item(item)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.recipe.clear_ingredients(recipe)
|
|
||||||
if type(recipe) == "string" and data.raw.recipe[recipe] then
|
function thxbob.lib.recipe.add_new_ingredient(recipe, item)
|
||||||
|
if data.raw.recipe[recipe] and thxbob.lib.item.get_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
if data.raw.recipe[recipe].ingredients then
|
if data.raw.recipe[recipe].ingredients then
|
||||||
data.raw.recipe[recipe].ingredients = {}
|
thxbob.lib.item.add_new(data.raw.recipe[recipe].ingredients, thxbob.lib.item.basic_item(item))
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
if not data.raw.recipe[recipe] then
|
||||||
thxbob.lib.error.recipe(recipe)
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
|
end
|
||||||
|
if not thxbob.lib.item.get_type(item) then
|
||||||
|
BioInd.writeDebug("Ingredient %s does not exist.", {thxbob.lib.item.basic_item(item).name})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.recipe.add_new_ingredient(recipe, item_in)
|
function thxbob.lib.recipe.add_ingredient(recipe, item)
|
||||||
local item = thxbob.lib.item.ingredient(item_in)
|
if data.raw.recipe[recipe] and thxbob.lib.item.get_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
if
|
|
||||||
type(recipe) == "string"
|
|
||||||
and data.raw.recipe[recipe]
|
|
||||||
and item
|
|
||||||
and type(item) == "table"
|
|
||||||
and thxbob.lib.item.get_type(item.name)
|
|
||||||
then
|
|
||||||
if data.raw.recipe[recipe].ingredients then
|
if data.raw.recipe[recipe].ingredients then
|
||||||
thxbob.lib.item.add_new(data.raw.recipe[recipe].ingredients, item)
|
thxbob.lib.item.add(data.raw.recipe[recipe].ingredients, thxbob.lib.item.basic_item(item))
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
if not (type(recipe) == "string" and data.raw.recipe[recipe]) then
|
if not data.raw.recipe[recipe] then
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
thxbob.lib.error.recipe(recipe)
|
end
|
||||||
|
if not thxbob.lib.item.get_basic_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
|
BioInd.writeDebug("Ingredient %s does not exist.", {thxbob.lib.item.basic_item(item).name})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.recipe.add_ingredient(recipe, item_in)
|
function thxbob.lib.recipe.set_ingredient(recipe, item)
|
||||||
local item = thxbob.lib.item.ingredient(item_in)
|
if data.raw.recipe[recipe] and thxbob.lib.item.get_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
if
|
|
||||||
type(recipe) == "string"
|
|
||||||
and data.raw.recipe[recipe]
|
|
||||||
and item
|
|
||||||
and type(item) == "table"
|
|
||||||
and thxbob.lib.item.get_type(item.name)
|
|
||||||
then
|
|
||||||
if data.raw.recipe[recipe].ingredients then
|
if data.raw.recipe[recipe].ingredients then
|
||||||
thxbob.lib.item.add(data.raw.recipe[recipe].ingredients, item)
|
thxbob.lib.item.set(data.raw.recipe[recipe].ingredients, thxbob.lib.item.basic_item(item))
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
if not (type(recipe) == "string" and data.raw.recipe[recipe]) then
|
if not data.raw.recipe[recipe] then
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
thxbob.lib.error.recipe(recipe)
|
end
|
||||||
|
if not thxbob.lib.item.get_basic_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
|
BioInd.writeDebug("Ingredient %s does not exist.", {thxbob.lib.item.basic_item(item).name})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.recipe.add_ingredients(recipe, ingredients)
|
|
||||||
if type(recipe) == "string" and data.raw.recipe[recipe] and type(ingredients) == "table" then
|
|
||||||
for i, ingredient in pairs(ingredients) do
|
|
||||||
thxbob.lib.recipe.add_ingredient(recipe, ingredient)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.set_ingredient(recipe, item_in)
|
function thxbob.lib.recipe.add_result(recipe, item)
|
||||||
local item = thxbob.lib.item.ingredient(item_in)
|
if data.raw.recipe[recipe] and thxbob.lib.item.get_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
if
|
if data.raw.recipe[recipe].result or data.raw.recipe[recipe].results then
|
||||||
type(recipe) == "string"
|
thxbob.lib.result_check(data.raw.recipe[recipe])
|
||||||
and data.raw.recipe[recipe]
|
|
||||||
and item
|
|
||||||
and type(item) == "table"
|
|
||||||
and thxbob.lib.item.get_type(item.name)
|
|
||||||
then
|
|
||||||
if data.raw.recipe[recipe].ingredients then
|
|
||||||
thxbob.lib.item.set(data.raw.recipe[recipe].ingredients, item)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if not (type(recipe) == "string" and data.raw.recipe[recipe]) then
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.set_ingredients(recipe, ingredients)
|
|
||||||
if type(recipe) == "string" and data.raw.recipe[recipe] and type(ingredients) == "table" then
|
|
||||||
thxbob.lib.recipe.clear_ingredients(recipe)
|
|
||||||
thxbob.lib.recipe.add_ingredients(recipe, ingredients)
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.add_result(recipe, item_in)
|
|
||||||
local item = thxbob.lib.item.result(item_in)
|
|
||||||
if
|
|
||||||
type(recipe) == "string"
|
|
||||||
and data.raw.recipe[recipe]
|
|
||||||
and item
|
|
||||||
and type(item) == "table"
|
|
||||||
and thxbob.lib.item.get_type(item.name)
|
|
||||||
then
|
|
||||||
if data.raw.recipe[recipe].results then
|
|
||||||
thxbob.lib.item.add(data.raw.recipe[recipe].results, item)
|
thxbob.lib.item.add(data.raw.recipe[recipe].results, item)
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
if not (type(recipe) == "string" and data.raw.recipe[recipe]) then
|
if not data.raw.recipe[recipe] then
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
thxbob.lib.error.recipe(recipe)
|
end
|
||||||
|
if not thxbob.lib.item.get_basic_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
|
BioInd.writeDebug("Item %s does not exist.", {thxbob.lib.item.basic_item(item).name})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.recipe.set_result(recipe, item_in)
|
function thxbob.lib.recipe.set_result(recipe, item)
|
||||||
local item = thxbob.lib.item.result(item_in)
|
if data.raw.recipe[recipe] and thxbob.lib.item.get_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
if
|
if data.raw.recipe[recipe].result or data.raw.recipe[recipe].results then
|
||||||
type(recipe) == "string"
|
thxbob.lib.result_check(data.raw.recipe[recipe])
|
||||||
and data.raw.recipe[recipe]
|
|
||||||
and item
|
|
||||||
and type(item) == "table"
|
|
||||||
and thxbob.lib.item.get_type(item.name)
|
|
||||||
then
|
|
||||||
if data.raw.recipe[recipe].results then
|
|
||||||
thxbob.lib.item.set(data.raw.recipe[recipe].results, item)
|
thxbob.lib.item.set(data.raw.recipe[recipe].results, item)
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
if not (type(recipe) == "string" and data.raw.recipe[recipe]) then
|
if not data.raw.recipe[recipe] then
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
thxbob.lib.error.recipe(recipe)
|
end
|
||||||
|
if not thxbob.lib.item.get_basic_type(thxbob.lib.item.basic_item(item).name) then
|
||||||
|
BioInd.writeDebug("Item %s does not exist.", {thxbob.lib.item.basic_item(item).name})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.recipe.remove_result(recipe, item)
|
function thxbob.lib.recipe.remove_result(recipe, item)
|
||||||
if type(recipe) == "string" and type(item) == "string" and data.raw.recipe[recipe] then
|
local f_name = "remove_result"
|
||||||
if data.raw.recipe[recipe].results then
|
BioInd.writeDebug("Entered function %s(%s, %s)", {f_name, recipe, item})
|
||||||
|
if data.raw.recipe[recipe] then
|
||||||
|
if data.raw.recipe[recipe].result or data.raw.recipe[recipe].results then
|
||||||
|
thxbob.lib.result_check(data.raw.recipe[recipe])
|
||||||
thxbob.lib.item.remove(data.raw.recipe[recipe].results, item)
|
thxbob.lib.item.remove(data.raw.recipe[recipe].results, item)
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
thxbob.lib.error.item(item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.enabled(recipe, bool)
|
|
||||||
if type(recipe) == "string" and type(bool) == "boolean" and data.raw.recipe[recipe] then
|
|
||||||
data.raw.recipe[recipe].enabled = bool or false
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
if not (type(bool) == "boolean") then
|
|
||||||
log("Variable Bool is missing or not of type Boolean")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.hide(recipe)
|
|
||||||
if type(recipe) == "string" and data.raw.recipe[recipe] then
|
|
||||||
local prototype = data.raw.recipe[recipe]
|
|
||||||
prototype.hidden = true
|
|
||||||
prototype.enabled = false
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.set_energy_required(recipe, time)
|
|
||||||
if type(recipe) == "string" and type(time) == "number" and data.raw.recipe[recipe] then
|
|
||||||
data.raw.recipe[recipe].energy_required = time
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
if not (type(time) == "number") then
|
|
||||||
log("Variable Time is missing or not of type Number")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function duplicate_ingredient_check(recipe_name, ingredients)
|
|
||||||
local new_ingredients = {}
|
|
||||||
local items = {}
|
|
||||||
local rebuild = false
|
|
||||||
for i, ingredient in ipairs(ingredients) do
|
|
||||||
local item = thxbob.lib.item.ingredient(ingredient)
|
|
||||||
if item then -- duplicate value
|
|
||||||
if items[item.name] then
|
|
||||||
rebuild = true
|
|
||||||
log("Duplicate item " .. item.name .. " found on recipe " .. recipe_name .. ".")
|
|
||||||
else
|
|
||||||
items[item.name] = true
|
|
||||||
thxbob.lib.item.add(new_ingredients, ingredient)
|
|
||||||
end
|
|
||||||
else --invalid value
|
|
||||||
rebuild = true
|
|
||||||
log("Invalid item found on recipe " .. recipe_name .. ".")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if rebuild == true then
|
|
||||||
return new_ingredients
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function duplicate_ingredient_check_full(recipe)
|
|
||||||
if type(recipe) == "string" and data.raw.recipe[recipe] then
|
|
||||||
if data.raw.recipe[recipe].ingredients then
|
|
||||||
local ingredients = duplicate_ingredient_check(recipe, data.raw.recipe[recipe].ingredients)
|
|
||||||
if ingredients then
|
|
||||||
data.raw.recipe[recipe].ingredients = ingredients
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.ingredients_cleanup()
|
|
||||||
log("Running recipe ingredients cleanup...")
|
|
||||||
for recipe_name, recipe in pairs(data.raw.recipe) do
|
|
||||||
duplicate_ingredient_check_full(recipe_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.set_subgroup(recipe_name, subgroup)
|
|
||||||
if type(recipe_name) == "string" and type(subgroup) == "string" then
|
|
||||||
local recipe = data.raw.recipe[recipe_name]
|
|
||||||
if recipe then
|
|
||||||
recipe.subgroup = subgroup
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.set_category(recipe_name, category)
|
|
||||||
if type(recipe_name) == "string" and type(category) == "string" then
|
|
||||||
local recipe = data.raw.recipe[recipe_name]
|
|
||||||
if recipe then
|
|
||||||
recipe.category = category
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.allow_productivity(recipe_name)
|
|
||||||
if type(recipe_name) == "string" then
|
|
||||||
local recipe = data.raw.recipe[recipe_name]
|
|
||||||
if recipe then
|
|
||||||
recipe.allow_productivity = true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.disallow_productivity(recipe_name)
|
|
||||||
if type(recipe_name) == "string" then
|
|
||||||
local recipe = data.raw.recipe[recipe_name]
|
|
||||||
if recipe then
|
|
||||||
recipe.allow_productivity = false
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.add_additional_category(recipe_name, category_name)
|
|
||||||
local recipe = data.raw.recipe[recipe_name]
|
|
||||||
local category = data.raw["recipe-category"][category_name]
|
|
||||||
if recipe and category then
|
|
||||||
recipe.additional_categories = recipe.additional_categories or {}
|
|
||||||
thxbob.lib.safe_insert(recipe.additional_categories, category_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if mods["quality"] then
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe_icon(recipe_name, icon_name, size)
|
|
||||||
--Does not handle multiple icons
|
|
||||||
local target_recipe = data.raw.recipe[recipe_name]
|
|
||||||
local image_size = size or 64
|
|
||||||
if type(icon_name) == "string" then
|
|
||||||
if target_recipe then
|
|
||||||
target_recipe.icons[2].icon = icon_name
|
|
||||||
target_recipe.icons[2].icon_size = image_size
|
|
||||||
target_recipe.icons[2].scale = 0.4 / (image_size / 64)
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
log("Recycling recipe " .. recipe_name .. " not found")
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
log("Invalid icon input")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe_single(recipe_name, replace_icon)
|
|
||||||
--Requires that the target recycling recipe's prefix is the same as the source used for recipe_name
|
|
||||||
if type(recipe_name) == "string" then
|
|
||||||
local target_recipe_name = recipe_name .. "-recycling"
|
|
||||||
local source_recipe = data.raw.recipe[recipe_name]
|
|
||||||
local target_recipe = data.raw.recipe[target_recipe_name]
|
|
||||||
if source_recipe then
|
|
||||||
if target_recipe then
|
|
||||||
local new_time = source_recipe.energy_required or 0.5
|
|
||||||
target_recipe.energy_required = new_time / 16
|
|
||||||
target_recipe.results = {}
|
|
||||||
local source_output_amount = 1
|
|
||||||
for i, source_results in pairs(source_recipe.results) do
|
|
||||||
if source_results.name == recipe_name then
|
|
||||||
source_output_amount = source_results.amount
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for i, outputs in pairs(source_recipe.ingredients) do
|
|
||||||
if source_recipe.ingredients[i].type == "item" then
|
|
||||||
table.insert(target_recipe.results, {
|
|
||||||
type = "item",
|
|
||||||
name = source_recipe.ingredients[i].name,
|
|
||||||
amount = source_recipe.ingredients[i].amount / source_output_amount / 4,
|
|
||||||
extra_count_fraction = source_recipe.ingredients[i].amount / source_output_amount % 4 / 4,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--Tries to find replacement icon if item of same name exists. If not, icon replacement will have do be done manually if desired.
|
|
||||||
if replace_icon == true then
|
|
||||||
local item_type = thxbob.lib.item.get_type(recipe_name)
|
|
||||||
local recipe_icon = target_recipe.icons[2].icon
|
|
||||||
local recipe_icon_size = target_recipe.icons[2].icon_size or 64
|
|
||||||
if item_type and data.raw[item_type][recipe_name] then
|
|
||||||
if data.raw[item_type][recipe_name].icon then
|
|
||||||
recipe_icon = data.raw[item_type][recipe_name].icon
|
|
||||||
recipe_icon_size = data.raw[item_type][recipe_name].icon_size or 64
|
|
||||||
thxbob.lib.recipe.update_recycling_recipe_icon(target_recipe_name, recipe_icon, recipe_icon_size)
|
|
||||||
elseif data.raw[item_type][recipe_name].icons then
|
|
||||||
target_recipe.icons = { { icon = "__quality__/graphics/icons/recycling.png" } }
|
|
||||||
for i, icon_replacement in pairs(data.raw[item_type][recipe_name].icons) do
|
|
||||||
local image_size = icon_replacement.icon_size or 64
|
|
||||||
local image_scale = icon_replacement.scale or 1
|
|
||||||
table.insert(target_recipe.icons, {
|
|
||||||
icon = icon_replacement.icon,
|
|
||||||
icon_size = image_size,
|
|
||||||
scale = 0.4 * image_scale / (image_size / 64),
|
|
||||||
shift = util.mul_shift(icon_replacement.shift, 0.8),
|
|
||||||
tint = icon_replacement.tint,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
table.insert(target_recipe.icons, { icon = "__quality__/graphics/icons/recycling-top.png" })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
log("Recycling recipe " .. target_recipe_name .. " not found")
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe_name)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recipe_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe(recipe_name)
|
|
||||||
if type(recipe_name) == "string" then
|
|
||||||
thxbob.lib.recipe.update_recycling_recipe_single(recipe_name, true)
|
|
||||||
end
|
|
||||||
if type(recipe_name) == "table" then
|
|
||||||
for i, single_recipe in pairs(recipe_name) do
|
|
||||||
thxbob.lib.recipe.update_recycling_recipe_single(single_recipe, true)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe_from_recipe(recycling_recipe, desired_recipe, replace_icon)
|
|
||||||
if
|
|
||||||
type(recycling_recipe) == "string"
|
|
||||||
and data.raw.recipe[recycling_recipe]
|
|
||||||
and string.sub(data.raw.recipe[recycling_recipe].name, -10) == "-recycling"
|
|
||||||
then
|
|
||||||
if type(desired_recipe) == "string" and data.raw.recipe[desired_recipe] then
|
|
||||||
local item_name = string.sub(recycling_recipe, 1, -11)
|
|
||||||
local target_recipe = data.raw.recipe[recycling_recipe]
|
|
||||||
local source_recipe = data.raw.recipe[desired_recipe]
|
|
||||||
local new_time = source_recipe.energy_required or 0.5
|
|
||||||
target_recipe.energy_required = new_time / 16
|
|
||||||
target_recipe.results = {}
|
|
||||||
local source_output_amount = 1
|
|
||||||
for i, source_results in pairs(source_recipe.results) do
|
|
||||||
if source_results.name == item_name then
|
|
||||||
source_output_amount = source_results.amount
|
|
||||||
end
|
|
||||||
end
|
|
||||||
for i, outputs in pairs(source_recipe.ingredients) do
|
|
||||||
if source_recipe.ingredients[i].type == "item" then
|
|
||||||
table.insert(target_recipe.results, {
|
|
||||||
type = "item",
|
|
||||||
name = source_recipe.ingredients[i].name,
|
|
||||||
amount = source_recipe.ingredients[i].amount / source_output_amount / 4,
|
|
||||||
extra_count_fraction = source_recipe.ingredients[i].amount / source_output_amount % 4 / 4,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if replace_icon == true then
|
|
||||||
local item_type = thxbob.lib.item.get_type(item_name)
|
|
||||||
local recipe_icon = target_recipe.icons[2].icon
|
|
||||||
local recipe_icon_size = target_recipe.icons[2].icon_size or 64
|
|
||||||
if item_type and data.raw[item_type][item_name] then
|
|
||||||
if data.raw[item_type][item_name].icon then
|
|
||||||
recipe_icon = data.raw[item_type][item_name].icon
|
|
||||||
recipe_icon_size = data.raw[item_type][item_name].icon_size or 64
|
|
||||||
thxbob.lib.recipe.update_recycling_recipe_icon(recycling_recipe, recipe_icon, recipe_icon_size)
|
|
||||||
elseif data.raw[item_type][item_name].icons then
|
|
||||||
target_recipe.icons = { { icon = "__quality__/graphics/icons/recycling.png" } }
|
|
||||||
for i, icon_replacement in pairs(data.raw[item_type][item_name].icons) do
|
|
||||||
local image_size = icon_replacement.icon_size or 64
|
|
||||||
local image_scale = icon_replacement.scale or 1
|
|
||||||
table.insert(target_recipe.icons, {
|
|
||||||
icon = icon_replacement.icon,
|
|
||||||
icon_size = image_size,
|
|
||||||
scale = 0.4 * image_scale / (image_size / 64),
|
|
||||||
shift = util.mul_shift(icon_replacement.shift, 0.8),
|
|
||||||
tint = icon_replacement.tint,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
table.insert(target_recipe.icons, { icon = "__quality__/graphics/icons/recycling-top.png" })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(desired_recipe)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.recipe(recycling_recipe)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe_icon()
|
|
||||||
log(debug.traceback())
|
|
||||||
log("Improper function call. Cannot update recycling without Quality mod.")
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe_single()
|
|
||||||
log(debug.traceback())
|
|
||||||
log("Improper function call. Cannot update recycling without Quality mod.")
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe()
|
|
||||||
log(debug.traceback())
|
|
||||||
log("Improper function call. Cannot update recycling without Quality mod.")
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe_to_self_recipe()
|
|
||||||
log(debug.traceback())
|
|
||||||
log("Improper function call. Cannot update recycling without Quality mod.")
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.recipe.update_recycling_recipe_from_recipe()
|
|
||||||
log(debug.traceback())
|
|
||||||
log("Improper function call. Cannot update recycling without Quality mod.")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1,419 +1,173 @@
|
||||||
local BioInd = require('common')('Bio_Industries_2')
|
local BioInd = require('common')('Bio_Industries_2')
|
||||||
|
|
||||||
if not thxbob.lib.tech then
|
if not thxbob.lib.tech then thxbob.lib.tech = {} end
|
||||||
thxbob.lib.tech = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
local function add_new_science_pack(technology, pack, amount)
|
|
||||||
if technology.unit and technology.unit.ingredients then
|
|
||||||
local addit = true
|
|
||||||
for i, ingredient in pairs(technology.unit.ingredients) do
|
|
||||||
if ingredient[1] == pack then
|
|
||||||
addit = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if addit then
|
|
||||||
table.insert(technology.unit.ingredients, { pack, amount })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function add_science_pack(technology, pack, amount)
|
function thxbob.lib.tech.replace_science_pack(technology, old, new)
|
||||||
if technology.unit and technology.unit.ingredients then
|
if data.raw.technology[technology] and data.raw.tool[new] then
|
||||||
local addit = true
|
|
||||||
for i, ingredient in pairs(technology.unit.ingredients) do
|
|
||||||
if ingredient[1] == pack then
|
|
||||||
addit = false
|
|
||||||
ingredient[2] = ingredient[2] + amount
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if addit then
|
|
||||||
table.insert(technology.unit.ingredients, { pack, amount })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function remove_science_pack(technology, pack)
|
|
||||||
if technology.unit and technology.unit.ingredients then
|
|
||||||
for i, ingredient in pairs(technology.unit.ingredients) do
|
|
||||||
if ingredient[1] == pack then
|
|
||||||
table.remove(technology.unit.ingredients, i)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function replace_science_pack(technology, old, new)
|
|
||||||
if technology.unit and technology.unit.ingredients then
|
|
||||||
local doit = false
|
local doit = false
|
||||||
local amount = 0
|
local amount = 0
|
||||||
for i, ingredient in pairs(technology.unit.ingredients) do
|
for i, ingredient in pairs(data.raw.technology[technology].unit.ingredients) do
|
||||||
if ingredient[1] == old then
|
if ingredient[1] == old then
|
||||||
doit = true
|
doit = true
|
||||||
amount = ingredient[2] + amount
|
amount = ingredient[2] + amount
|
||||||
end
|
end
|
||||||
|
if ingredient.name == old then
|
||||||
|
doit = true
|
||||||
|
amount = ingredient.amount + amount
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if doit then
|
if doit then
|
||||||
remove_science_pack(technology, old)
|
thxbob.lib.tech.remove_science_pack(technology, old)
|
||||||
add_science_pack(technology, new, amount)
|
thxbob.lib.tech.add_science_pack(technology, new, amount)
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.replace_science_pack(technology, old, new)
|
|
||||||
if
|
|
||||||
type(technology) == "string"
|
|
||||||
and type(old) == "string"
|
|
||||||
and type(new) == "string"
|
|
||||||
and data.raw.technology[technology]
|
|
||||||
-- data.raw.tool[old] and
|
|
||||||
and data.raw.tool[new]
|
|
||||||
then
|
|
||||||
if data.raw.technology[technology].unit then
|
|
||||||
replace_science_pack(data.raw.technology[technology], old, new)
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
if not data.raw.technology[technology] then
|
||||||
thxbob.lib.error.technology(technology)
|
BioInd.writeDebug("Technology %s does not exist.", {technology})
|
||||||
thxbob.lib.error.item_of_type(old, "tool", "Old science pack")
|
end
|
||||||
thxbob.lib.error.item_of_type(new, "tool", "New science pack")
|
if not data.raw.tool[new] then
|
||||||
|
BioInd.writeDebug("Science pack %s does not exist.", {new})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.tech.add_new_science_pack(technology, pack, amount)
|
function thxbob.lib.tech.add_new_science_pack(technology, pack, amount)
|
||||||
if
|
if data.raw.technology[technology] and data.raw.tool[pack] then
|
||||||
type(technology) == "string"
|
local addit = true
|
||||||
and type(pack) == "string"
|
for i, ingredient in pairs(data.raw.technology[technology].unit.ingredients) do
|
||||||
and type(amount) == "number"
|
if ingredient[1] == pack or ingredient.name == pack then addit = false end
|
||||||
and data.raw.technology[technology]
|
|
||||||
and data.raw.tool[pack]
|
|
||||||
then
|
|
||||||
if data.raw.technology[technology].unit then
|
|
||||||
add_new_science_pack(data.raw.technology[technology], pack, amount)
|
|
||||||
end
|
end
|
||||||
|
if addit then table.insert(data.raw.technology[technology].unit.ingredients, {pack, amount}) end
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
if not data.raw.technology[technology] then
|
||||||
thxbob.lib.error.technology(technology)
|
BioInd.writeDebug("Technology %s does not exist.", {technology})
|
||||||
thxbob.lib.error.item_of_type(pack, "tool", "Science pack")
|
end
|
||||||
|
if not data.raw.tool[pack] then
|
||||||
|
BioInd.writeDebug("Science pack %s does not exist.", {pack})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.tech.add_science_pack(technology, pack, amount)
|
function thxbob.lib.tech.add_science_pack(technology, pack, amount)
|
||||||
if
|
if data.raw.technology[technology] and data.raw.tool[pack] then
|
||||||
type(technology) == "string"
|
local addit = true
|
||||||
and type(pack) == "string"
|
for i, ingredient in pairs(data.raw.technology[technology].unit.ingredients) do
|
||||||
and type(amount) == "number"
|
if ingredient[1] == pack then
|
||||||
and data.raw.technology[technology]
|
addit = false
|
||||||
and data.raw.tool[pack]
|
ingredient[2] = ingredient[2] + amount
|
||||||
then
|
end
|
||||||
if data.raw.technology[technology].unit then
|
if ingredient.name == pack then
|
||||||
add_science_pack(data.raw.technology[technology], pack, amount)
|
addit = false
|
||||||
|
ingredient.amount = ingredient.amount + amount
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if addit then
|
||||||
|
table.insert(data.raw.technology[technology].unit.ingredients, {pack, amount})
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
if not data.raw.technology[technology] then
|
||||||
thxbob.lib.error.technology(technology)
|
BioInd.writeDebug("Technology " .. tostring(technology) .. " does not exist.")
|
||||||
thxbob.lib.error.item_of_type(pack, "tool", "Science pack")
|
|
||||||
end
|
end
|
||||||
end
|
if not data.raw.tool[pack] then
|
||||||
|
BioInd.writeDebug("Science pack %s does not exist.", {pack})
|
||||||
function thxbob.lib.tech.add_science_packs(technology, science_packs)
|
|
||||||
if type(technology) == "string" and type(science_packs) == "table" then
|
|
||||||
for i, science_pack in pairs(science_packs) do
|
|
||||||
if
|
|
||||||
type(science_pack) == "table"
|
|
||||||
and type(science_pack[1]) == "string"
|
|
||||||
and data.raw.tool[science_pack[1]]
|
|
||||||
and type(science_pack[2]) == "number"
|
|
||||||
then
|
|
||||||
thxbob.lib.tech.add_science_pack(technology, science_pack[1], science_pack[2])
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(technology)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.tech.remove_science_pack(technology, pack)
|
function thxbob.lib.tech.remove_science_pack(technology, pack)
|
||||||
if type(technology) == "string" and type(pack) == "string" and data.raw.technology[technology] then
|
if data.raw.technology[technology] then
|
||||||
if data.raw.technology[technology].unit then
|
for i, ingredient in pairs(data.raw.technology[technology].unit.ingredients) do
|
||||||
remove_science_pack(data.raw.technology[technology], pack)
|
if ingredient[1] == pack or ingredient.name == pack then
|
||||||
|
table.remove(data.raw.technology[technology].unit.ingredients, i)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Technology %s does not exist.", {technology})
|
||||||
thxbob.lib.error.technology(technology)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.tech.clear_science_packs(technology)
|
|
||||||
if type(technology) == "string" and data.raw.technology[technology] then
|
|
||||||
if data.raw.technology[technology].unit then
|
|
||||||
data.raw.technology[technology].unit.ingredients = {}
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(technology)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.set_science_packs(technology, science_packs)
|
|
||||||
if type(technology) == "string" and data.raw.technology[technology] and type(science_packs) == "table" then
|
|
||||||
thxbob.lib.tech.clear_science_packs(technology)
|
|
||||||
thxbob.lib.tech.add_science_packs(technology, science_packs)
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(technology)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.set_science_pack_count(technology, count)
|
|
||||||
if type(technology) == "string" and data.raw.technology[technology] then
|
|
||||||
local prototype = data.raw.technology[technology]
|
|
||||||
if prototype.unit then
|
|
||||||
prototype.unit.count = count
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(technology)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function has_recipe_unlock(technology, recipe)
|
|
||||||
if technology.effects then
|
|
||||||
for i, effect in pairs(technology.effects) do
|
|
||||||
if effect.type == "unlock-recipe" and effect.recipe == recipe then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
local function add_recipe_unlock(technology, recipe)
|
|
||||||
local addit = true
|
|
||||||
if not technology.effects then
|
|
||||||
technology.effects = {}
|
|
||||||
end
|
|
||||||
for i, effect in pairs(technology.effects) do
|
|
||||||
if effect.type == "unlock-recipe" and effect.recipe == recipe then
|
|
||||||
addit = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if addit then
|
|
||||||
table.insert(technology.effects, { type = "unlock-recipe", recipe = recipe })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function remove_recipe_unlock(technology, recipe)
|
|
||||||
if technology.effects then
|
|
||||||
for i, effect in pairs(technology.effects) do
|
|
||||||
if effect.type == "unlock-recipe" and effect.recipe == recipe then
|
|
||||||
table.remove(technology.effects, i)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.has_recipe_unlock(technology, recipe)
|
|
||||||
if
|
|
||||||
type(technology) == "string"
|
|
||||||
and type(recipe) == "string"
|
|
||||||
and data.raw.technology[technology]
|
|
||||||
and data.raw.recipe[recipe]
|
|
||||||
then
|
|
||||||
local hasit = false
|
|
||||||
hasit = has_recipe_unlock(data.raw.technology[technology], recipe)
|
|
||||||
|
|
||||||
return hasit
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(technology)
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.add_recipe_unlock(technology, recipe)
|
function thxbob.lib.tech.add_recipe_unlock(technology, recipe)
|
||||||
if
|
if data.raw.technology[technology] and data.raw.recipe[recipe] then
|
||||||
type(technology) == "string"
|
local addit = true
|
||||||
and type(recipe) == "string"
|
if not data.raw.technology[technology].effects then
|
||||||
and data.raw.technology[technology]
|
data.raw.technology[technology].effects = {}
|
||||||
and data.raw.recipe[recipe]
|
end
|
||||||
then
|
for i, effect in pairs(data.raw.technology[technology].effects) do
|
||||||
add_recipe_unlock(data.raw.technology[technology], recipe)
|
if effect.type == "unlock-recipe" and effect.recipe == recipe then addit = false end
|
||||||
|
end
|
||||||
|
if addit then table.insert(data.raw.technology[technology].effects, {type = "unlock-recipe", recipe = recipe}) end
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
if not data.raw.technology[technology] then
|
||||||
thxbob.lib.error.technology(technology)
|
BioInd.writeDebug("Technology %s does not exist.", {technology})
|
||||||
thxbob.lib.error.recipe(recipe)
|
end
|
||||||
|
if not data.raw.recipe[recipe] then
|
||||||
|
BioInd.writeDebug("Recipe %s does not exist.", {recipe})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.tech.remove_recipe_unlock(technology, recipe)
|
function thxbob.lib.tech.remove_recipe_unlock(technology, recipe)
|
||||||
if
|
if data.raw.technology[technology] and data.raw.technology[technology].effects then
|
||||||
type(technology) == "string"
|
for i, effect in pairs(data.raw.technology[technology].effects) do
|
||||||
and type(recipe) == "string"
|
if effect.type == "unlock-recipe" and effect.recipe == recipe then
|
||||||
and data.raw.technology[technology]
|
table.remove(data.raw.technology[technology].effects, i)
|
||||||
-- data.raw.recipe[recipe] --don't check to see if something we're removing exists.
|
|
||||||
then
|
|
||||||
remove_recipe_unlock(data.raw.technology[technology], recipe)
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(technology)
|
|
||||||
thxbob.lib.error.recipe(recipe)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function add_prerequisite(technology, prerequisite)
|
|
||||||
local addit = true
|
|
||||||
if technology.prerequisites then
|
|
||||||
for i, check in ipairs(technology.prerequisites) do
|
|
||||||
if check == prerequisite then
|
|
||||||
addit = false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
technology.prerequisites = {}
|
if not data.raw.technology[technology] then
|
||||||
end
|
BioInd.writeDebug("Technology %s does not exist.", {technology})
|
||||||
if addit then
|
|
||||||
table.insert(technology.prerequisites, prerequisite)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function remove_prerequisite(technology, prerequisite)
|
|
||||||
if technology.prerequisites then
|
|
||||||
for i, check in ipairs(technology.prerequisites) do
|
|
||||||
if check == prerequisite then
|
|
||||||
table.remove(technology.prerequisites, i)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function replace_prerequisite(technology, old, new)
|
|
||||||
if technology.prerequisites then
|
|
||||||
for i, prerequisite in ipairs(technology.prerequisites) do
|
|
||||||
if prerequisite == old then
|
|
||||||
remove_prerequisite(technology, old)
|
|
||||||
add_prerequisite(technology, new)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.tech.replace_prerequisite(technology, old, new)
|
function thxbob.lib.tech.replace_prerequisite(technology, old, new)
|
||||||
if
|
if data.raw.technology[technology] and data.raw.technology[new] then
|
||||||
type(technology) == "string"
|
for i, prerequisite in ipairs(data.raw.technology[technology].prerequisites) do
|
||||||
and type(old) == "string"
|
if prerequisite == old then
|
||||||
and type(new) == "string"
|
thxbob.lib.tech.remove_prerequisite(technology, old)
|
||||||
and data.raw.technology[technology]
|
thxbob.lib.tech.add_prerequisite(technology, new)
|
||||||
-- data.raw.technology[old] and
|
end
|
||||||
and data.raw.technology[new]
|
end
|
||||||
then
|
|
||||||
replace_prerequisite(data.raw.technology[technology], old, new)
|
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
if not data.raw.technology[technology] then
|
||||||
thxbob.lib.error.technology(technology)
|
BioInd.writeDebug("Technology %s does not exist.", {technology})
|
||||||
thxbob.lib.error.technology(old, "Old prerequisite", "Old prerequisite technology")
|
end
|
||||||
thxbob.lib.error.technology(new, "New prerequisite", "New prerequisite technology")
|
if not data.raw.technology[new] then
|
||||||
|
BioInd.writeDebug("Technology %s does not exist.", {new})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.tech.add_prerequisite(technology, prerequisite)
|
function thxbob.lib.tech.add_prerequisite(technology, prerequisite)
|
||||||
if
|
if data.raw.technology[technology] and data.raw.technology[prerequisite] then
|
||||||
type(technology) == "string"
|
local addit = true
|
||||||
and type(prerequisite) == "string"
|
if data.raw.technology[technology].prerequisites then
|
||||||
and data.raw.technology[technology]
|
for i, check in ipairs(data.raw.technology[technology].prerequisites) do
|
||||||
and data.raw.technology[prerequisite]
|
if check == prerequisite then addit = false end
|
||||||
then
|
end
|
||||||
add_prerequisite(data.raw.technology[technology], prerequisite)
|
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
data.raw.technology[technology].prerequisites = {}
|
||||||
thxbob.lib.error.technology(technology)
|
end
|
||||||
thxbob.lib.error.technology(prerequisite, "Prerequisite", "Prerequisite technology")
|
if addit then table.insert(data.raw.technology[technology].prerequisites, prerequisite) end
|
||||||
|
else
|
||||||
|
if not data.raw.technology[technology] then
|
||||||
|
BioInd.writeDebug("Technology %s does not exist.", {technology})
|
||||||
|
end
|
||||||
|
if not data.raw.technology[prerequisite] then
|
||||||
|
BioInd.writeDebug("Technology %s does not exist.", {prerequisite})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function thxbob.lib.tech.remove_prerequisite(technology, prerequisite)
|
function thxbob.lib.tech.remove_prerequisite(technology, prerequisite)
|
||||||
if
|
if data.raw.technology[technology] then
|
||||||
type(technology) == "string"
|
for i, check in ipairs(data.raw.technology[technology].prerequisites) do
|
||||||
and type(prerequisite) == "string"
|
if check == prerequisite then
|
||||||
and data.raw.technology[technology]
|
table.remove(data.raw.technology[technology].prerequisites, i)
|
||||||
-- data.raw.technology[prerequisite]
|
end
|
||||||
then
|
end
|
||||||
remove_prerequisite(data.raw.technology[technology], prerequisite)
|
|
||||||
else
|
else
|
||||||
log(debug.traceback())
|
BioInd.writeDebug("Technology %s does not exist.", {technology})
|
||||||
thxbob.lib.error.technology(technology)
|
|
||||||
thxbob.lib.error.technology(prerequisite, "Prerequisite", "Prerequisite technology")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.hide(technology_name)
|
|
||||||
if type(technology_name) == "string" and data.raw.technology[technology_name] then
|
|
||||||
local technology = data.raw.technology[technology_name]
|
|
||||||
technology.hidden = true
|
|
||||||
technology.enabled = false
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(technology_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.ignore_tech_cost_multiplier(technology_name, ignore)
|
|
||||||
if type(technology_name) == "string" and type(ignore) == "boolean" then
|
|
||||||
local technology = data.raw.technology[technology_name]
|
|
||||||
if technology then
|
|
||||||
technology.ignore_tech_cost_multiplier = ignore
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(technology_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.technology_icon_constant(technology_icon, constant_icon, x, y)
|
|
||||||
local scale = 0.5
|
|
||||||
local xshift = x or 64
|
|
||||||
local yshift = y or 64
|
|
||||||
if type(technology_icon) == "table" and technology_icon.icon and technology_icon.icon_size then
|
|
||||||
local icons = {
|
|
||||||
technology_icon,
|
|
||||||
{
|
|
||||||
icon = constant_icon,
|
|
||||||
icon_size = 128,
|
|
||||||
scale = scale,
|
|
||||||
shift = { xshift * scale, yshift * scale },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return icons
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
log(technology_icon .. " not given in required table format")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function thxbob.lib.tech.technology_line_icon_constant(technology_line, first, last, technology_icon, constant_icon)
|
|
||||||
local scale = 0.5
|
|
||||||
if type(technology_icon) == "table" and technology_icon.icon and technology_icon.icon_size then
|
|
||||||
for i = first, last do
|
|
||||||
local tech_name = technology_line .. "-" .. i
|
|
||||||
if data.raw.technology[tech_name] then
|
|
||||||
data.raw.technology[tech_name].icons = {
|
|
||||||
technology_icon,
|
|
||||||
{
|
|
||||||
icon = constant_icon,
|
|
||||||
icon_size = 128,
|
|
||||||
scale = scale,
|
|
||||||
shift = { 64 * scale, 64 * scale },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
thxbob.lib.error.technology(tech_name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
log(debug.traceback())
|
|
||||||
log(technology_icon .. " not given in required table format")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ bi-power-to-rail-pole=Powered rails connector
|
||||||
bi-rail-power=Powered rails
|
bi-rail-power=Powered rails
|
||||||
bi-rail-wood-bridge=Wooden rail bridge
|
bi-rail-wood-bridge=Wooden rail bridge
|
||||||
bi-rail-wood=Wooden rails
|
bi-rail-wood=Wooden rails
|
||||||
bi-straight-rail-wood=Wooden rails
|
|
||||||
bi-curved-rail-a-wood=Wooden rails
|
bi-curved-rail-a-wood=Wooden rails
|
||||||
bi-curved-rail-b-wood=Wooden rails
|
bi-curved-rail-b-wood=Wooden rails
|
||||||
bi-half-diagonal-rail-wood=Wooden rails
|
bi-half-diagonal-rail-wood=Wooden rails
|
||||||
|
|
|
||||||
|
|
@ -144,8 +144,8 @@ if data.raw.item["solid-carbon"] and mods["angelspetrochem"] then
|
||||||
data.raw.recipe["bi-pellet-coke"].icon = ICONPATH_BA .. "pellet_coke_c.png"
|
data.raw.recipe["bi-pellet-coke"].icon = ICONPATH_BA .. "pellet_coke_c.png"
|
||||||
data.raw.recipe["bi-pellet-coke"].icon_size = 64
|
data.raw.recipe["bi-pellet-coke"].icon_size = 64
|
||||||
thxbob.lib.tech.add_recipe_unlock("bi-tech-coal-processing-2", "bi-pellet-coke-2")
|
thxbob.lib.tech.add_recipe_unlock("bi-tech-coal-processing-2", "bi-pellet-coke-2")
|
||||||
elseif data.raw.item["bob-carbon"] and mods["bobplates"] then
|
elseif data.raw.item["carbon"] and mods["bobplates"] then
|
||||||
thxbob.lib.recipe.add_new_ingredient ("bi-pellet-coke-2", {type = "item", name = "bob-carbon", amount = 10})
|
thxbob.lib.recipe.add_new_ingredient ("bi-pellet-coke-2", {type = "item", name = "carbon", amount = 10})
|
||||||
data.raw.recipe["bi-coke-coal"].icon = ICONPATH_BA .. "pellet_coke_1.png"
|
data.raw.recipe["bi-coke-coal"].icon = ICONPATH_BA .. "pellet_coke_1.png"
|
||||||
data.raw.recipe["bi-coke-coal"].icon_size = 64
|
data.raw.recipe["bi-coke-coal"].icon_size = 64
|
||||||
data.raw.recipe["bi-pellet-coke-2"].icon = ICONPATH_BA .. "pellet_coke_b.png"
|
data.raw.recipe["bi-pellet-coke-2"].icon = ICONPATH_BA .. "pellet_coke_b.png"
|
||||||
|
|
@ -178,10 +178,10 @@ if data.raw.item["solid-sodium-hydroxide"] and mods["angelspetrochem"] then
|
||||||
data.raw.recipe["bi-fertilizer-2"].icon = ICONPATH_BA .. "fertilizer_solid_sodium_hydroxide.png"
|
data.raw.recipe["bi-fertilizer-2"].icon = ICONPATH_BA .. "fertilizer_solid_sodium_hydroxide.png"
|
||||||
data.raw.recipe["bi-fertilizer-2"].icon_size = 64
|
data.raw.recipe["bi-fertilizer-2"].icon_size = 64
|
||||||
thxbob.lib.tech.add_recipe_unlock("bi-tech-fertilizer", "bi-fertilizer-2")
|
thxbob.lib.tech.add_recipe_unlock("bi-tech-fertilizer", "bi-fertilizer-2")
|
||||||
elseif data.raw.item["bob-sodium-hydroxide"] and mods["bobplates"] then
|
elseif data.raw.item["sodium-hydroxide"] and mods["bobplates"] then
|
||||||
thxbob.lib.recipe.add_new_ingredient("bi-fertilizer-2", {
|
thxbob.lib.recipe.add_new_ingredient("bi-fertilizer-2", {
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "bob-sodium-hydroxide",
|
name = "sodium-hydroxide",
|
||||||
amount = 10
|
amount = 10
|
||||||
})
|
})
|
||||||
thxbob.lib.tech.add_recipe_unlock("bi-tech-fertilizer", "bi-fertilizer-2")
|
thxbob.lib.tech.add_recipe_unlock("bi-tech-fertilizer", "bi-fertilizer-2")
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ data:extend(
|
||||||
subgroup = "bio-bio-farm-raw",
|
subgroup = "bio-bio-farm-raw",
|
||||||
order = "a[bi]-a-bx[bi-woodbrick]",
|
order = "a[bi]-a-bx[bi-woodbrick]",
|
||||||
fuel_category = "chemical",
|
fuel_category = "chemical",
|
||||||
fuel_value = "160MJ",
|
fuel_value = "20MJ",
|
||||||
stack_size = 200,
|
stack_size = 200,
|
||||||
weight = 4 * kg,
|
weight = 4 * kg,
|
||||||
},
|
},
|
||||||
|
|
@ -519,11 +519,11 @@ data:extend(
|
||||||
{
|
{
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "fertilizer",
|
name = "fertilizer",
|
||||||
icon = ICONPATH .. "fertilizer.png",
|
icon = ICONPATH .. "fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icons = {
|
icons = {
|
||||||
{
|
{
|
||||||
icon = ICONPATH .. "fertilizer.png",
|
icon = ICONPATH .. "fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -537,11 +537,11 @@ data:extend(
|
||||||
{
|
{
|
||||||
type = "item",
|
type = "item",
|
||||||
name = "bi-adv-fertilizer",
|
name = "bi-adv-fertilizer",
|
||||||
icon = ICONPATH .. "fertilizer_advanced.png",
|
icon = ICONPATH .. "advanced_fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icons = {
|
icons = {
|
||||||
{
|
{
|
||||||
icon = ICONPATH .. "fertilizer_advanced.png",
|
icon = ICONPATH .. "advanced_fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,10 @@ data:extend({
|
||||||
{ type = "item", name = "wood", amount = 20 },
|
{ type = "item", name = "wood", amount = 20 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "bi-seed", amount_min = 30, amount_max = 50 },
|
{ type = "item", name = "bi-seed", amount = 40 },
|
||||||
},
|
},
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
subgroup = "bio-bio-farm-fluid-1",
|
subgroup = "bio-bio-farm-fluid-1",
|
||||||
|
|
@ -62,11 +61,10 @@ data:extend({
|
||||||
{ type = "item", name = "bi-ash", amount = 10 },
|
{ type = "item", name = "bi-ash", amount = 10 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "bi-seed", amount_min = 40, amount_max = 60 },
|
{ type = "item", name = "bi-seed", amount = 50 },
|
||||||
},
|
},
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
subgroup = "bio-bio-farm-fluid-1",
|
subgroup = "bio-bio-farm-fluid-1",
|
||||||
|
|
@ -97,11 +95,10 @@ data:extend({
|
||||||
{ type = "item", name = "fertilizer", amount = 10 },
|
{ type = "item", name = "fertilizer", amount = 10 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "bi-seed", amount_min = 50, amount_max = 70 },
|
{ type = "item", name = "bi-seed", amount = 60 },
|
||||||
},
|
},
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
subgroup = "bio-bio-farm-fluid-1",
|
subgroup = "bio-bio-farm-fluid-1",
|
||||||
|
|
@ -132,11 +129,10 @@ data:extend({
|
||||||
{ type = "fluid", name = "water", amount = 40 },
|
{ type = "fluid", name = "water", amount = 40 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "bi-seed", amount_min = 60, amount_max = 100 },
|
{ type = "item", name = "bi-seed", amount = 80 },
|
||||||
},
|
},
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
subgroup = "bio-bio-farm-fluid-1",
|
subgroup = "bio-bio-farm-fluid-1",
|
||||||
|
|
@ -162,14 +158,14 @@ data:extend({
|
||||||
category = "biofarm-mod-greenhouse",
|
category = "biofarm-mod-greenhouse",
|
||||||
energy_required = 400,
|
energy_required = 400,
|
||||||
ingredients = {
|
ingredients = {
|
||||||
|
{ type = "item", name = "bi-seed", amount = 20 },
|
||||||
{ type = "fluid", name = "water", amount = 100 },
|
{ type = "fluid", name = "water", amount = 100 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "seedling", amount_min = 25, amount_max = 55 },
|
{ type = "item", name = "seedling", amount = 40 },
|
||||||
},
|
},
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
subgroup = "bio-bio-farm-fluid-2",
|
subgroup = "bio-bio-farm-fluid-2",
|
||||||
|
|
@ -200,11 +196,10 @@ data:extend({
|
||||||
{ type = "fluid", name = "water", amount = 100 },
|
{ type = "fluid", name = "water", amount = 100 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "seedling", amount_min = 45, amount_max = 75 },
|
{ type = "item", name = "seedling", amount = 60 },
|
||||||
},
|
},
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
subgroup = "bio-bio-farm-fluid-2",
|
subgroup = "bio-bio-farm-fluid-2",
|
||||||
|
|
@ -235,11 +230,10 @@ data:extend({
|
||||||
{ type = "fluid", name = "water", amount = 100 },
|
{ type = "fluid", name = "water", amount = 100 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "seedling", amount_min = 75, amount_max = 105 },
|
{ type = "item", name = "seedling", amount = 90 },
|
||||||
},
|
},
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
subgroup = "bio-bio-farm-fluid-2",
|
subgroup = "bio-bio-farm-fluid-2",
|
||||||
order = "b[bi]-ssw-b1[bi-Seedling_Mk3]",
|
order = "b[bi]-ssw-b1[bi-Seedling_Mk3]",
|
||||||
|
|
@ -269,11 +263,10 @@ data:extend({
|
||||||
{ type = "item", name = "bi-adv-fertilizer", amount = 10 },
|
{ type = "item", name = "bi-adv-fertilizer", amount = 10 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "seedling", amount_min = 140, amount_max = 180 },
|
{ type = "item", name = "seedling", amount = 160 },
|
||||||
},
|
},
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
subgroup = "bio-bio-farm-fluid-2",
|
subgroup = "bio-bio-farm-fluid-2",
|
||||||
|
|
@ -298,7 +291,6 @@ data:extend({
|
||||||
},
|
},
|
||||||
category = "biofarm-mod-farm",
|
category = "biofarm-mod-farm",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
energy_required = 400,
|
energy_required = 400,
|
||||||
|
|
@ -307,10 +299,10 @@ data:extend({
|
||||||
{ type = "fluid", name = "water", amount = 100 },
|
{ type = "fluid", name = "water", amount = 100 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "wood", amount_min = 25, amount_max = 55 },
|
{ type = "item", name = "wood", amount = 40 },
|
||||||
{ type = "item", name = "bi-woodpulp", amount_min = 65, amount_max = 95 },
|
{ type = "item", name = "bi-woodpulp", amount = 80 },
|
||||||
},
|
},
|
||||||
main_product = "wood",
|
main_product = "",
|
||||||
subgroup = "bio-bio-farm-fluid-3",
|
subgroup = "bio-bio-farm-fluid-3",
|
||||||
order = "c[bi]-ssw-c1[raw-wood1]",
|
order = "c[bi]-ssw-c1[raw-wood1]",
|
||||||
-- This is a custom property for use by "Krastorio 2" (it will change
|
-- This is a custom property for use by "Krastorio 2" (it will change
|
||||||
|
|
@ -333,7 +325,6 @@ data:extend({
|
||||||
},
|
},
|
||||||
category = "biofarm-mod-farm",
|
category = "biofarm-mod-farm",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
energy_required = 360,
|
energy_required = 360,
|
||||||
|
|
@ -343,10 +334,10 @@ data:extend({
|
||||||
{ type = "fluid", name = "water", amount = 100 },
|
{ type = "fluid", name = "water", amount = 100 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "wood", amount_min = 60, amount_max = 90 },
|
{ type = "item", name = "wood", amount = 75 },
|
||||||
{ type = "item", name = "bi-woodpulp", amount_min = 135, amount_max = 165 },
|
{ type = "item", name = "bi-woodpulp", amount = 150 },
|
||||||
},
|
},
|
||||||
main_product = "wood",
|
main_product = "",
|
||||||
subgroup = "bio-bio-farm-fluid-3",
|
subgroup = "bio-bio-farm-fluid-3",
|
||||||
order = "c[bi]-ssw-c1[raw-wood2]",
|
order = "c[bi]-ssw-c1[raw-wood2]",
|
||||||
-- This is a custom property for use by "Krastorio 2" (it will change
|
-- This is a custom property for use by "Krastorio 2" (it will change
|
||||||
|
|
@ -369,7 +360,6 @@ data:extend({
|
||||||
},
|
},
|
||||||
category = "biofarm-mod-farm",
|
category = "biofarm-mod-farm",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
energy_required = 300,
|
energy_required = 300,
|
||||||
|
|
@ -379,10 +369,10 @@ data:extend({
|
||||||
{ type = "fluid", name = "water", amount = 100 },
|
{ type = "fluid", name = "water", amount = 100 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "wood", amount_min = 120, amount_max = 150 },
|
{ type = "item", name = "wood", amount = 135 },
|
||||||
{ type = "item", name = "bi-woodpulp", amount_min = 255, amount_max = 285 },
|
{ type = "item", name = "bi-woodpulp", amount = 270 },
|
||||||
},
|
},
|
||||||
main_product = "wood",
|
main_product = "",
|
||||||
subgroup = "bio-bio-farm-fluid-3",
|
subgroup = "bio-bio-farm-fluid-3",
|
||||||
order = "c[bi]-ssw-c1[raw-wood3]",
|
order = "c[bi]-ssw-c1[raw-wood3]",
|
||||||
-- This is a custom property for use by "Krastorio 2" (it will change
|
-- This is a custom property for use by "Krastorio 2" (it will change
|
||||||
|
|
@ -405,7 +395,6 @@ data:extend({
|
||||||
},
|
},
|
||||||
category = "biofarm-mod-farm",
|
category = "biofarm-mod-farm",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_productivity = true,
|
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
energy_required = 100,
|
energy_required = 100,
|
||||||
|
|
@ -415,10 +404,10 @@ data:extend({
|
||||||
{ type = "item", name = "bi-adv-fertilizer", amount = 5 },
|
{ type = "item", name = "bi-adv-fertilizer", amount = 5 },
|
||||||
},
|
},
|
||||||
results = {
|
results = {
|
||||||
{ type = "item", name = "wood", amount_min = 140, amount_max = 180 },
|
{ type = "item", name = "wood", amount = 160 },
|
||||||
{ type = "item", name = "bi-woodpulp", amount_min = 300, amount_max = 340 },
|
{ type = "item", name = "bi-woodpulp", amount = 320 },
|
||||||
},
|
},
|
||||||
main_product = "wood",
|
main_product = "",
|
||||||
subgroup = "bio-bio-farm-fluid-3",
|
subgroup = "bio-bio-farm-fluid-3",
|
||||||
order = "c[bi]-ssw-c1[raw-wood4]",
|
order = "c[bi]-ssw-c1[raw-wood4]",
|
||||||
-- This is a custom property for use by "Krastorio 2" (it will change
|
-- This is a custom property for use by "Krastorio 2" (it will change
|
||||||
|
|
@ -595,9 +584,9 @@ data:extend({
|
||||||
},
|
},
|
||||||
subgroup = "bio-bio-farm-raw",
|
subgroup = "bio-bio-farm-raw",
|
||||||
order = "a[bi]-a-bx[bi-4-woodbrick]",
|
order = "a[bi]-a-bx[bi-4-woodbrick]",
|
||||||
energy_required = 8,
|
energy_required = 2,
|
||||||
ingredients = { { type = "item", name = "bi-woodpulp", amount = 192 } },
|
ingredients = { { type = "item", name = "bi-woodpulp", amount = 24 } },
|
||||||
results = { { type = "item", name = "wood-bricks", amount = 6 } },
|
results = { { type = "item", name = "wood-bricks", amount = 1 } },
|
||||||
main_product = "",
|
main_product = "",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
allow_as_intermediate = true, -- Changed for 0.18.34/1.1.4
|
allow_as_intermediate = true, -- Changed for 0.18.34/1.1.4
|
||||||
|
|
@ -1131,15 +1120,12 @@ data:extend({
|
||||||
results = {
|
results = {
|
||||||
{ type = "fluid", name = "nitrogen", amount = 20 },
|
{ type = "fluid", name = "nitrogen", amount = 20 },
|
||||||
},
|
},
|
||||||
crafting_machine_tint = {
|
main_product = "",
|
||||||
primary = { r = 0.0, g = 0.8, b = 0.0, a = 0.000 },
|
|
||||||
secondary = { r = 0.5, g = 1.0, b = 0.5, a = 0.000 },
|
|
||||||
tertiary = { r = 0.25, g = 0.5, b = 0.25, a = 0.000 },
|
|
||||||
},
|
|
||||||
enabled = false,
|
enabled = false,
|
||||||
always_show_made_in = true,
|
always_show_made_in = true,
|
||||||
allow_decomposition = false,
|
allow_decomposition = false,
|
||||||
allow_as_intermediate = false,
|
allow_as_intermediate = false,
|
||||||
|
--main_product= "nitrogen",
|
||||||
subgroup = "bio-bio-farm-intermediate-product",
|
subgroup = "bio-bio-farm-intermediate-product",
|
||||||
order = "ab",
|
order = "ab",
|
||||||
},
|
},
|
||||||
|
|
@ -1181,11 +1167,11 @@ data:extend({
|
||||||
{
|
{
|
||||||
type = "recipe",
|
type = "recipe",
|
||||||
name = "bi-adv-fertilizer-1",
|
name = "bi-adv-fertilizer-1",
|
||||||
icon = ICONPATH .. "fertilizer_advanced.png",
|
icon = ICONPATH .. "advanced_fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icons = {
|
icons = {
|
||||||
{
|
{
|
||||||
icon = ICONPATH .. "fertilizer_advanced.png",
|
icon = ICONPATH .. "advanced_fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1213,11 +1199,11 @@ data:extend({
|
||||||
{
|
{
|
||||||
type = "recipe",
|
type = "recipe",
|
||||||
name = "bi-adv-fertilizer-2",
|
name = "bi-adv-fertilizer-2",
|
||||||
icon = ICONPATH .. "fertilizer_advanced.png",
|
icon = ICONPATH .. "advanced_fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icons = {
|
icons = {
|
||||||
{
|
{
|
||||||
icon = ICONPATH .. "fertilizer_advanced.png",
|
icon = ICONPATH .. "advanced_fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -61,12 +61,12 @@ data:extend({
|
||||||
{
|
{
|
||||||
type = "fluid",
|
type = "fluid",
|
||||||
name = "bi-adv-fertilizer-fluid",
|
name = "bi-adv-fertilizer-fluid",
|
||||||
icon = ICONPATH .. "fluid_advanced_fertilizer_recipe",
|
icon = ICONPATH .. "fluid_advanced_fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icon_mipmaps = 1,
|
icon_mipmaps = 1,
|
||||||
icons = {
|
icons = {
|
||||||
{
|
{
|
||||||
icon = ICONPATH .. "fluid_advanced_fertilizer_recipe.png",
|
icon = ICONPATH .. "fluid_advanced_fertilizer_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icon_mipmaps = 1,
|
icon_mipmaps = 1,
|
||||||
}
|
}
|
||||||
|
|
@ -91,11 +91,11 @@ data:extend({
|
||||||
{
|
{
|
||||||
type = "recipe",
|
type = "recipe",
|
||||||
name = "bi-fertilizer-fluid",
|
name = "bi-fertilizer-fluid",
|
||||||
icon = ICONPATH .. "fluid_fertilizer.png",
|
icon = ICONPATH .. "fluid_fertilizer_recipe_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
icons = {
|
icons = {
|
||||||
{
|
{
|
||||||
icon = ICONPATH .. "fluid_fertilizer.png",
|
icon = ICONPATH .. "fluid_fertilizer_recipe_64.png",
|
||||||
icon_size = 64,
|
icon_size = 64,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,267 +0,0 @@
|
||||||
local util = require("util")
|
|
||||||
|
|
||||||
local ground_rail_render_layers =
|
|
||||||
{
|
|
||||||
stone_path_lower = "rail-stone-path-lower",
|
|
||||||
stone_path = "rail-stone-path",
|
|
||||||
tie = "rail-tie",
|
|
||||||
screw = "rail-screw",
|
|
||||||
metal = "rail-metal"
|
|
||||||
}
|
|
||||||
|
|
||||||
local rail_segment_visualisation_endings =
|
|
||||||
{
|
|
||||||
filename = "__base__/graphics/entity/rails/rail/rail-segment-visualisations-endings.png",
|
|
||||||
priority = "extra-high",
|
|
||||||
flags = { "low-object" },
|
|
||||||
width = 64,
|
|
||||||
height = 64,
|
|
||||||
scale = 0.5,
|
|
||||||
direction_count = 16,
|
|
||||||
frame_count = 6,
|
|
||||||
usage = "rail"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
local function make_new_rail_pictures(keys, elems, max_variations)
|
|
||||||
local function make_sprite_definition(filename, elem, key, variation_count)
|
|
||||||
return
|
|
||||||
{
|
|
||||||
filename = filename,
|
|
||||||
priority = elem.priority or "extra-high",
|
|
||||||
flags = elem.mipmap and { "trilinear-filtering" } or { "low-object" },
|
|
||||||
draw_as_shadow = elem.draw_as_shadow,
|
|
||||||
allow_forced_downscale = elem.allow_forced_downscale,
|
|
||||||
width = key[3][1],
|
|
||||||
height = key[3][2],
|
|
||||||
x = key[2][1],
|
|
||||||
y = key[2][2],
|
|
||||||
scale = 0.5;
|
|
||||||
shift = util.by_pixel(key[4][1], key[4][2]),
|
|
||||||
variation_count = variation_count,
|
|
||||||
usage = "rail"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
local res = {}
|
|
||||||
for _ , key in ipairs(keys) do
|
|
||||||
local part = {}
|
|
||||||
local variation_count = key[5] or 1
|
|
||||||
if max_variations then
|
|
||||||
variation_count = math.min(variation_count, max_variations)
|
|
||||||
end
|
|
||||||
if (variation_count > 0) then
|
|
||||||
for _ , elem in ipairs(elems) do
|
|
||||||
local layers = nil
|
|
||||||
local variations = variation_count;
|
|
||||||
if (elem[1] == "segment_visualisation_middle") then
|
|
||||||
variations = nil
|
|
||||||
end
|
|
||||||
if (type(elem[2]) == "table") then
|
|
||||||
layers = { layers = {} }
|
|
||||||
for _, subelem in ipairs(elem[2]) do
|
|
||||||
table.insert(layers.layers, make_sprite_definition(subelem[1], subelem, key, variations))
|
|
||||||
end
|
|
||||||
else
|
|
||||||
layers = make_sprite_definition(elem[2], elem, key, variations)
|
|
||||||
end
|
|
||||||
|
|
||||||
if (elem[1] ~= nil) then
|
|
||||||
part[elem[1]] = layers
|
|
||||||
else
|
|
||||||
part = layers
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
res[key[1]] = part
|
|
||||||
end
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
|
|
||||||
function new_rail_pictures_vanilla(rail_type)
|
|
||||||
local keys
|
|
||||||
local NOT_USED_POSITION = {0, 0}
|
|
||||||
local NOT_USED_SIZE = {1, 1}
|
|
||||||
local NOT_USED_SHIFT = {0, 0}
|
|
||||||
if rail_type == "straight" then
|
|
||||||
keys =
|
|
||||||
{
|
|
||||||
{"north", { 0, 256 }, {256, 256}, {0,0}, 8},
|
|
||||||
{"northeast", { 0, 2048 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"east", { 0, 0 }, {256, 256}, {0,0}, 8},
|
|
||||||
{"southeast", { 0, 896 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"south", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"southwest", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"west", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"northwest", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0}
|
|
||||||
}
|
|
||||||
elseif rail_type == "half-diagonal" then
|
|
||||||
keys =
|
|
||||||
{
|
|
||||||
{"north", { 0, 1280 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"northeast", { 0, 1664 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"east", { 0, 2432 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"southeast", { 0, 512 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"south", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"southwest", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"west", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"northwest", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0}
|
|
||||||
}
|
|
||||||
elseif rail_type == "curved-a" then
|
|
||||||
keys =
|
|
||||||
{
|
|
||||||
{"north", { 2048, 3 * 512 }, {512, 512}, {0,0}, 4},-- piece 04
|
|
||||||
{"northeast", { 2048, 12 * 512 }, {512, 512}, {0,0}, 4},-- piece 13
|
|
||||||
{"east", { 2048, 7 * 512 }, {512, 512}, {0,0}, 4},-- piece 08
|
|
||||||
{"southeast", { 2048, 0 * 512 }, {512, 512}, {0,0}, 4},-- piece 01
|
|
||||||
{"south", { 2048, 11 * 512 }, {512, 512}, {0,0}, 4},-- piece 12
|
|
||||||
{"southwest", { 2048, 4 * 512 }, {512, 512}, {0,0}, 4},-- piece 05
|
|
||||||
{"west", { 2048, 15 * 512 }, {512, 512}, {0,0}, 4},-- piece 16
|
|
||||||
{"northwest", { 2048, 8 * 512 }, {512, 512}, {0,0}, 4},-- piece 09
|
|
||||||
}
|
|
||||||
elseif rail_type == "curved-b" then
|
|
||||||
keys =
|
|
||||||
{
|
|
||||||
{"north", { 2048, 2 * 512 }, {512, 512}, {0,0}, 4},-- piece 03
|
|
||||||
{"northeast", { 2048, 13 * 512 }, {512, 512}, {0,0}, 4},-- piece 14
|
|
||||||
{"east", { 2048, 6 * 512 }, {512, 512}, {0,0}, 4},-- piece 07
|
|
||||||
{"southeast", { 2048, 1 * 512 }, {512, 512}, {0,0}, 4},-- piece 02
|
|
||||||
{"south", { 2048, 10 * 512 }, {512, 512}, {0,0}, 4},-- piece 11
|
|
||||||
{"southwest", { 2048, 5 * 512 }, {512, 512}, {0,0}, 4},-- piece 06
|
|
||||||
{"west", { 2048, 14 * 512 }, {512, 512}, {0,0}, 4},-- piece 15
|
|
||||||
{"northwest", { 2048, 9 * 512 }, {512, 512}, {0,0}, 4},-- piece 10
|
|
||||||
}
|
|
||||||
end
|
|
||||||
local elems =
|
|
||||||
{
|
|
||||||
{ "metals", "__base__/graphics/entity/rails/rail/rail-metals.png", mipmap = true },
|
|
||||||
{ "backplates", "__base__/graphics/entity/rails/rail/rail-backplates.png", mipmap = true },
|
|
||||||
{ "ties", "__Bio_Industries_2__/graphics/entities/wood_products/rails/new_rail/rail-ties-concrete.png" },
|
|
||||||
{ "stone_path", "__base__/graphics/entity/rails/rail/rail-stone-path-inside.png" },
|
|
||||||
{ "stone_path_background", "__base__/graphics/entity/rails/rail/rail-stone-path.png" },
|
|
||||||
{ "segment_visualisation_middle", "__base__/graphics/entity/rails/rail/rail-segment-visualisations-middle.png" },
|
|
||||||
}
|
|
||||||
|
|
||||||
local res = make_new_rail_pictures(keys, elems)
|
|
||||||
res["rail_endings"] =
|
|
||||||
{
|
|
||||||
sheets =
|
|
||||||
{
|
|
||||||
{
|
|
||||||
filename = "__base__/graphics/entity/rails/rail/rail-endings-background.png",
|
|
||||||
priority = "high",
|
|
||||||
flags = { "low-object" },
|
|
||||||
width = 256,
|
|
||||||
height = 256,
|
|
||||||
scale = 0.5,
|
|
||||||
usage = "rail"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
filename = "__base__/graphics/entity/rails/rail/rail-endings-foreground.png",
|
|
||||||
priority = "high",
|
|
||||||
flags = { "trilinear-filtering" },
|
|
||||||
width = 256,
|
|
||||||
height = 256,
|
|
||||||
scale = 0.5,
|
|
||||||
usage = "rail"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res["render_layers"] = ground_rail_render_layers
|
|
||||||
res["segment_visualisation_endings"] = rail_segment_visualisation_endings
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
|
|
||||||
function new_rail_remnants_pictures_vanilla(rail_type)
|
|
||||||
local keys
|
|
||||||
local NOT_USED_POSITION = {0, 0}
|
|
||||||
local NOT_USED_SIZE = {1, 1}
|
|
||||||
local NOT_USED_SHIFT = {0, 0}
|
|
||||||
if rail_type == "straight" then
|
|
||||||
keys =
|
|
||||||
{
|
|
||||||
{"north", { 0, 256 }, {256, 256}, {0,0}, 8},
|
|
||||||
{"northeast", { 0, 2048 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"east", { 0, 0 }, {256, 256}, {0,0}, 8},
|
|
||||||
{"southeast", { 0, 896 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"south", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"southwest", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"west", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"northwest", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0}
|
|
||||||
}
|
|
||||||
elseif rail_type == "half-diagonal" then
|
|
||||||
keys =
|
|
||||||
{
|
|
||||||
{"north", { 0, 1280 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"northeast", { 0, 1664 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"east", { 0, 2432 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"southeast", { 0, 512 }, {384, 384}, {0,0}, 3},
|
|
||||||
{"south", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"southwest", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"west", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0},
|
|
||||||
{"northwest", NOT_USED_POSITION, NOT_USED_SIZE, NOT_USED_SHIFT, 0}
|
|
||||||
}
|
|
||||||
elseif rail_type == "curved-a" then
|
|
||||||
keys =
|
|
||||||
{
|
|
||||||
{"north", { 2048, 3 * 512 }, {512, 512}, {0,0}, 4},-- piece 04
|
|
||||||
{"northeast", { 2048, 12 * 512 }, {512, 512}, {0,0}, 4},-- piece 13
|
|
||||||
{"east", { 2048, 7 * 512 }, {512, 512}, {0,0}, 4},-- piece 08
|
|
||||||
{"southeast", { 2048, 0 * 512 }, {512, 512}, {0,0}, 4},-- piece 01
|
|
||||||
{"south", { 2048, 11 * 512 }, {512, 512}, {0,0}, 4},-- piece 12
|
|
||||||
{"southwest", { 2048, 4 * 512 }, {512, 512}, {0,0}, 4},-- piece 05
|
|
||||||
{"west", { 2048, 15 * 512 }, {512, 512}, {0,0}, 4},-- piece 16
|
|
||||||
{"northwest", { 2048, 8 * 512 }, {512, 512}, {0,0}, 4},-- piece 09
|
|
||||||
}
|
|
||||||
elseif rail_type == "curved-b" then
|
|
||||||
keys =
|
|
||||||
{
|
|
||||||
{"north", { 2048, 2 * 512 }, {512, 512}, {0,0}, 4},-- piece 03
|
|
||||||
{"northeast", { 2048, 13 * 512 }, {512, 512}, {0,0}, 4},-- piece 14
|
|
||||||
{"east", { 2048, 6 * 512 }, {512, 512}, {0,0}, 4},-- piece 07
|
|
||||||
{"southeast", { 2048, 1 * 512 }, {512, 512}, {0,0}, 4},-- piece 02
|
|
||||||
{"south", { 2048, 10 * 512 }, {512, 512}, {0,0}, 4},-- piece 11
|
|
||||||
{"southwest", { 2048, 5 * 512 }, {512, 512}, {0,0}, 4},-- piece 06
|
|
||||||
{"west", { 2048, 14 * 512 }, {512, 512}, {0,0}, 4},-- piece 15
|
|
||||||
{"northwest", { 2048, 9 * 512 }, {512, 512}, {0,0}, 4},-- piece 10
|
|
||||||
}
|
|
||||||
end
|
|
||||||
local elems =
|
|
||||||
{
|
|
||||||
{ "metals", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-metals.png", mipmap = true, allow_forced_downscale = true },
|
|
||||||
{ "backplates", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-backplates.png", mipmap = true, allow_forced_downscale = true },
|
|
||||||
{ "ties", "__Bio_Industries_2__/graphics/entities/wood_products/rails/new_rail/rail-remnants-ties-concrete.png" , allow_forced_downscale = true },
|
|
||||||
{ "stone_path", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-stone-path-inside.png" , allow_forced_downscale = true },
|
|
||||||
{ "stone_path_background", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-stone-path.png" , allow_forced_downscale = true }
|
|
||||||
}
|
|
||||||
|
|
||||||
local res = make_new_rail_pictures(keys, elems)
|
|
||||||
res["rail_endings"] =
|
|
||||||
{
|
|
||||||
sheets =
|
|
||||||
{
|
|
||||||
{
|
|
||||||
filename = "__base__/graphics/entity/rails/rail/rail-endings-background.png",
|
|
||||||
priority = "high",
|
|
||||||
flags = { "low-object" },
|
|
||||||
width = 256,
|
|
||||||
height = 256,
|
|
||||||
scale = 0.5,
|
|
||||||
usage = "rail"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
filename = "__base__/graphics/entity/rails/rail/rail-endings-foreground.png",
|
|
||||||
priority = "high",
|
|
||||||
flags = { "trilinear-filtering" },
|
|
||||||
width = 256,
|
|
||||||
height = 256,
|
|
||||||
scale = 0.5,
|
|
||||||
usage = "rail"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res["render_layers"] = ground_rail_render_layers
|
|
||||||
return res
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ local rail_segment_visualisation_endings =
|
||||||
scale = 0.5,
|
scale = 0.5,
|
||||||
direction_count = 16,
|
direction_count = 16,
|
||||||
frame_count = 6,
|
frame_count = 6,
|
||||||
-- tint = wood_tint,
|
tint = wood_tint,
|
||||||
usage = "rail"
|
usage = "rail"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -41,7 +41,7 @@ local function make_new_rail_pictures_wood(keys, elems, max_variations)
|
||||||
scale = 0.5;
|
scale = 0.5;
|
||||||
shift = util.by_pixel(key[4][1], key[4][2]),
|
shift = util.by_pixel(key[4][1], key[4][2]),
|
||||||
variation_count = variation_count,
|
variation_count = variation_count,
|
||||||
-- tint = wood_tint,
|
tint = wood_tint,
|
||||||
usage = "rail"
|
usage = "rail"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -140,7 +140,7 @@ function new_rail_pictures_wood(rail_type)
|
||||||
{
|
{
|
||||||
{ "metals", "__base__/graphics/entity/rails/rail/rail-metals.png", mipmap = true },
|
{ "metals", "__base__/graphics/entity/rails/rail/rail-metals.png", mipmap = true },
|
||||||
{ "backplates", "__base__/graphics/entity/rails/rail/rail-backplates.png", mipmap = true },
|
{ "backplates", "__base__/graphics/entity/rails/rail/rail-backplates.png", mipmap = true },
|
||||||
{ "ties", "__Bio_Industries_2__/graphics/entities/wood_products/rails/new_rail/rail-ties-wood.png" },
|
{ "ties", "__base__/graphics/entity/rails/rail/rail-ties.png" },
|
||||||
{ "stone_path", "__base__/graphics/entity/rails/rail/rail-stone-path-inside.png" },
|
{ "stone_path", "__base__/graphics/entity/rails/rail/rail-stone-path-inside.png" },
|
||||||
{ "stone_path_background", "__base__/graphics/entity/rails/rail/rail-stone-path.png" },
|
{ "stone_path_background", "__base__/graphics/entity/rails/rail/rail-stone-path.png" },
|
||||||
{ "segment_visualisation_middle", "__base__/graphics/entity/rails/rail/rail-segment-visualisations-middle.png" },
|
{ "segment_visualisation_middle", "__base__/graphics/entity/rails/rail/rail-segment-visualisations-middle.png" },
|
||||||
|
|
@ -158,7 +158,7 @@ function new_rail_pictures_wood(rail_type)
|
||||||
width = 256,
|
width = 256,
|
||||||
height = 256,
|
height = 256,
|
||||||
scale = 0.5,
|
scale = 0.5,
|
||||||
-- tint = wood_tint,
|
tint = wood_tint,
|
||||||
usage = "rail"
|
usage = "rail"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -168,7 +168,7 @@ function new_rail_pictures_wood(rail_type)
|
||||||
width = 256,
|
width = 256,
|
||||||
height = 256,
|
height = 256,
|
||||||
scale = 0.5,
|
scale = 0.5,
|
||||||
-- tint = wood_tint,
|
tint = wood_tint,
|
||||||
usage = "rail"
|
usage = "rail"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -236,7 +236,7 @@ function new_rail_remnants_pictures(rail_type)
|
||||||
{
|
{
|
||||||
{ "metals", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-metals.png", mipmap = true, allow_forced_downscale = true },
|
{ "metals", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-metals.png", mipmap = true, allow_forced_downscale = true },
|
||||||
{ "backplates", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-backplates.png", mipmap = true, allow_forced_downscale = true },
|
{ "backplates", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-backplates.png", mipmap = true, allow_forced_downscale = true },
|
||||||
{ "ties", "__Bio_Industries_2__/graphics/entities/wood_products/rails/new_rail/rail-remnants-ties-wood.png" , allow_forced_downscale = true },
|
{ "ties", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-ties.png" , allow_forced_downscale = true },
|
||||||
{ "stone_path", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-stone-path-inside.png" , allow_forced_downscale = true },
|
{ "stone_path", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-stone-path-inside.png" , allow_forced_downscale = true },
|
||||||
{ "stone_path_background", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-stone-path.png" , allow_forced_downscale = true }
|
{ "stone_path_background", "__base__/graphics/entity/rails/rail/remnants/rail-remnants-stone-path.png" , allow_forced_downscale = true }
|
||||||
}
|
}
|
||||||
|
|
@ -253,7 +253,7 @@ function new_rail_remnants_pictures(rail_type)
|
||||||
width = 256,
|
width = 256,
|
||||||
height = 256,
|
height = 256,
|
||||||
scale = 0.5,
|
scale = 0.5,
|
||||||
-- tint = wood_tint,
|
tint = wood_tint,
|
||||||
usage = "rail"
|
usage = "rail"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -263,7 +263,7 @@ function new_rail_remnants_pictures(rail_type)
|
||||||
width = 256,
|
width = 256,
|
||||||
height = 256,
|
height = 256,
|
||||||
scale = 0.5,
|
scale = 0.5,
|
||||||
-- tint = wood_tint,
|
tint = wood_tint,
|
||||||
usage = "rail"
|
usage = "rail"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations")
|
||||||
name = "bi-straight-rail-wood",
|
name = "bi-straight-rail-wood",
|
||||||
order = "a[ground-rail]-a[bi-straight-rail-wood]",
|
order = "a[ground-rail]-a[bi-straight-rail-wood]",
|
||||||
icon = ICONPATH_E .. "straight-rail-wood.png",
|
icon = ICONPATH_E .. "straight-rail-wood.png",
|
||||||
localised_name = {"entity-name.bi-straight-rail-wood"},
|
|
||||||
collision_box = {{-1, -1}, {1, 1}}, -- has custommly generated box, but the prototype needs something that is used to generate building smokes
|
collision_box = {{-1, -1}, {1, 1}}, -- has custommly generated box, but the prototype needs something that is used to generate building smokes
|
||||||
flags = {"placeable-neutral", "player-creation", "building-direction-8-way"},
|
flags = {"placeable-neutral", "player-creation", "building-direction-8-way"},
|
||||||
minable = {mining_time = 0.2, result = "bi-rail-wood", count = 1},
|
minable = {mining_time = 0.2, result = "bi-rail-wood", count = 1},
|
||||||
|
|
@ -113,7 +112,6 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations")
|
||||||
order = "a[ground-rail]-b[bi-half-diagonal-rail-wood]",
|
order = "a[ground-rail]-b[bi-half-diagonal-rail-wood]",
|
||||||
deconstruction_alternative = "bi-straight-rail-wood",
|
deconstruction_alternative = "bi-straight-rail-wood",
|
||||||
icon = ICONPATH_E .. "curved-rail-wood.png",
|
icon = ICONPATH_E .. "curved-rail-wood.png",
|
||||||
localised_name = {"entity-name.bi-half-diagonal-rail-wood"},
|
|
||||||
collision_box = {{-0.75, -2.236}, {0.75, 2.236}}, -- has custommly generated box, but the prototype needs something that is used to generate building smokes
|
collision_box = {{-0.75, -2.236}, {0.75, 2.236}}, -- has custommly generated box, but the prototype needs something that is used to generate building smokes
|
||||||
tile_height = 2,
|
tile_height = 2,
|
||||||
extra_planner_goal_penalty = -4,
|
extra_planner_goal_penalty = -4,
|
||||||
|
|
@ -161,7 +159,6 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations")
|
||||||
order = "a[ground-rail]-c[bi-curved-rail-a-wood]",
|
order = "a[ground-rail]-c[bi-curved-rail-a-wood]",
|
||||||
deconstruction_alternative = "bi-straight-rail-wood",
|
deconstruction_alternative = "bi-straight-rail-wood",
|
||||||
icon = ICONPATH_E .. "curved-rail-wood.png",
|
icon = ICONPATH_E .. "curved-rail-wood.png",
|
||||||
localised_name = {"entity-name.bi-curved-rail-a-wood"},
|
|
||||||
collision_box = {{-0.75, -2.516}, {0.75, 2.516}}, -- has custommly generated box, but the prototype needs something that is used to generate building smokes
|
collision_box = {{-0.75, -2.516}, {0.75, 2.516}}, -- has custommly generated box, but the prototype needs something that is used to generate building smokes
|
||||||
flags = {"placeable-neutral", "player-creation", "building-direction-8-way"},
|
flags = {"placeable-neutral", "player-creation", "building-direction-8-way"},
|
||||||
minable = {mining_time = 0.2, result = "bi-rail-wood", count = 3},
|
minable = {mining_time = 0.2, result = "bi-rail-wood", count = 3},
|
||||||
|
|
@ -208,7 +205,6 @@ local simulations = require("__base__.prototypes.factoriopedia-simulations")
|
||||||
order = "a[ground-rail]-d[bi-curved-rail-b-wood]",
|
order = "a[ground-rail]-d[bi-curved-rail-b-wood]",
|
||||||
deconstruction_alternative = "bi-straight-rail-wood",
|
deconstruction_alternative = "bi-straight-rail-wood",
|
||||||
icon = ICONPATH_E .. "curved-rail-wood.png",
|
icon = ICONPATH_E .. "curved-rail-wood.png",
|
||||||
localised_name = {"entity-name.bi-curved-rail-b-wood"},
|
|
||||||
collision_box = {{-0.75, -2.441}, {0.75, 2.441}}, -- has custommly generated box, but the prototype needs something that is used to generate building smokes
|
collision_box = {{-0.75, -2.441}, {0.75, 2.441}}, -- has custommly generated box, but the prototype needs something that is used to generate building smokes
|
||||||
flags = {"placeable-neutral", "player-creation", "building-direction-8-way"},
|
flags = {"placeable-neutral", "player-creation", "building-direction-8-way"},
|
||||||
minable = {mining_time = 0.2, result = "bi-rail-wood", count = 3},
|
minable = {mining_time = 0.2, result = "bi-rail-wood", count = 3},
|
||||||
|
|
|
||||||