This commit is contained in:
2025-01-27 23:18:18 +09:00
parent 032d8dea12
commit 00e21c8eca
2 changed files with 21 additions and 25 deletions

View File

@@ -356,7 +356,7 @@ local items = {
graphics_name = 'solar-panel-equipment' graphics_name = 'solar-panel-equipment'
} }
}, },
['item-productivity'] = { ['item_productivity'] = {
['solar-panel'] = 'solar-energy', ['solar-panel'] = 'solar-energy',
['accumulator'] = 'electric-energy-accumulators', ['accumulator'] = 'electric-energy-accumulators',
['landfill'] = 'landfill', ['landfill'] = 'landfill',

View File

@@ -334,33 +334,29 @@ if settings.startup['PHI-MI'].value then
end end
if settings.startup['PHI-MI-PRODUCTIVITY'].value then if settings.startup['PHI-MI-PRODUCTIVITY'].value then
local function add_prod_tech(name, tech) for k, v in pairs(items.item_productivity) do
if data.raw.technology[v] then
data:extend({{ data:extend({{
type = 'technology', type = 'technology',
name = name .. '-productivity', name = k .. '-productivity',
prerequisites = tech, prerequisites = tech,
effects = { effects = {
{ {
type = 'change-recipe-productivity', type = 'change-recipe-productivity',
recipe = name, recipe = k,
change = 0.1 change = 0.1
} }
}, },
unit = { unit = {
count_formula = '(1.5^L)*1000', count_formula = '(1.5^L)*1000',
ingredients = table.deepcopy(data.raw.technology[tech].unit.ingredients), ingredients = table.deepcopy(data.raw.technology[v].unit.ingredients),
time = data.raw.technology[tech].unit.time time = data.raw.technology[v].unit.time
}, },
icon = data.raw.technology[tech].icon, icon = data.raw.technology[v].icon,
max_level = 'infinite', max_level = 'infinite',
upgrade = true upgrade = true
}}) }})
end end
for k, v in pairs(items.item_productivity) do
if data.raw.technology[v] then
add_prod_tech(k, v)
end
end end
end end