Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.bak
.idea
2 changes: 1 addition & 1 deletion compatibility/248k.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
38 changes: 11 additions & 27 deletions data-util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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},
}
}
Expand Down Expand Up @@ -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},
}
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"? Krastorio2",
"? Krastorio2-spaced-out",
"? Rich-Rocks-Requiem",
"? 248k",
"? 248k-Redux",
"? tenebris",
"? deadlock-beltboxes-loaders",
"? DeadlockCrating"
Expand Down
8 changes: 4 additions & 4 deletions lead-enriched.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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]",
Expand Down
78 changes: 6 additions & 72 deletions lead-recipe-se.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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({
{
Expand Down Expand Up @@ -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,
Expand All @@ -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},
Expand All @@ -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,
Expand All @@ -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
2 changes: 1 addition & 1 deletion lead-recipe-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
6 changes: 3 additions & 3 deletions lead-recipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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},
Expand All @@ -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},
Expand Down
2 changes: 1 addition & 1 deletion strange-matter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down