mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-27 11:05:22 +09:00
.
This commit is contained in:
@@ -1,5 +1,22 @@
|
|||||||
local items = require 'config'
|
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 k, v in pairs(items['setting']) do
|
||||||
for k2=1, #v.effect do
|
for k2=1, #v.effect do
|
||||||
if items[v.effect[k2]] ~= nil then
|
if items[v.effect[k2]] ~= nil then
|
||||||
@@ -15,17 +32,7 @@ end
|
|||||||
for k, v in pairs(items) do
|
for k, v in pairs(items) do
|
||||||
if k ~= 'setting' then
|
if k ~= 'setting' then
|
||||||
if v.enabled then
|
if v.enabled then
|
||||||
data.raw[v.type][v.ref_name].fast_replaceable_group = v.type
|
EL(v)
|
||||||
|
|
||||||
if v.max > 2 then
|
|
||||||
data.raw[v.type][v.name .. '-' .. 2].fast_replaceable_group = data.raw[v.type][v.ref_name].fast_replaceable_group
|
|
||||||
end
|
|
||||||
|
|
||||||
if v.max > v.min then
|
|
||||||
for j=v.min + 1, v.max do
|
|
||||||
data.raw[v.type][v.name .. '-' .. j].fast_replaceable_group = data.raw[v.type][v.name .. '-' .. (j - 1)].fast_replaceable_group
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ if mods ~= nil then
|
|||||||
}
|
}
|
||||||
|
|
||||||
items['se-space-radiator'] = {
|
items['se-space-radiator'] = {
|
||||||
enabled = false,
|
enabled = true,
|
||||||
stage = 2,
|
stage = 2,
|
||||||
type = 'assembling-machine',
|
type = 'assembling-machine',
|
||||||
name = 'se-space-radiator',
|
name = 'se-space-radiator',
|
||||||
|
|||||||
@@ -95,15 +95,19 @@ local function ET(source, tier)
|
|||||||
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier})
|
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier})
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, v in pairs(items) do
|
-- fast replace group
|
||||||
if v.enabled then
|
local function EL(source)
|
||||||
if v.stage == 2 then
|
if not data.raw[source.type][source.ref_name].fast_replaceable_group then
|
||||||
for j=v.min, v.max, 1 do
|
data.raw[source.type][source.ref_name].fast_replaceable_group = source.type
|
||||||
EE(v, j)
|
end
|
||||||
EI(v, j)
|
|
||||||
ER(v, j)
|
if source.max > 2 then
|
||||||
ET(v, j)
|
data.raw[source.type][source.name .. '-' .. 2].fast_replaceable_group = data.raw[source.type][source.ref_name].fast_replaceable_group
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
@@ -111,16 +115,15 @@ end
|
|||||||
for k, v in pairs(items) do
|
for k, v in pairs(items) do
|
||||||
if k ~= 'setting' then
|
if k ~= 'setting' then
|
||||||
if v.enabled then
|
if v.enabled then
|
||||||
data.raw[v.type][v.ref_name].fast_replaceable_group = v.type
|
if v.stage == 2 then
|
||||||
|
for j=v.min, v.max, 1 do
|
||||||
if v.max > 2 then
|
EE(v, j)
|
||||||
data.raw[v.type][v.name .. '-' .. 2].fast_replaceable_group = data.raw[v.type][v.ref_name].fast_replaceable_group
|
EI(v, j)
|
||||||
end
|
ER(v, j)
|
||||||
|
ET(v, j)
|
||||||
if v.max > v.min then
|
|
||||||
for j=v.min + 1, v.max do
|
|
||||||
data.raw[v.type][v.name .. '-' .. j].fast_replaceable_group = data.raw[v.type][v.name .. '-' .. (j - 1)].fast_replaceable_group
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
EL(v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -83,6 +83,23 @@ local function ET(source, tier)
|
|||||||
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier})
|
table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 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 k, v in pairs(items['setting']) do
|
||||||
for k2=1, #v.effect do
|
for k2=1, #v.effect do
|
||||||
if items[v.effect[k2]] ~= nil then
|
if items[v.effect[k2]] ~= nil then
|
||||||
@@ -105,6 +122,8 @@ for k, v in pairs(items) do
|
|||||||
ER(v, j)
|
ER(v, j)
|
||||||
ET(v, j)
|
ET(v, j)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
EL(v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user