remove add_titanium_prerequisite

This commit is contained in:
Brevven 2021-07-27 23:15:38 -07:00
parent 9d2bb61d29
commit 2b9b99f60d
4 changed files with 6 additions and 24 deletions

15
me.lua
View file

@ -20,10 +20,6 @@ function me.add_titanium_ingredient(amount, name)
add_ingredient(name, me.titanium_plate, amount) add_ingredient(name, me.titanium_plate, amount)
end end
function me.add_titanium_prerequisite(name)
add_prerequisite(name, me.titanium_processing)
end
function me.get_setting(name) function me.get_setting(name)
if settings.startup[name] == nil then if settings.startup[name] == nil then
return nil return nil
@ -48,17 +44,6 @@ end
-- TODO These helpers are all duplicates, remove them -- TODO These helpers are all duplicates, remove them
-- --
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) function add_ingredient(recipe_name, ingredient, quantity)
if me.bypass[recipe_name] then return end if me.bypass[recipe_name] then return end
if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then if data.raw.recipe[recipe_name] and data.raw.item[ingredient] then

View file

@ -29,7 +29,7 @@ end
if mods["Hovercrafts"] or mods["Hovercrafts_Realism"] then if mods["Hovercrafts"] or mods["Hovercrafts_Realism"] then
util.replace_ingredient("hcraft-recipe", "steel-plate", "titanium-plate") util.replace_ingredient("hcraft-recipe", "steel-plate", "titanium-plate")
util.me.add_titanium_prerequisite("hcraft-tech") util.add_prerequisite("hcraft-tech", util.me.titanium_processing)
end end
if mods["Raven"] then if mods["Raven"] then
@ -50,7 +50,7 @@ if mods["fast_trans"] then
}) do }) do
util.replace_ingredient(item, "steel-plate", "titanium-plate") util.replace_ingredient(item, "steel-plate", "titanium-plate")
end end
util.me.add_titanium_prerequisite("fast-one-tech-mk2") util.add_prerequisite("fast-one-tech-mk2", util.me.titanium_processing)
end end
-- Just a general compatiblity improvement with py alien life enabled alongside jetpack or other equipment mods -- Just a general compatiblity improvement with py alien life enabled alongside jetpack or other equipment mods

View file

@ -61,6 +61,6 @@ if mods["space-exploration"] then
}) })
table.insert(data.raw.technology["se-processing-vulcanite"].effects, table.insert(data.raw.technology["se-processing-vulcanite"].effects,
{type = "unlock-recipe", recipe= "titanium-smelting-vulcanite"}) {type = "unlock-recipe", recipe= "titanium-smelting-vulcanite"})
util.me.add_titanium_prerequisite(data.raw.technology["se-processing-vulcanite"]) util.add_prerequisite(data.raw.technology["se-processing-vulcanite"], util.me.titanium_processing)
end end
end end

View file

@ -25,13 +25,13 @@ if mods["modmashsplintergold"] then
end end
if not mods["bobrevamp"] then if not mods["bobrevamp"] then
util.me.add_titanium_prerequisite("low-density-structure") util.add_prerequisite("low-density-structure", util.me.titanium_processing)
end end
if (not mods["bobplates"]) then if (not mods["bobplates"]) then
util.replace_ingredient("flying-robot-frame", "steel-plate", "titanium-plate") util.replace_ingredient("flying-robot-frame", "steel-plate", "titanium-plate")
util.me.add_titanium_prerequisite("robotics") util.add_prerequisite("robotics", util.me.titanium_processing)
end end
if (mods["bobrevamp"] and not mods["bobplates"] and not mods["angelssmelting"]) then if (mods["bobrevamp"] and not mods["bobplates"] and not mods["angelssmelting"]) then
@ -40,9 +40,6 @@ if (mods["bobrevamp"] and not mods["bobplates"] and not mods["angelssmelting"])
util.replace_ingredient("flying-robot-frame-4", "steel-plate", "titanium-plate") util.replace_ingredient("flying-robot-frame-4", "steel-plate", "titanium-plate")
end end
if data.raw.recipe["se-space-pipe"] then if data.raw.recipe["se-space-pipe"] then
-- Space Exploration space stuff -- Space Exploration space stuff
util.replace_ingredient("se-space-pipe", "steel-plate", "titanium-plate") util.replace_ingredient("se-space-pipe", "steel-plate", "titanium-plate")
@ -121,7 +118,7 @@ if data.raw.item["underwater-pipe"] then
table.remove(data.raw.technology["underwater-pipes"].prerequisites, index) table.remove(data.raw.technology["underwater-pipes"].prerequisites, index)
end end
end end
util.me.add_titanium_prerequisite("underwater-pipes") util.add_prerequisite("underwater-pipes", util.me.titanium_processing)
util.replace_ingredient("underwater-pipe", "steel-plate", "titanium-plate") util.replace_ingredient("underwater-pipe", "steel-plate", "titanium-plate")
end end