remove rare_to_titanium
This commit is contained in:
parent
1a34ed2dcf
commit
9d2bb61d29
3 changed files with 11 additions and 32 deletions
|
|
@ -1,4 +1,10 @@
|
|||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.12.5
|
||||
Date: 2021-07-28
|
||||
Fixes:
|
||||
- Fix major recipe bug introduced in 0.12.4 (thanks GeneralTank for report).
|
||||
- Completed refactor to remove legacy helper functions.
|
||||
---------------------------------------------------------------------------------------------------
|
||||
Version: 0.12.4
|
||||
Date: 2021-07-26
|
||||
Changes:
|
||||
|
|
|
|||
27
me.lua
27
me.lua
|
|
@ -20,10 +20,6 @@ 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
|
||||
|
|
@ -51,29 +47,6 @@ 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]
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ if mods["Krastorio2"] then
|
|||
util.replace_ingredient("advanced-tech-card", "electric-engine-unit", "flying-robot-frame")
|
||||
|
||||
-- Flavor changes
|
||||
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")
|
||||
util.replace_ingredient("kr-electric-mining-drill-mk2", "rare-metals", "titanium-plate")
|
||||
util.replace_ingredient("kr-advanced-transport-belt", "rare-metals", "titanium-plate")
|
||||
util.replace_ingredient("kr-advanced-loader", "rare-metals", "titanium-plate")
|
||||
if mods["deadlock-beltboxes-loaders"] then
|
||||
util.me.rare_to_titanium("kr-advanced-transport-belt-beltbox")
|
||||
util.me.rare_to_titanium("kr-advanced-transport-belt-loader")
|
||||
util.replace_ingredient("kr-advanced-transport-belt-beltbox", "rare-metals", "titanium-plate")
|
||||
util.replace_ingredient("kr-advanced-transport-belt-loader", "rare-metals", "titanium-plate")
|
||||
end
|
||||
|
||||
util.replace_ingredient("kr-quarry-drill", "steel-plate", "titanium-plate")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue