up
This commit is contained in:
parent
29fb353735
commit
ba0ce3a314
2 changed files with 66 additions and 32 deletions
|
|
@ -20,4 +20,10 @@ function util.get_list()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function util.force_enable_recipe(event, recipe_name)
|
||||||
|
if game.players[event.player_index].force.recipes[recipe_name] then
|
||||||
|
game.players[event.player_index].force.recipes[recipe_name].enabled=true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return util
|
return util
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,14 @@ function util.k2matter(params)
|
||||||
if not params.k2matter.minimum_conversion_quantity then
|
if not params.k2matter.minimum_conversion_quantity then
|
||||||
params.k2matter.minimum_conversion_quantity = 10
|
params.k2matter.minimum_conversion_quantity = 10
|
||||||
end
|
end
|
||||||
|
if not data.raw.technology[params.k2matter.unlocked_by_technology] then
|
||||||
|
local icon = ""
|
||||||
|
if params.k2baseicon then
|
||||||
|
icon = util.k2assets().."/technologies/matter-"..params.k2baseicon..".png"
|
||||||
|
else
|
||||||
|
icon = util.k2assets().."/technologies/backgrounds/matter.png"
|
||||||
|
end
|
||||||
|
|
||||||
data:extend(
|
data:extend(
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
@ -138,7 +146,7 @@ function util.k2matter(params)
|
||||||
icons =
|
icons =
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
icon = util.k2assets().."/technologies/matter-"..params.k2baseicon..".png",
|
icon = icon,
|
||||||
icon_size = 256,
|
icon_size = 256,
|
||||||
},
|
},
|
||||||
params.icon,
|
params.icon,
|
||||||
|
|
@ -147,16 +155,28 @@ function util.k2matter(params)
|
||||||
unit =
|
unit =
|
||||||
{
|
{
|
||||||
count = 350,
|
count = 350,
|
||||||
ingredients =
|
ingredients = mods["space-exploration"] and
|
||||||
|
{
|
||||||
|
{"automation-science-pack", 1},
|
||||||
|
{"logistic-science-pack", 1},
|
||||||
|
{"chemical-science-pack", 1},
|
||||||
|
{"se-astronomic-science-pack-4", 1},
|
||||||
|
{"se-energy-science-pack-4", 1},
|
||||||
|
{"se-material-science-pack-4", 1},
|
||||||
|
{"se-deep-space-science-pack-2", 1},
|
||||||
|
{"se-kr-matter-science-pack-2", 1},
|
||||||
|
} or
|
||||||
{
|
{
|
||||||
{"production-science-pack", 1},
|
{"production-science-pack", 1},
|
||||||
{"utility-science-pack", 1},
|
{"utility-science-pack", 1},
|
||||||
{"matter-tech-card", 1}
|
{"matter-tech-card", 1}
|
||||||
},
|
},
|
||||||
time = 45,
|
time = 45,
|
||||||
}
|
},
|
||||||
|
localised_name = {"technology-name.k2-conversion", {"item-name."..params.k2matter.item_name}},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
end
|
||||||
matter.createMatterRecipe(params.k2matter)
|
matter.createMatterRecipe(params.k2matter)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -533,6 +553,8 @@ end
|
||||||
|
|
||||||
function add_product(recipe, product)
|
function add_product(recipe, product)
|
||||||
if recipe ~= nil then
|
if recipe ~= nil then
|
||||||
|
if (product[1] and data.raw.item[product[1]]) or
|
||||||
|
(product.name and data.raw[product.type][product.name]) then
|
||||||
if not recipe.normal then
|
if not recipe.normal then
|
||||||
if recipe.results == nil then
|
if recipe.results == nil then
|
||||||
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}}
|
recipe.results = {{recipe.result, recipe.result_count and recipe.result_count or 1}}
|
||||||
|
|
@ -543,6 +565,7 @@ function add_product(recipe, product)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- Get the amount of the ingredient, will check base/normal not expensive
|
-- Get the amount of the ingredient, will check base/normal not expensive
|
||||||
function util.get_ingredient_amount(recipe_name, ingredient_name)
|
function util.get_ingredient_amount(recipe_name, ingredient_name)
|
||||||
|
|
@ -1008,7 +1031,7 @@ end
|
||||||
-- Set recipe subgroup
|
-- Set recipe subgroup
|
||||||
function util.set_subgroup(recipe_name, subgroup, options)
|
function util.set_subgroup(recipe_name, subgroup, options)
|
||||||
if not should_force(options) and bypass(recipe_name) then return end
|
if not should_force(options) and bypass(recipe_name) then return end
|
||||||
if data.raw.recipe[recipe_name] then
|
if data.raw.recipe[recipe_name] and data.raw["item-subgroup"][subgroup] then
|
||||||
me.add_modified(recipe_name)
|
me.add_modified(recipe_name)
|
||||||
data.raw.recipe[recipe_name].subgroup = subgroup
|
data.raw.recipe[recipe_name].subgroup = subgroup
|
||||||
end
|
end
|
||||||
|
|
@ -1027,8 +1050,6 @@ function util.add_icon(recipe_name, icon, options)
|
||||||
if data.raw.recipe[recipe_name] then
|
if data.raw.recipe[recipe_name] then
|
||||||
me.add_modified(recipe_name)
|
me.add_modified(recipe_name)
|
||||||
if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then
|
if not (data.raw.recipe[recipe_name].icons and #(data.raw.recipe[recipe_name].icons) > 0) then
|
||||||
log("BZZN")
|
|
||||||
log(serpent.dump(data.raw.recipe[recipe_name]))
|
|
||||||
if data.raw.recipe[recipe_name].icon then
|
if data.raw.recipe[recipe_name].icon then
|
||||||
data.raw.recipe[recipe_name].icons = {{
|
data.raw.recipe[recipe_name].icons = {{
|
||||||
icon=data.raw.recipe[recipe_name].icon,
|
icon=data.raw.recipe[recipe_name].icon,
|
||||||
|
|
@ -1047,6 +1068,13 @@ function util.add_icon(recipe_name, icon, options)
|
||||||
icon_size=data.raw.item[data.raw.recipe[recipe_name].result].icon_size,
|
icon_size=data.raw.item[data.raw.recipe[recipe_name].result].icon_size,
|
||||||
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].result].icon_mipmaps,
|
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].result].icon_mipmaps,
|
||||||
}}
|
}}
|
||||||
|
elseif data.raw.recipe[recipe_name].normal and
|
||||||
|
data.raw.item[data.raw.recipe[recipe_name].normal.result] then
|
||||||
|
data.raw.recipe[recipe_name].icons = {{
|
||||||
|
icon=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon,
|
||||||
|
icon_size=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_size,
|
||||||
|
icon_mipmaps=data.raw.item[data.raw.recipe[recipe_name].normal.result].icon_mipmaps,
|
||||||
|
}}
|
||||||
end
|
end
|
||||||
data.raw.recipe[recipe_name].icon = nil
|
data.raw.recipe[recipe_name].icon = nil
|
||||||
data.raw.recipe[recipe_name].icon_size = nil
|
data.raw.recipe[recipe_name].icon_size = nil
|
||||||
|
|
@ -1301,7 +1329,7 @@ function replace_ingredients_prior_to(tech, old, new, multiplier)
|
||||||
end
|
end
|
||||||
if technology.prerequisites then
|
if technology.prerequisites then
|
||||||
for i, prerequisite in pairs(technology.prerequisites) do
|
for i, prerequisite in pairs(technology.prerequisites) do
|
||||||
log("BZZZ checking " .. prerequisite) -- Handy Debug :|
|
-- log("BZZZ checking " .. prerequisite) -- Handy Debug :|
|
||||||
if string.sub(prerequisite, 1, 3) ~= 'ei_' then
|
if string.sub(prerequisite, 1, 3) ~= 'ei_' then
|
||||||
replace_ingredients_prior_to(prerequisite, old, new, multiplier)
|
replace_ingredients_prior_to(prerequisite, old, new, multiplier)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue