catalysis recipe fixes
This commit is contained in:
parent
dfc1ea7507
commit
6cf3745335
1 changed files with 28 additions and 26 deletions
|
|
@ -14,36 +14,38 @@ local recipes_to_update = {
|
||||||
|
|
||||||
local prefix = "catalyzed-"
|
local prefix = "catalyzed-"
|
||||||
for i, recipe_name in pairs(recipes_to_update) do
|
for i, recipe_name in pairs(recipes_to_update) do
|
||||||
-- create a copy of the recipe
|
if data.raw.recipe[recipe_name] then
|
||||||
local r = futil.table.deepcopy(data.raw.recipe[recipe_name])
|
-- create a copy of the recipe
|
||||||
new_name = prefix..r.name
|
local r = futil.table.deepcopy(data.raw.recipe[recipe_name])
|
||||||
r.name = new_name
|
new_name = prefix..r.name
|
||||||
|
r.name = new_name
|
||||||
|
|
||||||
if string.find(new_name, "cracking") then
|
if string.find(new_name, "cracking") then
|
||||||
r.localised_name = {"", {"recipe-name.catalyzed"}, " ", {"recipe-name."..recipe_name}}
|
r.localised_name = {"", {"recipe-name.catalyzed"}, " ", {"recipe-name."..recipe_name}}
|
||||||
else
|
else
|
||||||
local s
|
local s
|
||||||
s, _ = string.find(recipe_name, "-from-") -- bit of a hack
|
s, _ = string.find(recipe_name, "-from-") -- bit of a hack
|
||||||
r.main_product = string.sub(recipe_name, 1, s-1)
|
r.main_product = string.sub(recipe_name, 1, s-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- copy should require 1 catalyst, and have 90% chance to return 1 catalyst
|
-- copy should require 1 catalyst, and have 90% chance to return 1 catalyst
|
||||||
data:extend({r})
|
data:extend({r})
|
||||||
util.add_ingredient(new_name, "ptpd-catalyst", 1, {force=true})
|
util.add_ingredient(new_name, "ptpd-catalyst", 1, {force=true})
|
||||||
util.add_product(new_name, {type="item", name="ptpd-catalyst", amount=1,
|
util.add_product(new_name, {type="item", name="ptpd-catalyst", amount=1,
|
||||||
catalyst_amount=1, probability=.9}, {force=true})
|
catalyst_amount=1, probability=.9}, {force=true})
|
||||||
util.add_icon(new_name, {icon="__bzgold__/graphics/icons/ptpd-catalyst.png",
|
util.add_icon(new_name, {icon="__bzgold__/graphics/icons/ptpd-catalyst.png",
|
||||||
icon_size=128, scale=0.124, shift={8,-8}})
|
icon_size=128, scale=0.124, shift={8,-8}})
|
||||||
|
|
||||||
-- halve the time of the copy recipe
|
-- halve the time of the copy recipe
|
||||||
util.multiply_time(new_name, 0.5, {force=true})
|
util.multiply_time(new_name, 0.5, {force=true})
|
||||||
|
|
||||||
-- copy should be unlocked by "catalysis"
|
-- copy should be unlocked by "catalysis"
|
||||||
util.add_unlock("catalysis", new_name)
|
util.add_unlock("catalysis", new_name)
|
||||||
|
|
||||||
-- add 10 to the input oil ingredients of the basic recipe
|
-- add 10 to the input oil ingredients of the basic recipe
|
||||||
for j, fluid in pairs({"heavy-oil", "light-oil", "petroleum-gas"}) do
|
for j, fluid in pairs({"heavy-oil", "light-oil", "petroleum-gas"}) do
|
||||||
util.add_to_ingredient(recipe_name, fluid, 10)
|
util.add_to_ingredient(recipe_name, fluid, 10)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue