diff --git a/.gitignore b/.gitignore index 751553b..b18a15d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.bak +.idea \ No newline at end of file diff --git a/compatibility/248k.lua b/compatibility/248k.lua index 5e69008..1e0125f 100644 --- a/compatibility/248k.lua +++ b/compatibility/248k.lua @@ -3,7 +3,7 @@ local util = require("data-util"); local pb2 = "fu_lead_item" -if mods["248k"] then +if mods["248k-Redux"] then -- Swap out all 248k titanium for BZ titanium_plate for i, recipe in pairs(data.raw.recipe) do util.replace_ingredient(recipe.name, pb2, "lead-plate") diff --git a/data-final-fixes.lua b/data-final-fixes.lua index abe6676..e24546b 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -18,7 +18,7 @@ if util.k2() then local lead_bolt = util.me.more_entities() and "lead-expansion-bolt" or "lead-plate" util.replace_ingredient("kr-rifle-magazine", "iron-plate", "lead-plate") util.replace_ingredient("kr-anti-materiel-rifle-magazine", "iron-plate", "lead-plate") - util.replace_some_ingredient("kr-crusher", "iron-beam", 5, lead_bolt, 5) + util.replace_some_ingredient("kr-crusher", "kr-iron-beam", 5, lead_bolt, 5) util.replace_ingredient("kr-shelter", "iron-plate", lead_bolt) util.add_ingredient("kr-advanced-furnace", lead_bolt, 20) util.replace_ingredient("uranium-fuel-cell", "steel-plate", "lead-plate") diff --git a/data-util.lua b/data-util.lua index ddf7a5d..98ed044 100644 --- a/data-util.lua +++ b/data-util.lua @@ -504,8 +504,8 @@ function util.se_landfill(params) category = "hard-recycling", order = "z-b-"..params.ore, subgroup = "terrain", - result = "landfill", - ingredients = {{params.ore, 50}}, + results = {{type="item", name="landfill", amount=1}}, + ingredients = {{type="item", name=params.ore, amount=50}}, } }) util.add_unlock("se-recycling-facility", lname) @@ -584,7 +584,6 @@ end -- se matter -- params: ore, energy_required, quant_out, quant_in, icon_size, stream_out function util.se_matter(params) - if mods["space-exploration"] > "0.6" then if not params.quant_in then params.quant_in = params.quant_out end if not params.icon_size then params.icon_size = 64 end local fname = "matter-fusion-"..params.ore @@ -611,15 +610,15 @@ function util.se_matter(params) energy_required = params.energy_required, enabled = false, ingredients = { - {sedata, 1}, + {type="item", name=sedata, amount=1}, {type="fluid", name="se-particle-stream", amount=50}, {type="fluid", name="se-space-coolant-supercooled", amount=25}, }, results = { - {params.ore, params.quant_out}, - {"se-contaminated-scrap", 1}, - {type=item, name=sedata, amount=1, probability=.99}, - {type=item, name=sejunk, amount=1, probability=.01}, + {type="item", name=params.ore, amount=params.quant_out}, + {type="item", name="se-contaminated-scrap", amount=1}, + {type="item", name=sedata, amount=1, probability=.99}, + {type="item", name=sejunk, amount=1, probability=.01}, {type="fluid", name="se-space-coolant-hot", amount=25, ignored_by_stats=25, ignored_by_productivity=25}, } } @@ -650,13 +649,13 @@ function util.se_matter(params) energy_required = 30, enabled = false, ingredients = { - {"se-kr-matter-liberation-data", 1}, - {params.ore, params.quant_in}, + {type="item", name="se-kr-matter-liberation-data", amount=1}, + {type="item", name=params.ore, amount=params.quant_in}, {type="fluid", name="se-particle-stream", amount=50}, }, results = { - {type=item, name="se-kr-matter-liberation-data", amount=1, probability=.99}, - {type=item, name=sejunk, amount=1, probability=.01}, + {type="item", name="se-kr-matter-liberation-data", amount=1, probability=.99}, + {type="item", name=sejunk, amount=1, probability=.01}, {type="fluid", name="se-particle-stream", amount=params.stream_out, ignored_by_stats=50, ignored_by_productivity=50}, } } @@ -696,7 +695,6 @@ function util.se_matter(params) util.add_unlock("bz-advanced-stream-production", lname) end end -end -- deprecated -- Get the normal prototype for a recipe -- either .normal or the recipe itself @@ -1119,7 +1117,6 @@ end function replace_some_product(recipe, old, old_amount, new, new_amount) if recipe ~= nil then - if recipe.result == new then return end if recipe.results then for i, existing in pairs(recipe.results) do if existing.name == new then @@ -1211,10 +1208,6 @@ function set_product_amount(recipe, product, amount) end end end - if not recipe.results and not recipe.result_count then - -- implicit one item result - recipe.result_count = amount - end end end @@ -1348,10 +1341,6 @@ function replace_product(recipe, old, new, options) if recipe.main_product == old then recipe.main_product = new end - if recipe.result == old then - recipe.result = new - return - end if recipe.results then for i, result in pairs(recipe.results) do if result.name == old then result.name = new end @@ -1611,10 +1600,6 @@ end function add_to_product(recipe, product, amount) if recipe ~= nil and recipe.results ~= nil then - if recipe.result == product then - recipe.result_count = recipe.result_count + amount - return - end for i, result in pairs(recipe.results) do if result.name == product then result.amount = result.amount + amount @@ -1823,7 +1808,6 @@ function util.sum_products(recipe_name) -- this is going to end up approximate in some cases, integer division is probs fine if data.raw.recipe[recipe_name] then local recipe = data.raw.recipe[recipe_name] - if not recipe.results then return recipe.result_count end local sum = 0 for i, result in pairs(recipe.results) do local amt = 0 diff --git a/info.json b/info.json index 82fa9db..e915e3c 100644 --- a/info.json +++ b/info.json @@ -15,7 +15,7 @@ "? Krastorio2", "? Krastorio2-spaced-out", "? Rich-Rocks-Requiem", - "? 248k", + "? 248k-Redux", "? tenebris", "? deadlock-beltboxes-loaders", "? DeadlockCrating" diff --git a/lead-enriched.lua b/lead-enriched.lua index 7597222..26bc32f 100644 --- a/lead-enriched.lua +++ b/lead-enriched.lua @@ -11,10 +11,10 @@ data:extend( icon = "__bzlead__/graphics/icons/enriched-lead.png", icon_mipmaps = 3, pictures = { - {filename="__bzlead__/graphics/icons/enriched-lead.png", size=64, scale=0.25}, - {filename="__bzlead__/graphics/icons/enriched-lead-1.png", size=64, scale=0.25}, - {filename="__bzlead__/graphics/icons/enriched-lead-2.png", size=64, scale=0.25}, - {filename="__bzlead__/graphics/icons/enriched-lead-3.png", size=64, scale=0.25}, + {filename="__bzlead__/graphics/icons/enriched-lead.png", size=64, scale=0.5}, + {filename="__bzlead__/graphics/icons/enriched-lead-1.png", size=64, scale=0.5}, + {filename="__bzlead__/graphics/icons/enriched-lead-2.png", size=64, scale=0.5}, + {filename="__bzlead__/graphics/icons/enriched-lead-3.png", size=64, scale=0.5}, }, subgroup = "raw-material", order = "e05-a[enriched-ores]-a1[enriched-lead]", diff --git a/lead-recipe-se.lua b/lead-recipe-se.lua index 4751f96..cf5b0a4 100644 --- a/lead-recipe-se.lua +++ b/lead-recipe-se.lua @@ -6,7 +6,6 @@ if mods["space-exploration"] then se_delivery_cannon_recipes[util.me.lead_plate] = {name= util.me.lead_plate} util.se_landfill({ore="lead-ore"}) -if string.sub(mods["space-exploration"], 1, 3) == "0.6" then util.se_matter({ore="lead-ore", energy_required=1, quant_out=10, stream_out=60}) data:extend({ { @@ -51,7 +50,7 @@ if string.sub(mods["space-exploration"], 1, 3) == "0.6" then }, energy_required = 60, ingredients = { - {name = util.k2() and "enriched-lead" or "lead-ore", amount = 24}, + {type="item", name = util.k2() and "enriched-lead" or "lead-ore", amount = 24}, {type = "fluid", name = "se-pyroflux", amount = 10}, }, enabled = false, @@ -63,7 +62,7 @@ if string.sub(mods["space-exploration"], 1, 3) == "0.6" then type = "recipe", name = "lead-ingot", category = "casting", - results = {{"lead-ingot", 1}}, + results = {{type="item", name="lead-ingot", amount=1}}, energy_required = 25, ingredients = { {type = "fluid", name = "molten-lead", amount = 250}, @@ -82,11 +81,11 @@ if string.sub(mods["space-exploration"], 1, 3) == "0.6" then {icon = "__bzlead__/graphics/icons/lead-ingot.png", icon_size = 128, scale = 0.125, shift = {-8, -8}}, }, results = { - {name = "lead-plate", amount = 10}, + {type="item", name = "lead-plate", amount = 10}, }, energy_required = 5, ingredients = { - {name = "lead-ingot", amount = 1} + {type="item", name = "lead-ingot", amount = 1} }, enabled = false, always_show_made_in = true, @@ -105,72 +104,7 @@ if string.sub(mods["space-exploration"], 1, 3) == "0.6" then data.raw.recipe["enriched-lead-plate"].order= "d[lead-plate]" se_delivery_cannon_recipes["enriched-lead"] = {name= "enriched-lead"} else - if util.me.byproduct() then util.add_product("molten-lead", {"copper-ore", 6}) end + if util.me.byproduct() then util.add_product("molten-lead", { type = "item", name = "copper-ore", amount = 6 }) end end se_delivery_cannon_recipes["lead-ingot"] = {name="lead-ingot"} -else - data.raw.item["lead-plate"].subgroup = "plates" - if util.k2() then - data:extend({ - { - type = "recipe", - name = "enriched-lead-smelting-vulcanite", - category = "smelting", - order = "d[lead-plate]", - energy_required = 24, - enabled = false, - always_show_made_in = true, - allow_as_intermediate = false, - ingredients = { - {name = "enriched-lead", amount = 8}, - {name = "se-vulcanite-block", amount = 1}, - }, - results = { - {name = util.me.lead_plate, amount = 12}, - }, - icons = - { - { icon = "__bzlead__/graphics/icons/lead-plate.png", icon_size = 64 }, - { icon = "__space-exploration-graphics__/graphics/icons/vulcanite-block.png", icon_size = 64, scale=0.25, shift= {-10, -10}}, - }, - - }, - }) - table.insert(data.raw.technology["se-processing-vulcanite"].effects, - {type = "unlock-recipe", recipe= "enriched-lead-smelting-vulcanite"}) - data.raw.recipe["enriched-lead-plate"].order= "d[lead-plate]" - se_delivery_cannon_recipes["enriched-lead"] = {name= "enriched-lead"} - else - data:extend({ - { - type = "recipe", - name = "lead-smelting-vulcanite", - category = "smelting", - subgroup = "plates", - order = "d[lead-plate]", - energy_required = 24, - enabled = false, - always_show_made_in = true, - allow_as_intermediate = false, - ingredients = { - {name = "lead-ore", amount = 8}, - {name = "se-vulcanite-block", amount = 1}, - }, - results = { - {name = util.me.lead_plate, amount = util.me.byproduct() and 10 or 12}, - }, - icons = - { - { icon = "__bzlead__/graphics/icons/lead-plate.png", icon_size = 64, icon_mipmaps = 3 }, - { icon = "__space-exploration-graphics__/graphics/icons/vulcanite-block.png", icon_size = 64, icon_mipmaps = 3, scale=0.25, shift= {-10, -10}}, - }, - - - }, - }) - if util.me.byproduct() then util.add_product("lead-smelting-vulcanite", {"copper-ore", 2}) end - table.insert(data.raw.technology["se-processing-vulcanite"].effects, - {type = "unlock-recipe", recipe= "lead-smelting-vulcanite"}) - end -end -end +end \ No newline at end of file diff --git a/lead-recipe-updates.lua b/lead-recipe-updates.lua index 9a29d0b..e693144 100644 --- a/lead-recipe-updates.lua +++ b/lead-recipe-updates.lua @@ -282,7 +282,7 @@ util.add_ingredient("storehouse-basic", "lead-plate", 8) -- Leighzer's scrap if mods.leighzerscrapyards then util.add_to_product("scrap-processing", "iron-plate", -1) - util.add_product("scrap-processing", {"lead-plate", 1}) + util.add_product("scrap-processing", { type = "item", name = "lead-plate", amount = 1 }) end util.add_minable_result("simple-entity", "huge-volcanic-rock", {type="item", name="lead-ore", amount_min=10, amount_max=24}) diff --git a/lead-recipe.lua b/lead-recipe.lua index c2a7564..dbfda83 100644 --- a/lead-recipe.lua +++ b/lead-recipe.lua @@ -374,7 +374,7 @@ data:extend({ { enabled = true, energy_required = 16, - ingredients = {{"lead-ore", 10}}, + ingredients = {{ type = "item", name = "lead-ore", amount = 10 }}, results = { {type="item", name = "lead-ingot", amount_min=4, amount_max=5}, {type="item", name = "copper-ore", amount_min=1, amount_max=2}, @@ -383,7 +383,7 @@ data:extend({ { enabled = true, energy_required = 6.4, - ingredients = {{"lead-ore", 2}}, + ingredients = {{ type = "item", name = "lead-ore", amount = 2 }}, results = { {type="item", name = "lead-ingot", amount=2, probability=5/6}, {type="item", name = "copper-ore", amount=1, probability=1/3}, @@ -393,7 +393,7 @@ data:extend({ { enabled = true, energy_required = 12.8, - ingredients = {{"lead-ore", 4}}, + ingredients = {{ type = "item", name = "lead-ore", amount = 4 }}, results = { {type="item", name = "lead-ingot", amount=2, probability=5/6}, {type="item", name = "copper-ore", amount=2, probability=1/3}, diff --git a/strange-matter.lua b/strange-matter.lua index 529267f..450c8d7 100644 --- a/strange-matter.lua +++ b/strange-matter.lua @@ -16,7 +16,7 @@ data:extend({ enabled = false, energy_required = 1, ingredients = {{type="fluid", name="strange-matter", amount = 1}}, - result = ore, + results = {{ type = "item", name = ore, amount = 1 }}, category = "crafting-with-fluid", subgroup = "synthesis", },