This commit is contained in:
2026-06-19 22:13:34 +09:00
parent 6c499375d1
commit 5bb4c56256
+27 -12
View File
@@ -130,6 +130,9 @@ function main_entity(source, tier)
end end
elseif (source.type == 'generator') then elseif (source.type == 'generator') then
item.max_power_output = (item.max_power_output and (tonumber(string.match(item.max_power_output, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.max_power_output, '%a+')) or nil
item.maximum_temperature = (item.maximum_temperature and 15 + ((item.maximum_temperature - 15) * (2 * (tier - source.min + 1)))) or nil
for _, c in pairs({'horizontal_animation', 'vertical_animation'}) do for _, c in pairs({'horizontal_animation', 'vertical_animation'}) do
if item[c] and item[c].layers then if item[c] and item[c].layers then
for _, l in pairs(item[c].layers) do for _, l in pairs(item[c].layers) do
@@ -142,15 +145,11 @@ function main_entity(source, tier)
end end
end end
item.max_power_output = (item.max_power_output and (tonumber(string.match(item.max_power_output, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.max_power_output, '%a+')) or nil
item.maximum_temperature = (item.maximum_temperature and 15 + ((item.maximum_temperature - 15) * (2 * (tier - source.min + 1)))) or nil
elseif (source.type == 'reactor') then elseif (source.type == 'reactor') then
item.consumption = tostring(tonumber(string.match(item.consumption, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.consumption, '%a+') item.consumption = tostring(tonumber(string.match(item.consumption, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.consumption, '%a+')
item.heat_buffer.max_temperature = item.heat_buffer.max_temperature * (2 * (tier - source.min + 1)) item.heat_buffer.max_temperature = item.heat_buffer.max_temperature * (2 * (tier - source.min + 1))
item.heat_buffer.max_transfer = tostring(tonumber(string.match(item.heat_buffer.max_transfer, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.heat_buffer.max_transfer, '%a+') item.heat_buffer.max_transfer = tostring(tonumber(string.match(item.heat_buffer.max_transfer, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.heat_buffer.max_transfer, '%a+')
if item['picture'] and item['picture'].layers then if item['picture'] and item['picture'].layers then
for _, l in pairs(item['picture'].layers) do for _, l in pairs(item['picture'].layers) do
if not l.draw_as_shadow then if not l.draw_as_shadow then
@@ -165,10 +164,34 @@ function main_entity(source, tier)
item.power_input = tostring(tonumber(string.match(item.power_input, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.power_input, '%a+') item.power_input = tostring(tonumber(string.match(item.power_input, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.power_input, '%a+')
item.max_fluid_usage = item.max_fluid_usage * (2 * (tier - source.min + 1)) item.max_fluid_usage = item.max_fluid_usage * (2 * (tier - source.min + 1))
if item['graphics_set'] and item['graphics_set']['structure'] and item['graphics_set']['structure'].layers then
for _, l in pairs(item['graphics_set']['structure'].layers) do
if not l.draw_as_shadow then
l.tint = mod_tint[tier]
end
end
icon_add_number(item['graphics_set']['structure'].layers, tier)
end
elseif (source.type == 'fusion-generator') then elseif (source.type == 'fusion-generator') then
item.energy_source.output_flow_limit = tostring(tonumber(string.match(item.energy_source.output_flow_limit, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.energy_source.output_flow_limit, '%a+') item.energy_source.output_flow_limit = tostring(tonumber(string.match(item.energy_source.output_flow_limit, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.energy_source.output_flow_limit, '%a+')
item.max_fluid_usage = item.max_fluid_usage * (2 * (tier - source.min + 1)) item.max_fluid_usage = item.max_fluid_usage * (2 * (tier - source.min + 1))
if item['graphics_set'] then
for _, c in pairs({'north_graphics_set', 'east_graphics_set', 'south_graphics_set', 'west_graphics_set'}) do
if item['graphics_set'][c] and item['graphics_set'][c].animation and item['graphics_set'][c].animation.layers then
for _, l in pairs(item['graphics_set'][c].animation.layers) do
if not l.draw_as_shadow then
l.tint = mod_tint[tier]
end
end
icon_add_number(item['graphics_set'][c].animation.layers, tier)
end
end
end
elseif (source.type == 'heat-pipe') then elseif (source.type == 'heat-pipe') then
if item['connection_sprites'] then if item['connection_sprites'] then
for _, c in pairs({'single', 'straight_vertical', 'straight_horizontal', 'corner_right_up', 'corner_left_up', 'corner_right_down', 'corner_left_down', 't_up', 't_down', 't_right', 't_left', 'cross', 'ending_up', 'ending_down', 'ending_right', 'ending_left'}) do for _, c in pairs({'single', 'straight_vertical', 'straight_horizontal', 'corner_right_up', 'corner_left_up', 'corner_right_down', 'corner_left_down', 't_up', 't_down', 't_right', 't_left', 'cross', 'ending_up', 'ending_down', 'ending_right', 'ending_left'}) do
@@ -186,13 +209,6 @@ function main_entity(source, tier)
item.heat_buffer.max_transfer = tostring(tonumber(string.match(item.heat_buffer.max_transfer, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.heat_buffer.max_transfer, '%a+') item.heat_buffer.max_transfer = tostring(tonumber(string.match(item.heat_buffer.max_transfer, '[%d%.]+')) * (2 * (tier - source.min + 1))) .. string.match(item.heat_buffer.max_transfer, '%a+')
end end
--[[
nuclear-reactor
fusion-reactor
fusion-generator
heating-tower
]]
item.localised_name = (tier > 1 and {'phi-cl.combine', {'?', {'entity-name.' .. source.ref_name}, {'name.' .. source.ref_name}}, tostring(tier)}) or {'?', {'entity-name.' .. source.ref_name}, {'name.' .. source.ref_name}} item.localised_name = (tier > 1 and {'phi-cl.combine', {'?', {'entity-name.' .. source.ref_name}, {'name.' .. source.ref_name}}, tostring(tier)}) or {'?', {'entity-name.' .. source.ref_name}, {'name.' .. source.ref_name}}
item.localised_description = {'?', {'entity-description.' .. source.ref_name}, {'description.' .. source.ref_name}} item.localised_description = {'?', {'entity-description.' .. source.ref_name}, {'description.' .. source.ref_name}}
@@ -237,7 +253,6 @@ function main_recipe(source, tier)
}}) }})
end end
-- fast replace group
function main_replace_group(source) function main_replace_group(source)
if not data.raw[source.type][source.ref_name].fast_replaceable_group then if not data.raw[source.type][source.ref_name].fast_replaceable_group then
data.raw[source.type][source.ref_name].fast_replaceable_group = source.ref_name data.raw[source.type][source.ref_name].fast_replaceable_group = source.ref_name