catalysis
This commit is contained in:
parent
859c24939f
commit
877e26ab3d
3 changed files with 154 additions and 0 deletions
105
prototypes/catalyst.lua
Normal file
105
prototypes/catalyst.lua
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
local util = require("data-util");
|
||||||
|
|
||||||
|
if util.me.catalysis() then
|
||||||
|
if util.me.palladium() or util.me.platinum() then
|
||||||
|
data:extend({
|
||||||
|
{
|
||||||
|
type = "item",
|
||||||
|
name = "ptpd-catalyst",
|
||||||
|
icon = "__bzgold__/graphics/icons/ptpd-catalyst.png",
|
||||||
|
icon_size = 128,
|
||||||
|
pictures = {
|
||||||
|
{filename="__bzgold__/graphics/icons/ptpd-catalyst.png", size=128, scale=0.125},
|
||||||
|
{filename="__bzgold__/graphics/icons/ptpd-catalyst-1.png", size=128, scale=0.125},
|
||||||
|
{filename="__bzgold__/graphics/icons/ptpd-catalyst-2.png", size=128, scale=0.125},
|
||||||
|
{filename="__bzgold__/graphics/icons/ptpd-catalyst-3.png", size=128, scale=0.125},
|
||||||
|
},
|
||||||
|
subgroup = "intermediate-product",
|
||||||
|
order = "b[catalyst]",
|
||||||
|
stack_size = util.get_stack_size(100),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type = "technology",
|
||||||
|
name = "catalysis",
|
||||||
|
icons = {
|
||||||
|
{
|
||||||
|
icon = "__base__/graphics/technology/oil-processing.png",
|
||||||
|
icon_size = 256,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
effects = {},
|
||||||
|
unit = {
|
||||||
|
count = 100, time = 20,
|
||||||
|
ingredients = {
|
||||||
|
{"automation-science-pack", 1},
|
||||||
|
{"logistic-science-pack", 1},
|
||||||
|
{"chemical-science-pack", 1},
|
||||||
|
{"production-science-pack", 1},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
prerequisites = {"production-science-pack"},
|
||||||
|
order = "b-b",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local base = "stone"
|
||||||
|
if mods.bzaluminum then base = "alumina"
|
||||||
|
elseif mods.bzsilicon then base = "silica"
|
||||||
|
end
|
||||||
|
|
||||||
|
local fluid = "sulfuric-acid"
|
||||||
|
if data.raw.fluid["hydrogen-chloride"] then fluid = "hydrogen-chloride"
|
||||||
|
end
|
||||||
|
|
||||||
|
if util.me.palladium() then
|
||||||
|
data:extend({
|
||||||
|
{
|
||||||
|
type = "recipe",
|
||||||
|
name = "pd-catalyst",
|
||||||
|
main_product = "ptpd-catalyst",
|
||||||
|
category = "chemistry",
|
||||||
|
order = "d[catalyst]",
|
||||||
|
enabled = false,
|
||||||
|
energy_required = 1.6,
|
||||||
|
ingredients = {
|
||||||
|
{base, 1},
|
||||||
|
{"palladium-ingot", 1},
|
||||||
|
{type="fluid", name=fluid, amount=100, catalyst_amount=100},
|
||||||
|
},
|
||||||
|
results = {
|
||||||
|
{"ptpd-catalyst", 1},
|
||||||
|
{type="fluid", name=fluid, amount=90, catalyst_amount=90},
|
||||||
|
{type="fluid", name="water", amount=10, catalyst_amount=9},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
if util.me.platinum() then
|
||||||
|
data:extend({
|
||||||
|
{
|
||||||
|
type = "recipe",
|
||||||
|
name = "pt-catalyst",
|
||||||
|
main_product = "ptpd-catalyst",
|
||||||
|
category = "chemistry",
|
||||||
|
order = "d[catalyst]",
|
||||||
|
enabled = false,
|
||||||
|
energy_required = 1.6,
|
||||||
|
ingredients = {
|
||||||
|
{base, 1},
|
||||||
|
{"platinum-ingot", 1},
|
||||||
|
{type="fluid", name=fluid, amount=100, catalyst_amount=100},
|
||||||
|
},
|
||||||
|
results = {
|
||||||
|
{"ptpd-catalyst", 1},
|
||||||
|
{type="fluid", name=fluid, amount=90, catalyst_amount=90},
|
||||||
|
{type="fluid", name="water", amount=10, catalyst_amount=9},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
util.add_unlock("catalysis", "pt-catalyst")
|
||||||
|
util.add_unlock("catalysis", "pd-catalyst")
|
||||||
|
end
|
||||||
|
|
||||||
47
prototypes/oil-updates.lua
Normal file
47
prototypes/oil-updates.lua
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
local futil = require("util");
|
||||||
|
local util = require("data-util");
|
||||||
|
|
||||||
|
local recipes_to_update = {
|
||||||
|
"heavy-oil-cracking",
|
||||||
|
"light-oil-cracking",
|
||||||
|
"solid-fuel-from-heavy-oil",
|
||||||
|
"solid-fuel-from-light-oil",
|
||||||
|
"solid-fuel-from-petroleum-gas",
|
||||||
|
"phenol-from-oil",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
local prefix = "catalyzed-"
|
||||||
|
for i, recipe_name in pairs(recipes_to_update) do
|
||||||
|
-- create a copy of the recipe
|
||||||
|
local r = futil.table.deepcopy(data.raw.recipe[recipe_name])
|
||||||
|
new_name = prefix..r.name
|
||||||
|
r.name = new_name
|
||||||
|
|
||||||
|
if string.find(new_name, "cracking") then
|
||||||
|
r.localised_name = {"", {"recipe-name.catalyzed"}, " ", {"recipe-name."..recipe_name}}
|
||||||
|
else
|
||||||
|
local s
|
||||||
|
s, _ = string.find(recipe_name, "-from-") -- bit of a hack
|
||||||
|
r.main_product = string.sub(recipe_name, 1, s-1)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- copy should require 1 catalyst, and have 90% chance to return 1 catalyst
|
||||||
|
data:extend({r})
|
||||||
|
util.add_ingredient(new_name, "ptpd-catalyst", 1, {force=true})
|
||||||
|
util.add_product(new_name, {type="item", name="ptpd-catalyst", amount=1,
|
||||||
|
catalyst_amount=1, probability=.9}, {force=true})
|
||||||
|
util.add_icon(new_name, {icon="__bzgold__/graphics/icons/ptpd-catalyst.png",
|
||||||
|
icon_size=128, scale=0.124, shift={8,-8}})
|
||||||
|
|
||||||
|
-- halve the time of the copy recipe
|
||||||
|
util.multiply_time(new_name, 0.5, {force=true})
|
||||||
|
|
||||||
|
-- copy should be unlocked by "catalysis"
|
||||||
|
util.add_unlock("catalysis", new_name)
|
||||||
|
|
||||||
|
-- add 10 to the input oil ingredients of the basic recipe
|
||||||
|
for j, fluid in pairs({"heavy-oil", "light-oil", "petroleum-gas"}) do
|
||||||
|
util.add_to_ingredient(recipe_name, fluid, 10)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -24,3 +24,5 @@ if mods.bzsilicon then
|
||||||
util.add_unlock("advanced-electronics-2", "cpu")
|
util.add_unlock("advanced-electronics-2", "cpu")
|
||||||
end
|
end
|
||||||
util.add_unlock("advanced-electronics-2", "mainboard")
|
util.add_unlock("advanced-electronics-2", "mainboard")
|
||||||
|
|
||||||
|
util.add_unlock("coal-liquefaction", "catalysis")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue