mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-06-27 13:56:20 +09:00
.
This commit is contained in:
+27
-12
@@ -130,6 +130,9 @@ function main_entity(source, tier)
|
||||
end
|
||||
|
||||
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
|
||||
if item[c] and item[c].layers then
|
||||
for _, l in pairs(item[c].layers) do
|
||||
@@ -142,15 +145,11 @@ function main_entity(source, tier)
|
||||
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
|
||||
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_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
|
||||
for _, l in pairs(item['picture'].layers) do
|
||||
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.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
|
||||
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))
|
||||
|
||||
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
|
||||
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
|
||||
@@ -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+')
|
||||
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_description = {'?', {'entity-description.' .. source.ref_name}, {'description.' .. source.ref_name}}
|
||||
|
||||
@@ -237,7 +253,6 @@ function main_recipe(source, tier)
|
||||
}})
|
||||
end
|
||||
|
||||
-- fast replace group
|
||||
function main_replace_group(source)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user