refactor
This commit is contained in:
parent
c0eb0397f0
commit
9d17404848
18 changed files with 334 additions and 163 deletions
|
|
@ -1,4 +1,9 @@
|
|||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.12.4
|
||||
Date: 2021-07-26
|
||||
Changes:
|
||||
- Minor refactor
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.12.3
|
||||
Date: 2021-07-12
|
||||
Features:
|
||||
|
|
|
|||
181
data-util.lua
181
data-util.lua
|
|
@ -1,54 +1,12 @@
|
|||
local me = require("me")
|
||||
local util = {}
|
||||
|
||||
util.name = "bztitanium"
|
||||
util.titanium_plate = ""
|
||||
util.titanium_processing = ""
|
||||
util.me = me
|
||||
util.get_setting = util.me.get_setting
|
||||
|
||||
if mods["FactorioExtended-Plus-Core"] then
|
||||
util.titanium_plate = "titanium-alloy"
|
||||
else
|
||||
util.titanium_plate = "titanium-plate"
|
||||
end
|
||||
|
||||
if mods["pyrawores"] then
|
||||
util.titanium_processing = "titanium-mk01"
|
||||
else
|
||||
util.titanium_processing = "titanium-processing"
|
||||
end
|
||||
|
||||
function util.steel_to_titanium(name)
|
||||
util.replace_ingredient(name, "steel-plate", util.titanium_plate)
|
||||
end
|
||||
|
||||
function util.add_titanium_ingredient(amount, name)
|
||||
util.add_ingredient(name, util.titanium_plate, amount)
|
||||
end
|
||||
|
||||
function util.rare_to_titanium(name)
|
||||
util.replace_ingredient(name, "rare-metals", util.titanium_plate)
|
||||
end
|
||||
|
||||
function util.add_titanium_prerequisite(name)
|
||||
util.add_prerequisite(name, util.titanium_processing)
|
||||
end
|
||||
|
||||
function util.get_setting(name)
|
||||
if settings.startup[name] == nil then
|
||||
return nil
|
||||
end
|
||||
return settings.startup[name].value
|
||||
end
|
||||
|
||||
function util.fluid_amount()
|
||||
local amt = util.get_setting("bztitanium-mining-fluid-amount")
|
||||
return amt and amt or 3
|
||||
end
|
||||
|
||||
|
||||
local bypass = {}
|
||||
if util.get_setting(util.name.."-recipe-bypass") then
|
||||
for recipe in string.gmatch(util.get_setting(util.name.."-recipe-bypass"), '[^",%s]+') do
|
||||
bypass[recipe] = true
|
||||
function util.fe_plus(sub)
|
||||
if mods["FactorioExtended-Plus-"..sub] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -117,8 +75,8 @@ end
|
|||
|
||||
-- Add a given quantity of ingredient to a given recipe
|
||||
function util.add_ingredient(recipe_name, ingredient, quantity)
|
||||
if bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
|
||||
add_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
|
||||
add_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
|
||||
add_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
|
||||
|
|
@ -140,7 +98,7 @@ end
|
|||
-- Add a given quantity of product to a given recipe.
|
||||
-- Only works for recipes with multiple products
|
||||
function util.add_product(recipe_name, product)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[product] then
|
||||
add_product(data.raw.recipe[recipe_name], product)
|
||||
add_product(data.raw.recipe[recipe_name].normal, product)
|
||||
add_product(data.raw.recipe[recipe_name].expensive, product)
|
||||
|
|
@ -155,8 +113,8 @@ end
|
|||
|
||||
-- Replace one ingredient with another in a recipe
|
||||
function util.replace_ingredient(recipe_name, old, new)
|
||||
if bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[new] then
|
||||
replace_ingredient(data.raw.recipe[recipe_name], old, new)
|
||||
replace_ingredient(data.raw.recipe[recipe_name].normal, old, new)
|
||||
replace_ingredient(data.raw.recipe[recipe_name].expensive, old, new)
|
||||
|
|
@ -180,7 +138,7 @@ end
|
|||
|
||||
-- Remove an ingredient from a recipe
|
||||
function util.remove_ingredient(recipe_name, old)
|
||||
if bypass[recipe_name] then return end
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
remove_ingredient(data.raw.recipe[recipe_name], old)
|
||||
remove_ingredient(data.raw.recipe[recipe_name].normal, old)
|
||||
|
|
@ -203,11 +161,10 @@ function remove_ingredient(recipe, old)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
-- Replace an amount of an ingredient in a recipe. Keep at least 1 of old.
|
||||
function util.replace_some_ingredient(recipe_name, old, old_amount, new, new_amount)
|
||||
if bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[new] then
|
||||
replace_some_ingredient(data.raw.recipe[recipe_name], old, old_amount, new, new_amount)
|
||||
replace_some_ingredient(data.raw.recipe[recipe_name].normal, old, old_amount, new, new_amount)
|
||||
replace_some_ingredient(data.raw.recipe[recipe_name].expensive, old, old_amount, new, new_amount)
|
||||
|
|
@ -223,11 +180,9 @@ function replace_some_ingredient(recipe, old, old_amount, new, new_amount)
|
|||
end
|
||||
end
|
||||
for i, ingredient in pairs(recipe.ingredients) do
|
||||
-- For final fixes
|
||||
if ingredient.name == old then
|
||||
ingredient.amount = math.max(1, ingredient.amount - old_amount)
|
||||
end
|
||||
-- For updates
|
||||
if ingredient[1] == old then
|
||||
ingredient[2] = math.max(1, ingredient[2] - old_amount)
|
||||
end
|
||||
|
|
@ -238,7 +193,7 @@ end
|
|||
|
||||
-- multiply the cost, energy, and results of a recipe by a multiple
|
||||
function util.multiply_recipe(recipe_name, multiple)
|
||||
if bypass[recipe_name] then return end
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
multiply_recipe(data.raw.recipe[recipe_name], multiple)
|
||||
multiply_recipe(data.raw.recipe[recipe_name].normal, multiple)
|
||||
|
|
@ -290,14 +245,108 @@ function multiply_recipe(recipe, multiple)
|
|||
end
|
||||
end
|
||||
|
||||
-- Remove an element of type t and name from data.raw
|
||||
function util.remove_raw(t, name)
|
||||
for i, elem in pairs(data.raw[t]) do
|
||||
if elem.name == name then
|
||||
data.raw[t][i] = nil
|
||||
break
|
||||
-- Returns true if a recipe has an ingredient
|
||||
function util.has_ingredient(recipe_name, ingredient)
|
||||
return data.raw.recipe[recipe_name] and (
|
||||
has_ingredient(data.raw.recipe[recipe_name], ingredient) or
|
||||
has_ingredient(data.raw.recipe[recipe_name].normal, ingredient))
|
||||
end
|
||||
|
||||
function has_ingredient(recipe, ingredient)
|
||||
if recipe ~= nil and recipe.ingredients ~= nil then
|
||||
for i, existing in pairs(recipe.ingredients) do
|
||||
if existing[1] == ingredient or existing.name == ingredient then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Replace one product with another in a recipe
|
||||
function util.replace_product(recipe_name, old, new)
|
||||
if data.raw.recipe[recipe_name] then
|
||||
replace_product(data.raw.recipe[recipe_name], old, new)
|
||||
replace_product(data.raw.recipe[recipe_name].normal, old, new)
|
||||
replace_product(data.raw.recipe[recipe_name].expensive, old, new)
|
||||
end
|
||||
end
|
||||
|
||||
function replace_product(recipe, old, new)
|
||||
if recipe ~= nil and recipe.results ~= nil then
|
||||
if recipe.result == old then
|
||||
recipe.results = new
|
||||
return
|
||||
end
|
||||
for i, result in pairs(recipe.results) do
|
||||
if result.name == old then result.name = new end
|
||||
if result[1] == old then result[1] = new end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Remove an element of type t and name from data.raw
|
||||
function util.remove_raw(t, name)
|
||||
if data.raw[t][name] then
|
||||
for i, elem in pairs(data.raw[t]) do
|
||||
if elem.name == name then
|
||||
data.raw[t][i] = nil
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Multiply energy required
|
||||
function util.multiply_time(recipe, factor)
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] then
|
||||
multiply_time(data.raw.recipe[recipe_name], factor)
|
||||
multiply_time(data.raw.recipe[recipe_name].normal, factor)
|
||||
multiply_time(data.raw.recipe[recipe_name].expensive, factor)
|
||||
end
|
||||
end
|
||||
|
||||
function multiply_time(recipe, factor)
|
||||
if recipe then
|
||||
if recipe.energy_required then
|
||||
recipe.energy_required = recipe.energy_required * factor
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Set recipe category
|
||||
function util.set_category(recipe, category)
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe] then
|
||||
data.raw.recipe[recipe].category = category
|
||||
end
|
||||
end
|
||||
|
||||
-- Set recipe subgroup
|
||||
function util.set_subgroup(recipe, subgroup)
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe] then
|
||||
data.raw.recipe[recipe].subgroup = subgroup
|
||||
end
|
||||
end
|
||||
|
||||
function util.set_to_founding(recipe)
|
||||
util.set_category(recipe, "founding")
|
||||
util.set_subgroup(recipe, "foundry-intermediate")
|
||||
end
|
||||
|
||||
-- Add crafting category to an entity
|
||||
function util.add_crafting_category(entity_type, entity, category)
|
||||
if data.raw[entity_type][entity] then
|
||||
for i, existing in pairs(data.raw[entity_type][entity].crafting_categories) do
|
||||
if existing == category then
|
||||
log(entity.." not adding "..new.." -- duplicate")
|
||||
return
|
||||
end
|
||||
end
|
||||
table.insert(data.raw[entity_type][entity].crafting_categories, category)
|
||||
end
|
||||
end
|
||||
|
||||
return util
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bztitanium",
|
||||
"version": "0.12.3",
|
||||
"version": "0.12.4",
|
||||
"factorio_version": "1.1",
|
||||
"title": "Titanium",
|
||||
"author": "Brevven",
|
||||
|
|
|
|||
117
me.lua
Normal file
117
me.lua
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
local me = {}
|
||||
|
||||
me.name = "bztitanium"
|
||||
me.titanium_plate = ""
|
||||
me.titanium_processing = ""
|
||||
|
||||
if mods["FactorioExtended-Plus-Core"] then
|
||||
me.titanium_plate = "titanium-alloy"
|
||||
else
|
||||
me.titanium_plate = "titanium-plate"
|
||||
end
|
||||
|
||||
if mods["pyrawores"] then
|
||||
me.titanium_processing = "titanium-mk01"
|
||||
else
|
||||
me.titanium_processing = "titanium-processing"
|
||||
end
|
||||
|
||||
function me.steel_to_titanium(name)
|
||||
replace_ingredient(name, "steel-plate", me.titanium_plate)
|
||||
end
|
||||
|
||||
function me.add_titanium_ingredient(amount, name)
|
||||
add_ingredient(name, me.titanium_plate, amount)
|
||||
end
|
||||
|
||||
function me.rare_to_titanium(name)
|
||||
replace_ingredient(name, "rare-metals", me.titanium_plate)
|
||||
end
|
||||
|
||||
function me.add_titanium_prerequisite(name)
|
||||
add_prerequisite(name, me.titanium_processing)
|
||||
end
|
||||
|
||||
function me.get_setting(name)
|
||||
if settings.startup[name] == nil then
|
||||
return nil
|
||||
end
|
||||
return settings.startup[name].value
|
||||
end
|
||||
|
||||
function me.fluid_amount()
|
||||
local amt = me.get_setting("bztitanium-mining-fluid-amount")
|
||||
return amt and amt or 3
|
||||
end
|
||||
|
||||
me.bypass = {}
|
||||
if me.get_setting(me.name.."-recipe-bypass") then
|
||||
for recipe in string.gmatch(me.get_setting(me.name.."-recipe-bypass"), '[^",%s]+') do
|
||||
me.bypass[recipe] = true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- TODO These helpers are all duplicates, remove them
|
||||
--
|
||||
function replace_ingredient(recipe_name, old, new)
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[new] then
|
||||
xreplace_ingredient(data.raw.recipe[recipe_name], old, new)
|
||||
xreplace_ingredient(data.raw.recipe[recipe_name].normal, old, new)
|
||||
xreplace_ingredient(data.raw.recipe[recipe_name].expensive, old, new)
|
||||
end
|
||||
end
|
||||
|
||||
function xreplace_ingredient(recipe, old, new)
|
||||
if recipe ~= nil and recipe.ingredients ~= nil then
|
||||
for i, existing in pairs(recipe.ingredients) do
|
||||
if existing[1] == new or existing.name == new then
|
||||
log("Not adding "..new.." -- duplicate")
|
||||
return
|
||||
end
|
||||
end
|
||||
for i, ingredient in pairs(recipe.ingredients) do
|
||||
if ingredient.name == old then ingredient.name = new end
|
||||
if ingredient[1] == old then ingredient[1] = new end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function add_prerequisite(technology_name, prerequisite)
|
||||
technology = data.raw.technology[technology_name]
|
||||
if technology and data.raw.technology[prerequisite] then
|
||||
if technology.prerequisites then
|
||||
table.insert(technology.prerequisites, prerequisite)
|
||||
else
|
||||
technology.prerequisites = {prerequisite}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function add_ingredient(recipe_name, ingredient, quantity)
|
||||
if me.bypass[recipe_name] then return end
|
||||
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then
|
||||
xadd_ingredient(data.raw.recipe[recipe_name], ingredient, quantity)
|
||||
xadd_ingredient(data.raw.recipe[recipe_name].normal, ingredient, quantity)
|
||||
xadd_ingredient(data.raw.recipe[recipe_name].expensive, ingredient, quantity)
|
||||
end
|
||||
end
|
||||
|
||||
function xadd_ingredient(recipe, ingredient, quantity)
|
||||
if recipe ~= nil and recipe.ingredients ~= nil then
|
||||
for i, existing in pairs(recipe.ingredients) do
|
||||
if existing[1] == ingredient or existing.name == ingredient then
|
||||
log("Not adding "..ingredient.." -- duplicate")
|
||||
return
|
||||
end
|
||||
end
|
||||
table.insert(recipe.ingredients, {ingredient, quantity})
|
||||
end
|
||||
end
|
||||
--
|
||||
-- End duplicates
|
||||
--
|
||||
|
||||
return me
|
||||
|
|
@ -9,12 +9,12 @@ if settings.startup["bztitanium-mining-fluid"] then
|
|||
end
|
||||
|
||||
if mining_fluid == "chlorine" and data.raw.fluid["chlorine"] and mods["Krastorio2"] then
|
||||
data.raw.technology[util.titanium_processing].prerequisites = {"kr-fluids-chemistry"}
|
||||
data.raw.technology[util.titanium_processing].unit.ingredients = {
|
||||
data.raw.technology[util.me.titanium_processing].prerequisites = {"kr-fluids-chemistry"}
|
||||
data.raw.technology[util.me.titanium_processing].unit.ingredients = {
|
||||
{"basic-tech-card", 1}, {"automation-science-pack", 1}, {"logistic-science-pack", 1}}
|
||||
elseif mining_fluid == "sulfuric-acid" then
|
||||
data.raw.technology[util.titanium_processing].prerequisites = {"sulfur-processing"}
|
||||
data.raw.technology[util.titanium_processing].unit.ingredients = {
|
||||
data.raw.technology[util.me.titanium_processing].prerequisites = {"sulfur-processing"}
|
||||
data.raw.technology[util.me.titanium_processing].unit.ingredients = {
|
||||
{"automation-science-pack", 1}, {"logistic-science-pack", 1}}
|
||||
else
|
||||
if data.raw.technology["titanium-processing"] then
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ data:extend(
|
|||
recipe = "dirty-water-filtration-titanium",
|
||||
}
|
||||
},
|
||||
prerequisites = {"kr-enriched-ores", util.titanium_processing},
|
||||
prerequisites = {"kr-enriched-ores", util.me.titanium_processing},
|
||||
unit =
|
||||
{
|
||||
count = 150,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ data:extend({
|
|||
hardness = 1,
|
||||
mining_particle = "titanium-ore-particle",
|
||||
mining_time = 2,
|
||||
fluid_amount = util.fluid_amount(),
|
||||
fluid_amount = util.me.fluid_amount(),
|
||||
required_fluid=(settings.startup["bztitanium-mining-fluid"] and settings.startup["bztitanium-mining-fluid"].value or "lubricant"),
|
||||
result = "titanium-ore"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ if mods["5dim_core"] then
|
|||
enabled = false,
|
||||
energy_required = 140,
|
||||
ingredients = {{"titanium-ore", 425}},
|
||||
result = util.titanium_plate,
|
||||
result = util.me.titanium_plate,
|
||||
result_count = 100,
|
||||
}
|
||||
})
|
||||
table.insert(data.raw.technology[util.titanium_processing].effects,
|
||||
table.insert(data.raw.technology[util.me.titanium_processing].effects,
|
||||
{type = "unlock-recipe", recipe="titanium-plate-industrial-ore"})
|
||||
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ if mods["5dim_core"] then
|
|||
ingredients = {
|
||||
{"titanium-dust", 5}
|
||||
},
|
||||
result = util.titanium_plate
|
||||
result = util.me.titanium_plate
|
||||
},
|
||||
{
|
||||
type = "recipe",
|
||||
|
|
@ -78,21 +78,21 @@ if mods["5dim_core"] then
|
|||
enabled = false,
|
||||
energy_required = 140,
|
||||
ingredients = {{"titanium-dust", 425}},
|
||||
result = util.titanium_plate,
|
||||
result = util.me.titanium_plate,
|
||||
result_count = 100,
|
||||
}
|
||||
})
|
||||
table.insert(data.raw.technology[util.titanium_processing].effects,
|
||||
table.insert(data.raw.technology[util.me.titanium_processing].effects,
|
||||
{type = "unlock-recipe", recipe="titanium-dust"})
|
||||
table.insert(data.raw.technology[util.titanium_processing].effects,
|
||||
table.insert(data.raw.technology[util.me.titanium_processing].effects,
|
||||
{type = "unlock-recipe", recipe="titanium-plate-dust"})
|
||||
table.insert(data.raw.technology[util.titanium_processing].effects,
|
||||
table.insert(data.raw.technology[util.me.titanium_processing].effects,
|
||||
{type = "unlock-recipe", recipe="titanium-plate-industrial-dust"})
|
||||
|
||||
if mods["5dim_automation"] then
|
||||
for i, name in ipairs(
|
||||
{"5d-assembling-machine-07","5d-assembling-machine-08","5d-lab-06","5d-lab-07"}) do
|
||||
util.steel_to_titanium(name)
|
||||
util.me.steel_to_titanium(name)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -115,7 +115,7 @@ if mods["5dim_core"] then
|
|||
end
|
||||
|
||||
if mods["5dim_battlefield"] then
|
||||
util.steel_to_titanium(name)
|
||||
util.me.steel_to_titanium(name)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,19 +7,19 @@ if mods["Krastorio2"] then
|
|||
util.replace_ingredient("advanced-tech-card", "electric-engine-unit", "flying-robot-frame")
|
||||
|
||||
-- Flavor changes
|
||||
util.rare_to_titanium("kr-electric-mining-drill-mk2")
|
||||
util.rare_to_titanium("kr-advanced-transport-belt")
|
||||
util.rare_to_titanium("kr-advanced-loader")
|
||||
util.me.rare_to_titanium("kr-electric-mining-drill-mk2")
|
||||
util.me.rare_to_titanium("kr-advanced-transport-belt")
|
||||
util.me.rare_to_titanium("kr-advanced-loader")
|
||||
if mods["deadlock-beltboxes-loaders"] then
|
||||
util.rare_to_titanium("kr-advanced-transport-belt-beltbox")
|
||||
util.rare_to_titanium("kr-advanced-transport-belt-loader")
|
||||
util.me.rare_to_titanium("kr-advanced-transport-belt-beltbox")
|
||||
util.me.rare_to_titanium("kr-advanced-transport-belt-loader")
|
||||
end
|
||||
|
||||
util.steel_to_titanium("kr-quarry-drill")
|
||||
util.steel_to_titanium("kr-singularity-lab")
|
||||
util.me.steel_to_titanium("kr-quarry-drill")
|
||||
util.me.steel_to_titanium("kr-singularity-lab")
|
||||
|
||||
util.steel_to_titanium("stack-inserter")
|
||||
util.steel_to_titanium("stack-filter-inserter")
|
||||
util.me.steel_to_titanium("stack-inserter")
|
||||
util.me.steel_to_titanium("stack-filter-inserter")
|
||||
|
||||
util.add_titanium_ingredient(40, "kr-advanced-steam-turbine")
|
||||
util.me.add_titanium_ingredient(40, "kr-advanced-steam-turbine")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ if mods["modmashsplinter"] then
|
|||
end
|
||||
|
||||
if mods["modmashsplinterlogistics"] then
|
||||
util.steel_to_titanium("regenerative-transport-belt")
|
||||
util.steel_to_titanium("regenerative-splitter")
|
||||
util.steel_to_titanium("regenerative-underground-belt-structure")
|
||||
util.steel_to_titanium("regenerative-mini-loader")
|
||||
util.me.steel_to_titanium("regenerative-transport-belt")
|
||||
util.me.steel_to_titanium("regenerative-splitter")
|
||||
util.me.steel_to_titanium("regenerative-underground-belt-structure")
|
||||
util.me.steel_to_titanium("regenerative-mini-loader")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,22 +3,22 @@ local util = require("__bztitanium__.data-util");
|
|||
|
||||
if data.raw.recipe["se-space-pipe"] then
|
||||
-- Space Exploration space stuff
|
||||
util.steel_to_titanium("se-space-pipe")
|
||||
util.steel_to_titanium("se-space-transport-belt")
|
||||
util.steel_to_titanium("se-space-underground-belt")
|
||||
util.steel_to_titanium("se-space-splitter")
|
||||
util.steel_to_titanium("se-space-rail")
|
||||
util.add_titanium_ingredient(1, "se-space-platform-scaffold")
|
||||
util.me.steel_to_titanium("se-space-pipe")
|
||||
util.me.steel_to_titanium("se-space-transport-belt")
|
||||
util.me.steel_to_titanium("se-space-underground-belt")
|
||||
util.me.steel_to_titanium("se-space-splitter")
|
||||
util.me.steel_to_titanium("se-space-rail")
|
||||
util.me.add_titanium_ingredient(1, "se-space-platform-scaffold")
|
||||
|
||||
-- Space Exploration alternative LDS
|
||||
util.steel_to_titanium("se-low-density-structure-beryllium")
|
||||
util.me.steel_to_titanium("se-low-density-structure-beryllium")
|
||||
|
||||
-- Space Exploration buildings
|
||||
util.add_titanium_ingredient(20, "se-condenser-turbine")
|
||||
util.me.add_titanium_ingredient(20, "se-condenser-turbine")
|
||||
|
||||
-- A couple more deeper tech thematic items to use titanium in.
|
||||
util.add_titanium_ingredient(2, "se-lattice-pressure-vessel")
|
||||
util.add_titanium_ingredient(2, "se-aeroframe-bulkhead")
|
||||
util.me.add_titanium_ingredient(2, "se-lattice-pressure-vessel")
|
||||
util.me.add_titanium_ingredient(2, "se-aeroframe-bulkhead")
|
||||
|
||||
-- Organization
|
||||
data.raw.item["titanium-plate"].subgroup = "plates"
|
||||
|
|
@ -26,10 +26,10 @@ if data.raw.recipe["se-space-pipe"] then
|
|||
-- deadlock loaders for SE -- mods["deadlock-beltboxes-loaders"]
|
||||
if mods["Deadlock-SE-bridge"] then
|
||||
if data.raw.recipe["se-space-transport-belt-loader"] then
|
||||
util.steel_to_titanium("se-space-transport-belt-loader")
|
||||
util.me.steel_to_titanium("se-space-transport-belt-loader")
|
||||
end
|
||||
if data.raw.recipe["se-space-transport-belt-beltbox"] then
|
||||
util.steel_to_titanium("se-space-transport-belt-beltbox")
|
||||
util.me.steel_to_titanium("se-space-transport-belt-beltbox")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ local util = require("__bztitanium__.data-util");
|
|||
|
||||
if deadlock then
|
||||
deadlock.add_stack("titanium-ore", "__bztitanium__/graphics/icons/stacked/titanium-ore-stacked.png", "deadlock-stacking-2", 64)
|
||||
deadlock.add_stack(util.titanium_plate, "__bztitanium__/graphics/icons/stacked/titanium-plate-stacked.png" , "deadlock-stacking-2", 64)
|
||||
deadlock.add_stack(util.me.titanium_plate, "__bztitanium__/graphics/icons/stacked/titanium-plate-stacked.png" , "deadlock-stacking-2", 64)
|
||||
if mods["Krastorio2"] then
|
||||
deadlock.add_stack("enriched-titanium", "__bztitanium__/graphics/icons/stacked/enriched-titanium-stacked.png" , "deadlock-stacking-2", 64)
|
||||
end
|
||||
|
|
@ -13,7 +13,7 @@ end
|
|||
-- Deadlock crating recipes
|
||||
if deadlock_crating then
|
||||
deadlock_crating.add_crate("titanium-ore", "deadlock-crating-2")
|
||||
deadlock_crating.add_crate(util.titanium_plate, "deadlock-crating-2")
|
||||
deadlock_crating.add_crate(util.me.titanium_plate, "deadlock-crating-2")
|
||||
if mods["Krastorio2"] then
|
||||
deadlock_crating.add_crate("enriched-titanium", "deadlock-crating-2")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,43 +2,43 @@ local util = require("__bztitanium__.data-util");
|
|||
|
||||
-- Various vehicle/transport mod changes
|
||||
if mods["Aircraft"] then
|
||||
util.steel_to_titanium("gunship")
|
||||
util.steel_to_titanium("cargo-plane")
|
||||
util.steel_to_titanium("flying-fortress")
|
||||
util.add_titanium_ingredient(10, "aircraft-afterburner")
|
||||
util.me.steel_to_titanium("gunship")
|
||||
util.me.steel_to_titanium("cargo-plane")
|
||||
util.me.steel_to_titanium("flying-fortress")
|
||||
util.me.add_titanium_ingredient(10, "aircraft-afterburner")
|
||||
|
||||
-- jet doesn't use steel in base aircraft mod, but leave this here just in case that changes
|
||||
util.steel_to_titanium("jet")
|
||||
util.me.steel_to_titanium("jet")
|
||||
end
|
||||
|
||||
if mods["betterCargoPlanes"] then
|
||||
util.steel_to_titanium("better-cargo-plane")
|
||||
util.me.steel_to_titanium("better-cargo-plane")
|
||||
end
|
||||
|
||||
if mods["HelicopterRevival"] or mods["Helicopters"] then
|
||||
util.steel_to_titanium("heli-recipe")
|
||||
util.me.steel_to_titanium("heli-recipe")
|
||||
end
|
||||
|
||||
if mods["adamo-chopper"] then
|
||||
util.steel_to_titanium("chopper-recipe")
|
||||
util.me.steel_to_titanium("chopper-recipe")
|
||||
end
|
||||
|
||||
if mods["jetpack"] then
|
||||
util.steel_to_titanium("jetpack-1")
|
||||
util.me.steel_to_titanium("jetpack-1")
|
||||
end
|
||||
|
||||
if mods["Hovercrafts"] or mods["Hovercrafts_Realism"] then
|
||||
util.steel_to_titanium("hcraft-recipe")
|
||||
util.add_titanium_prerequisite("hcraft-tech")
|
||||
util.me.steel_to_titanium("hcraft-recipe")
|
||||
util.me.add_titanium_prerequisite("hcraft-tech")
|
||||
end
|
||||
|
||||
if mods["Raven"] then
|
||||
util.add_titanium_ingredient(100, "raven")
|
||||
util.me.add_titanium_ingredient(100, "raven")
|
||||
end
|
||||
|
||||
if mods["Hover-Car"] then
|
||||
util.steel_to_titanium("hover-car-recipe")
|
||||
util.steel_to_titanium("hover-car-mk2-recipe")
|
||||
util.me.steel_to_titanium("hover-car-recipe")
|
||||
util.me.steel_to_titanium("hover-car-mk2-recipe")
|
||||
end
|
||||
|
||||
if mods["fast_trans"] then
|
||||
|
|
@ -48,9 +48,9 @@ if mods["fast_trans"] then
|
|||
"fast-one-mk2 txt",
|
||||
"fast-one-mk3 txt",
|
||||
}) do
|
||||
util.steel_to_titanium(item)
|
||||
util.me.steel_to_titanium(item)
|
||||
end
|
||||
util.add_titanium_prerequisite("fast-one-tech-mk2")
|
||||
util.me.add_titanium_prerequisite("fast-one-tech-mk2")
|
||||
end
|
||||
|
||||
-- Just a general compatiblity improvement with py alien life enabled alongside jetpack or other equipment mods
|
||||
|
|
|
|||
|
|
@ -3,31 +3,31 @@
|
|||
|
||||
local util = require("__bztitanium__.data-util");
|
||||
|
||||
util.steel_to_titanium("low-density-structure")
|
||||
util.me.steel_to_titanium("low-density-structure")
|
||||
if mods["modmashsplintergold"] then
|
||||
util.steel_to_titanium("low-density-structure-with-gold")
|
||||
util.me.steel_to_titanium("low-density-structure-with-gold")
|
||||
end
|
||||
|
||||
if not mods["bobrevamp"] then
|
||||
util.add_titanium_prerequisite("low-density-structure")
|
||||
util.me.add_titanium_prerequisite("low-density-structure")
|
||||
end
|
||||
|
||||
if (not mods["bobplates"]) then
|
||||
util.steel_to_titanium("flying-robot-frame")
|
||||
util.add_titanium_prerequisite("robotics")
|
||||
util.me.steel_to_titanium("flying-robot-frame")
|
||||
util.me.add_titanium_prerequisite("robotics")
|
||||
end
|
||||
|
||||
if (mods["bobrevamp"] and not mods["bobplates"] and not mods["angelssmelting"]) then
|
||||
util.steel_to_titanium("flying-robot-frame-2")
|
||||
util.steel_to_titanium("flying-robot-frame-3")
|
||||
util.steel_to_titanium("flying-robot-frame-4")
|
||||
util.me.steel_to_titanium("flying-robot-frame-2")
|
||||
util.me.steel_to_titanium("flying-robot-frame-3")
|
||||
util.me.steel_to_titanium("flying-robot-frame-4")
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- Memory storage changes
|
||||
if data.raw.item["memory-unit"] then
|
||||
util.steel_to_titanium("memory-unit")
|
||||
util.me.steel_to_titanium("memory-unit")
|
||||
end
|
||||
|
||||
-- Underwater pipes changes
|
||||
|
|
@ -43,8 +43,8 @@ if data.raw.item["underwater-pipe"] then
|
|||
table.remove(data.raw.technology["underwater-pipes"].prerequisites, index)
|
||||
end
|
||||
end
|
||||
util.add_titanium_prerequisite("underwater-pipes")
|
||||
util.me.add_titanium_prerequisite("underwater-pipes")
|
||||
|
||||
util.steel_to_titanium("underwater-pipe")
|
||||
util.me.steel_to_titanium("underwater-pipe")
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
local util = require("__bztitanium__.data-util");
|
||||
|
||||
local recipes = {util.titanium_plate}
|
||||
local recipes = {util.me.titanium_plate}
|
||||
|
||||
if mods["Krastorio2"] then
|
||||
table.insert(recipes, "enriched-titanium-plate")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ local util = require("__bztitanium__.data-util");
|
|||
|
||||
if mods["space-exploration"] then
|
||||
se_delivery_cannon_recipes["titanium-ore"] = {name= "titanium-ore"}
|
||||
se_delivery_cannon_recipes[util.titanium_plate] = {name= util.titanium_plate}
|
||||
se_delivery_cannon_recipes[util.me.titanium_plate] = {name= util.me.titanium_plate}
|
||||
if mods["Krastorio2"] then
|
||||
data:extend({
|
||||
{
|
||||
|
|
@ -20,7 +20,7 @@ if mods["space-exploration"] then
|
|||
{name = "se-vulcanite-block", amount = 1},
|
||||
},
|
||||
results = {
|
||||
{name = util.titanium_plate, amount = 6},
|
||||
{name = util.me.titanium_plate, amount = 6},
|
||||
},
|
||||
icons =
|
||||
{
|
||||
|
|
@ -50,7 +50,7 @@ if mods["space-exploration"] then
|
|||
{name = "se-vulcanite-block", amount = 1},
|
||||
},
|
||||
results = {
|
||||
{name = util.titanium_plate, amount = 6},
|
||||
{name = util.me.titanium_plate, amount = 6},
|
||||
},
|
||||
icons =
|
||||
{
|
||||
|
|
@ -61,6 +61,6 @@ if mods["space-exploration"] then
|
|||
})
|
||||
table.insert(data.raw.technology["se-processing-vulcanite"].effects,
|
||||
{type = "unlock-recipe", recipe= "titanium-smelting-vulcanite"})
|
||||
util.add_titanium_prerequisite(data.raw.technology["se-processing-vulcanite"])
|
||||
util.me.add_titanium_prerequisite(data.raw.technology["se-processing-vulcanite"])
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,50 +3,50 @@
|
|||
local util = require("__bztitanium__.data-util");
|
||||
|
||||
if (not mods["bobplates"]) then
|
||||
util.steel_to_titanium("power-armor")
|
||||
util.add_prerequisite("power-armor", util.titanium_processing)
|
||||
util.me.steel_to_titanium("power-armor")
|
||||
util.add_prerequisite("power-armor", util.me.titanium_processing)
|
||||
|
||||
-- Generally, steel-based equipment techs require solar panel tech, so only require
|
||||
-- titanium processing for that.
|
||||
util.add_prerequisite("solar-panel-equipment", util.titanium_processing)
|
||||
util.add_prerequisite("solar-panel-equipment", util.me.titanium_processing)
|
||||
|
||||
|
||||
-- All equipment that uses steel now uses titanium. Who wants to carry around steel!
|
||||
for name, recipe in pairs(data.raw.recipe) do
|
||||
if recipe.result ~= nil and recipe.result:find("equipment") then
|
||||
util.steel_to_titanium(recipe.name)
|
||||
util.me.steel_to_titanium(recipe.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- Also add titanium to some nuclear steam-handling stuff
|
||||
util.add_titanium_ingredient(20, "steam-turbine")
|
||||
util.me.add_titanium_ingredient(20, "steam-turbine")
|
||||
if not mods["pyrawores"] then
|
||||
util.add_titanium_ingredient(20, "heat-exchanger")
|
||||
util.add_prerequisite("nuclear-power", util.titanium_processing)
|
||||
util.me.add_titanium_ingredient(20, "heat-exchanger")
|
||||
util.add_prerequisite("nuclear-power", util.me.titanium_processing)
|
||||
end
|
||||
|
||||
-- Krastorio 2 changes
|
||||
if mods["Krastorio2"] then
|
||||
util.add_prerequisite("kr-electric-mining-drill-mk2", util.titanium_processing)
|
||||
util.add_prerequisite("kr-quarry-minerals-extraction", util.titanium_processing)
|
||||
util.add_prerequisite("kr-electric-mining-drill-mk2", util.me.titanium_processing)
|
||||
util.add_prerequisite("kr-quarry-minerals-extraction", util.me.titanium_processing)
|
||||
end
|
||||
|
||||
if mods["Aircraft"] then
|
||||
util.add_prerequisite("advanced-aerodynamics", util.titanium_processing)
|
||||
util.add_prerequisite("advanced-aerodynamics", util.me.titanium_processing)
|
||||
end
|
||||
|
||||
if mods["eve-weaponry"] then
|
||||
util.steel_to_titanium("small-titanium-sabot")
|
||||
util.me.steel_to_titanium("small-titanium-sabot")
|
||||
end
|
||||
|
||||
if mods["FastFurnaces"] then
|
||||
util.add_titanium_ingredient(1, "fast-long-handed-inserter")
|
||||
util.me.add_titanium_ingredient(1, "fast-long-handed-inserter")
|
||||
end
|
||||
|
||||
if mods["NuclearFurnace"] then
|
||||
util.add_titanium_ingredient(200, "nuclear-furnace-4")
|
||||
util.me.add_titanium_ingredient(200, "nuclear-furnace-4")
|
||||
end
|
||||
|
||||
-- Useful Equipment
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ if (not mods["pyrawores"] and not mods["bobplates"]) then
|
|||
data:extend({
|
||||
{
|
||||
type = "recipe",
|
||||
name = util.titanium_plate,
|
||||
name = util.me.titanium_plate,
|
||||
category = "smelting",
|
||||
order = "d[titanium-plate]",
|
||||
icons = (mods["Krastorio2"] and
|
||||
|
|
@ -35,25 +35,25 @@ data:extend({
|
|||
enabled = false,
|
||||
energy_required = 16,
|
||||
ingredients = {{"titanium-ore", 10}},
|
||||
results = {{type="item", name= util.titanium_plate, amount_min=2, amount_max=3}},
|
||||
results = {{type="item", name= util.me.titanium_plate, amount_min=2, amount_max=3}},
|
||||
} or
|
||||
{
|
||||
enabled = false,
|
||||
energy_required = 8,
|
||||
ingredients = {{"titanium-ore", 5}},
|
||||
result = util.titanium_plate
|
||||
result = util.me.titanium_plate
|
||||
}),
|
||||
expensive =
|
||||
{
|
||||
enabled = false,
|
||||
energy_required = 16,
|
||||
ingredients = {{"titanium-ore", 10}},
|
||||
result = util.titanium_plate
|
||||
result = util.me.titanium_plate
|
||||
}
|
||||
},
|
||||
{
|
||||
type = "item",
|
||||
name = util.titanium_plate,
|
||||
name = util.me.titanium_plate,
|
||||
icon = "__bztitanium__/graphics/icons/titanium-plate.png",
|
||||
icon_size = 64, icon_mipmaps = 3,
|
||||
subgroup = "raw-material",
|
||||
|
|
@ -69,7 +69,7 @@ data:extend({
|
|||
{
|
||||
{
|
||||
type = "unlock-recipe",
|
||||
recipe = util.titanium_plate
|
||||
recipe = util.me.titanium_plate
|
||||
},
|
||||
mods["TheBigFurnace"] and {
|
||||
type = "unlock-recipe",
|
||||
|
|
@ -104,7 +104,7 @@ data:extend({
|
|||
enabled = false,
|
||||
energy_required = 8.75,
|
||||
ingredients = {{"titanium-ore", 50}},
|
||||
result = util.titanium_plate,
|
||||
result = util.me.titanium_plate,
|
||||
result_count = 10,
|
||||
},
|
||||
expensive =
|
||||
|
|
@ -112,7 +112,7 @@ data:extend({
|
|||
enabled = false,
|
||||
energy_required = 16,
|
||||
ingredients = {{"titanium-ore", 100}},
|
||||
result = util.titanium_plate,
|
||||
result = util.me.titanium_plate,
|
||||
result_count = 10,
|
||||
}
|
||||
} or nil,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue