This commit is contained in:
2025-04-27 00:13:06 +09:00
parent 3a0c7993a1
commit 790c6a4cbd

View File

@@ -53,16 +53,11 @@ function main.EEE(source, tier)
end
if item.energy_source.emissions_per_minute then
if source.tech == 'compound-energy' and ((source.type == 'boiler') or (source.name == 'kr-gas-power-station')) then
local m = ((source.tech == 'compound-energy' and ((source.type == 'boiler') or (source.name == 'kr-gas-power-station'))) and (tier - source.min + 2)) or (2 ^ (tier - source.min + 1))
for k, _ in pairs(item.energy_source.emissions_per_minute) do
item.energy_source.emissions_per_minute[k] = item.energy_source.emissions_per_minute[k] * (tier - source.min + 2)
end
else
for k, _ in pairs(item.energy_source.emissions_per_minute) do
item.energy_source.emissions_per_minute[k] = item.energy_source.emissions_per_minute[k] * (2 ^ (tier - source.min + 1))
end
end
end
end
@@ -330,26 +325,9 @@ function main.ER(source, tier)
}
}
if source.category == 'equipment' then
ingredient_name = ((tier == 2) and (ingredient_name .. '-equipment')) or (ingredient_name .. '-mk' .. (tier - 1) .. '-equipment')
new_name = new_name .. '-mk' .. tier .. '-equipment'
result_name = result_name .. '-mk' .. tier .. '-equipment'
else
ingredient_name = ingredient_name .. ((tier > 2) and ('-' .. (tier - 1)) or '')
new_name = new_name .. '-' .. tier
result_name = result_name .. '-' .. tier
end
if (source.tech == 'compound-energy') then
local ingredients
if ((source.type == 'solar-panel') or (source.type == 'accumulator')) then
ingredients = {{type = 'item', name = ingredient_name, amount = tonumber(settings.startup['PHI-MB-ENERGY-SOLAR-RATIO'].value) or 4}}
else
ingredients = (tier > 2 and {{type = 'item', name = ingredient_name, amount = 1}, {type='item', name = source.name, amount = 1}}) or {{type = 'item', name = source.name, amount = 2}}
end
ingredient_name = ((source.category == 'equipment' and (((tier == 2) and (ingredient_name .. '-equipment')) or (ingredient_name .. '-mk' .. (tier - 1) .. '-equipment'))) or (ingredient_name .. ((tier > 2) and ('-' .. (tier - 1)) or '')))
new_name = new_name .. ((source.category == 'equipment' and ('-mk' .. tier .. '-equipment')) or ('-' .. tier))
result_name = result_name .. ((source.category == 'equipment' and ('-mk' .. tier .. '-equipment')) or ('-' .. tier))
data:extend({{
type = 'recipe',
@@ -357,27 +335,12 @@ function main.ER(source, tier)
icons = icons,
energy_required = 2,
enabled = false,
ingredients = ingredients,
ingredients = (source.tech == 'compound-energy' and (((source.type == 'solar-panel') or (source.type == 'accumulator')) and {{type = 'item', name = ingredient_name, amount = tonumber(settings.startup['PHI-MB-ENERGY-SOLAR-RATIO'].value) or 4}}) or ((tier > 2 and {{type = 'item', name = ingredient_name, amount = 1}, {type='item', name = source.name, amount = 1}}) or {{type = 'item', name = source.name, amount = 2}})) or {{type = 'item', name = ingredient_name, amount = 2}},
results = {{type = 'item', name = result_name, amount = 1}},
main_product = result_name,
localised_name = {'?', data.raw[source.type][new_name].localised_name, ''},
localised_description = {'?', data.raw[source.type][new_name].localised_description, ''}
}})
else
data:extend({{
type = 'recipe',
name = new_name,
icons = icons,
energy_required = 2,
enabled = false,
ingredients = {{type = 'item', name = ingredient_name, amount = 2}},
results = {{type = 'item', name = result_name, amount = 1}},
main_product = result_name,
localised_name = {'?', data.raw[source.type][new_name].localised_name, ''},
localised_description = {'?', data.raw[source.type][new_name].localised_description, ''}
}})
end
end
-- technology