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,2 +1,3 @@
*.bak
*.blend*
.idea
3 changes: 1 addition & 2 deletions carbon-recipe-k2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ if util.k2() then
-- HCL graphite processing
if util.me.use_flake_graphite() then
local gsubgroup = "raw-material"
if mods["space-exploration"] and string.sub(mods["space-exploration"], 1, 3) == "0.6" and
data.raw["item-subgroup"]["carbon"] then
if mods["space-exploration"] and data.raw["item-subgroup"]["carbon"] then
gsubgroup = "carbon"
end
data:extend({
Expand Down
10 changes: 4 additions & 6 deletions carbon-recipe-se.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ se_delivery_cannon_recipes["diamond"] = {name= "diamond"}
if util.me.use_flake_graphite() then
util.se_landfill({ore="flake-graphite"})
se_delivery_cannon_recipes["flake-graphite"] = {name= "flake-graphite"}
if mods["space-exploration"] > "0.6" then
util.se_matter({ore="flake-graphite", energy_required=1, quant_out=10, stream_out=60})
end
util.se_matter({ore="flake-graphite", energy_required=1, quant_out=10, stream_out=60})
end
if util.me.use_rough_diamond() then
se_delivery_cannon_recipes["rough-diamond"] = {name= "rough-diamond"}
Expand All @@ -37,11 +35,11 @@ data:extend({
always_show_made_in = true,
allow_as_intermediate = false,
ingredients = {
{name = "graphite", amount = 20},
{name = "se-vulcanite-block", amount = 1},
{type = "item", name = "graphite", amount = 20},
{type = "item", name = "se-vulcanite-block", amount = 1},
},
results = {
{name = "diamond", amount = 3},
{type = "item", name = "diamond", amount = 3},
},
icons =
{
Expand Down
4 changes: 2 additions & 2 deletions carbon-recipe-updates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local util = require("data-util");
util.add_prerequisite("steel-processing", "graphite-processing")

util.add_prerequisite("low-density-structure", "diamond-processing")
util.add_prerequisite("advanced-electronics-2", "diamond-processing")
util.add_prerequisite("processing-unit", "diamond-processing")
util.add_prerequisite("laser", "diamond-processing")

-- update carbon black alternate recipe if possible
Expand Down Expand Up @@ -82,7 +82,7 @@ if util.me.use_fullerenes() then
-- K2
util.add_ingredient("kr-biter-virus", "fullerenes", 100)
util.add_ingredient("kr-creep-virus", "fullerenes", 100)
util.replace_some_ingredient("kr-biomass-growing", "petroleum-gas", 25, "fullerenes", 25)
util.replace_some_ingredient("kr-biomass", "petroleum-gas", 25, "fullerenes", 25)

-- SE
util.add_ingredient("se-vitalic-reagent", "fullerenes", 4)
Expand Down
25 changes: 12 additions & 13 deletions carbon-recipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ data:extend({

-- If no graphite ore, make it from coal or coke
if not util.me.use_flake_graphite() then
if data.raw.item["coke"] then
if data.raw.item[mods["Krastorio2"] and "kr-coke" or "coke"] then
data:extend({
{
type = "recipe",
Expand All @@ -98,7 +98,7 @@ if not util.me.use_flake_graphite() then
order = "d[graphite]",
enabled = false,
energy_required = 0.5,
ingredients = {util.item("coke", 1)},
ingredients = {util.item(mods["Krastorio2"] and "kr-coke" or "coke", 1)},
results = {util.item("graphite", 2)},
}
})
Expand Down Expand Up @@ -277,7 +277,6 @@ data:extend({
order = "b-b"
},
})
local ammonia = mods.Krastorio2 and "kr-ammonia" or "ammonia"
data:extend({
-- graphene
{
Expand All @@ -303,7 +302,7 @@ data:extend({
energy_required = 5,
ingredients = (mods["space-age"] or util.k2()) and {
{type="item", name="graphite", amount=1},
{type="fluid", name=ammonia, amount=5},
{type="fluid", name=util.k2() and "kr-ammonia" or "ammonia", amount=5},
{type="fluid", name="sulfuric-acid", amount=5},
} or {
{type="item", name="graphite", amount=1},
Expand Down Expand Up @@ -582,7 +581,7 @@ end


-- Space exploration subgroups
if mods["space-exploration"] and string.sub(mods["space-exploration"], 1, 3) == "0.6" then
if mods["space-exploration"] then
data:extend({
{
type = "item-subgroup",
Expand Down Expand Up @@ -611,7 +610,7 @@ if mods["space-age"] then
data:extend({
{
type = "surface-property",
name = "oxygen",
name = "kr-oxygen",
default_value = 19,
},
-- make graphite from diamonds on some surfaces
Expand All @@ -628,7 +627,7 @@ if mods["space-age"] then
allow_productivity=true,
energy_required = 16,
surface_conditions = {
{property = "oxygen", max = 20},
{property = "kr-oxygen", max = 20},
},
ingredients = {
{type="item", name="rough-diamond", amount=1},
Expand Down Expand Up @@ -676,10 +675,10 @@ if mods["space-age"] then
})
util.add_unlock("biochamber", "graphite-synthesis")
util.set_recipe_time("burnt-spoilage", 4)
util.set_surface_property("nauvis", "oxygen", 21)
util.set_surface_property("gleba", "oxygen", 30)
util.set_surface_property("fulgora", "oxygen", 15)
util.set_surface_property("vulcanus", "oxygen", 12)
util.set_surface_property("aquilo", "oxygen", 10)
util.set_surface_property("space-platform", "oxygen", 0)
util.set_surface_property("nauvis", "kr-oxygen", 21)
util.set_surface_property("gleba", "kr-oxygen", 30)
util.set_surface_property("fulgora", "kr-oxygen", 15)
util.set_surface_property("vulcanus", "kr-oxygen", 12)
util.set_surface_property("aquilo", "kr-oxygen", 10)
util.set_surface_property("space-platform", "kr-oxygen", 0)
end
4 changes: 2 additions & 2 deletions data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ end


-- Green circuits in final fixes due to K2 shenanigans
if mods.MDbobelectronics or mods.bobelectronics then
if mods.MDbobelectronics or mods.MDbobelectronics2 or mods.bobelectronics then
util.replace_ingredient("basic-electronic-components", "coal", "graphite")
util.replace_ingredient("basic-electronic-components", "coke", "graphite")
util.replace_ingredient("basic-electronic-components", mods["Krastorio2"] and "kr-coke" or "coke", "graphite")
else
-- Electronic circuits need final fixes
function modify_ec(recipe_name, to_replace)
Expand Down
43 changes: 14 additions & 29 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,20 +610,20 @@ 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},
}
}
})
util.add_unlock("se-space-matter-fusion", fname)
util.add_unlock("se-space-matter-fusion", fname)

if util.k2() then
local lname = params.ore.."-to-particle-stream"
Expand All @@ -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 @@ -687,16 +686,15 @@ function util.se_matter(params)
{"kr-matter-tech-card", 1},
{"se-deep-space-science-pack-1", 1},
}

},
prerequisites = {"se-kr-advanced-stream-production"},
},
})
end
util.add_unlock("bz-advanced-stream-production", lname)
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
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"? aai-industry",
"? Krastorio2",
"? Krastorio2-spaced-out",
"? 248k",
"? 248k-Redux",
"(?) modmashsplintersubspacelogistics",
"? deadlock-beltboxes-loaders",
"? DeadlockCrating"
Expand Down
8 changes: 4 additions & 4 deletions prototypes/carbon-fiber.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ data:extend({
order = "d[graphite-carbon-fiber]",
enabled = false,
energy_required = 1,
ingredients = data.raw.fluid["ammonia"] and
ingredients = data.raw.fluid["kr-ammonia"] and
{
{type="fluid", name="petroleum-gas", amount=5},
{type="fluid", name="ammonia", amount=5},
{type="fluid", name="kr-ammonia", amount=5},
} or {
{type="fluid", name="petroleum-gas", amount=10},
},
Expand Down Expand Up @@ -84,8 +84,8 @@ else
energy_required = 24,
ingredients = {
{type="fluid", name="epoxy", amount = 20},
{"plastic-bar", 2},
{"polyacrylonitrile", 4},
{ type = "item", name = "plastic-bar", amount = 2 },
{ type = "item", name = "polyacrylonitrile", amount = 4 },
},
results = {
{type="item", name= "carbon-fiber", amount=8},
Expand Down