Files
factorio-mod-PHI-CL/PHI-EN/data-updates.lua
2024-06-17 00:02:23 +09:00

43 lines
1.2 KiB
Lua

local items = require 'config'
-- fast replace group
local function EL(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.type
end
if source.max > 2 then
data.raw[source.type][source.name .. '-' .. 2].fast_replaceable_group = data.raw[source.type][source.ref_name].fast_replaceable_group
end
if source.max > source.min then
for j=source.min + 1, source.max do
data.raw[source.type][source.name .. '-' .. j].fast_replaceable_group = data.raw[source.type][source.name .. '-' .. (j - 1)].fast_replaceable_group
end
end
end
for k, v in pairs(items['setting']) do
for k2=1, #v.effect do
if items[v.effect[k2]] ~= nil then
if settings.startup[k].value < items[v.effect[k2]].min then
items[v.effect[k2]].enabled = false
end
items[v.effect[k2]][v.type] = settings.startup[k].value
end
end
end
for k, v in pairs(items) do
if k ~= 'setting' then
if v.enabled then
EL(v)
end
end
end
if items['nuclear-reactor'].enabled then
data.raw['fluid']['steam'].max_temperature = 5000
end