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,4 +1,30 @@
|
|||||||
local items = {
|
local items = {
|
||||||
|
['setting'] = {
|
||||||
|
['PHI-EN-SOLAR'] = {
|
||||||
|
type = 'enabled',
|
||||||
|
effect = {'solar-panel', 'accumulator'}
|
||||||
|
},
|
||||||
|
['PHI-EN-STEAM'] = {
|
||||||
|
type = 'enabled',
|
||||||
|
effect = {'boiler', 'steam-engine'}
|
||||||
|
},
|
||||||
|
['PHI-EN-NUCLEAR'] = {
|
||||||
|
type = 'enabled',
|
||||||
|
effect = {'nuclear-reactor', 'heat-pipe', 'heat-exchanger', 'steam-turbine'}
|
||||||
|
},
|
||||||
|
['PHI-EN-SOLAR-TIER'] = {
|
||||||
|
type = 'max',
|
||||||
|
effect = {'solar-panel', 'accumulator'}
|
||||||
|
},
|
||||||
|
['PHI-EN-STEAM-TIER'] = {
|
||||||
|
type = 'max',
|
||||||
|
effect = {'boiler', 'steam-engine'}
|
||||||
|
},
|
||||||
|
['PHI-EN-NUCLEAR-TIER'] = {
|
||||||
|
type = 'max',
|
||||||
|
effect = {'nuclear-reactor', 'heat-pipe', 'heat-exchanger', 'steam-turbine'}
|
||||||
|
}
|
||||||
|
},
|
||||||
['solar-panel'] = {
|
['solar-panel'] = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
type = 'solar-panel',
|
type = 'solar-panel',
|
||||||
|
|||||||
@@ -1,63 +1,25 @@
|
|||||||
-- accumulator
|
local items = require 'config'
|
||||||
data.raw['accumulator']['accumulator'].fast_replaceable_group = 'accumulator'
|
|
||||||
data.raw['accumulator']['accumulator-2'].fast_replaceable_group = data.raw['accumulator']['accumulator'].fast_replaceable_group
|
|
||||||
data.raw['accumulator']['accumulator-3'].fast_replaceable_group = data.raw['accumulator']['accumulator-2'].fast_replaceable_group
|
|
||||||
data.raw['accumulator']['accumulator-4'].fast_replaceable_group = data.raw['accumulator']['accumulator-3'].fast_replaceable_group
|
|
||||||
data.raw['accumulator']['accumulator-5'].fast_replaceable_group = data.raw['accumulator']['accumulator-4'].fast_replaceable_group
|
|
||||||
data.raw['accumulator']['accumulator-6'].fast_replaceable_group = data.raw['accumulator']['accumulator-5'].fast_replaceable_group
|
|
||||||
data.raw['accumulator']['accumulator-7'].fast_replaceable_group = data.raw['accumulator']['accumulator-6'].fast_replaceable_group
|
|
||||||
data.raw['accumulator']['accumulator-8'].fast_replaceable_group = data.raw['accumulator']['accumulator-7'].fast_replaceable_group
|
|
||||||
|
|
||||||
-- solar-panel
|
for k, v in pairs(items['setting']) do
|
||||||
data.raw['solar-panel']['solar-panel'].fast_replaceable_group = 'solar-panel'
|
for k2=1, #v.effect do
|
||||||
data.raw['solar-panel']['solar-panel-2'].fast_replaceable_group = data.raw['solar-panel']['solar-panel'].fast_replaceable_group
|
items[v.effect[k2]][v.type] = settings.startup[k].value
|
||||||
data.raw['solar-panel']['solar-panel-3'].fast_replaceable_group = data.raw['solar-panel']['solar-panel-2'].fast_replaceable_group
|
end
|
||||||
data.raw['solar-panel']['solar-panel-4'].fast_replaceable_group = data.raw['solar-panel']['solar-panel-3'].fast_replaceable_group
|
end
|
||||||
data.raw['solar-panel']['solar-panel-5'].fast_replaceable_group = data.raw['solar-panel']['solar-panel-4'].fast_replaceable_group
|
|
||||||
data.raw['solar-panel']['solar-panel-6'].fast_replaceable_group = data.raw['solar-panel']['solar-panel-5'].fast_replaceable_group
|
|
||||||
data.raw['solar-panel']['solar-panel-7'].fast_replaceable_group = data.raw['solar-panel']['solar-panel-6'].fast_replaceable_group
|
|
||||||
data.raw['solar-panel']['solar-panel-8'].fast_replaceable_group = data.raw['solar-panel']['solar-panel-7'].fast_replaceable_group
|
|
||||||
|
|
||||||
-- boiler
|
for k, v in pairs(items) do
|
||||||
data.raw['boiler']['boiler'].fast_replaceable_group = 'boiler'
|
if k ~= 'setting' then
|
||||||
data.raw['boiler']['boiler-2'].fast_replaceable_group = data.raw['boiler']['boiler'].fast_replaceable_group
|
if v.enabled then
|
||||||
data.raw['boiler']['boiler-3'].fast_replaceable_group = data.raw['boiler']['boiler-2'].fast_replaceable_group
|
data.raw[v.type][v.ref_name].fast_replaceable_group = v.type
|
||||||
data.raw['boiler']['boiler-4'].fast_replaceable_group = data.raw['boiler']['boiler-3'].fast_replaceable_group
|
|
||||||
data.raw['boiler']['boiler-5'].fast_replaceable_group = data.raw['boiler']['boiler-4'].fast_replaceable_group
|
|
||||||
|
|
||||||
-- steam-engine
|
if v.max > 2 then
|
||||||
data.raw['generator']['steam-engine'].fast_replaceable_group = 'steam-engine'
|
data.raw[v.type][v.name .. '-' .. 2].fast_replaceable_group = data.raw[v.type][v.ref_name].fast_replaceable_group
|
||||||
data.raw['generator']['steam-engine-2'].fast_replaceable_group = data.raw['generator']['steam-engine'].fast_replaceable_group
|
end
|
||||||
data.raw['generator']['steam-engine-3'].fast_replaceable_group = data.raw['generator']['steam-engine-2'].fast_replaceable_group
|
|
||||||
data.raw['generator']['steam-engine-4'].fast_replaceable_group = data.raw['generator']['steam-engine-3'].fast_replaceable_group
|
|
||||||
data.raw['generator']['steam-engine-5'].fast_replaceable_group = data.raw['generator']['steam-engine-4'].fast_replaceable_group
|
|
||||||
|
|
||||||
-- nuclear-reactor
|
if v.max > v.min then
|
||||||
data.raw['reactor']['nuclear-reactor'].fast_replaceable_group = 'reactor'
|
for j=v.min + 1, v.max do
|
||||||
data.raw['reactor']['nuclear-reactor-2'].fast_replaceable_group = data.raw['reactor']['nuclear-reactor'].fast_replaceable_group
|
data.raw[v.type][v.name .. '-' .. j].fast_replaceable_group = data.raw[v.type][v.name .. '-' .. (j - 1)].fast_replaceable_group
|
||||||
data.raw['reactor']['nuclear-reactor-3'].fast_replaceable_group = data.raw['reactor']['nuclear-reactor-2'].fast_replaceable_group
|
end
|
||||||
data.raw['reactor']['nuclear-reactor-4'].fast_replaceable_group = data.raw['reactor']['nuclear-reactor-3'].fast_replaceable_group
|
end
|
||||||
data.raw['reactor']['nuclear-reactor-5'].fast_replaceable_group = data.raw['reactor']['nuclear-reactor-4'].fast_replaceable_group
|
end
|
||||||
|
end
|
||||||
-- heat-pipe
|
end
|
||||||
data.raw['heat-pipe']['heat-pipe'].fast_replaceable_group = 'heat-pipe'
|
|
||||||
data.raw['heat-pipe']['heat-pipe-2'].fast_replaceable_group = data.raw['heat-pipe']['heat-pipe'].fast_replaceable_group
|
|
||||||
data.raw['heat-pipe']['heat-pipe-3'].fast_replaceable_group = data.raw['heat-pipe']['heat-pipe-2'].fast_replaceable_group
|
|
||||||
data.raw['heat-pipe']['heat-pipe-4'].fast_replaceable_group = data.raw['heat-pipe']['heat-pipe-3'].fast_replaceable_group
|
|
||||||
data.raw['heat-pipe']['heat-pipe-5'].fast_replaceable_group = data.raw['heat-pipe']['heat-pipe-4'].fast_replaceable_group
|
|
||||||
|
|
||||||
-- heat-exchanger
|
|
||||||
data.raw['boiler']['heat-exchanger'].fast_replaceable_group = 'heat-exchanger'
|
|
||||||
data.raw['boiler']['heat-exchanger-2'].fast_replaceable_group = data.raw['boiler']['heat-exchanger'].fast_replaceable_group
|
|
||||||
data.raw['boiler']['heat-exchanger-3'].fast_replaceable_group = data.raw['boiler']['heat-exchanger-2'].fast_replaceable_group
|
|
||||||
data.raw['boiler']['heat-exchanger-4'].fast_replaceable_group = data.raw['boiler']['heat-exchanger-3'].fast_replaceable_group
|
|
||||||
data.raw['boiler']['heat-exchanger-5'].fast_replaceable_group = data.raw['boiler']['heat-exchanger-4'].fast_replaceable_group
|
|
||||||
|
|
||||||
-- steam-turbine
|
|
||||||
data.raw['generator']['steam-turbine'].fast_replaceable_group = 'steam-engine'
|
|
||||||
data.raw['generator']['steam-turbine-2'].fast_replaceable_group = data.raw['generator']['steam-turbine'].fast_replaceable_group
|
|
||||||
data.raw['generator']['steam-turbine-3'].fast_replaceable_group = data.raw['generator']['steam-turbine-2'].fast_replaceable_group
|
|
||||||
data.raw['generator']['steam-turbine-4'].fast_replaceable_group = data.raw['generator']['steam-turbine-3'].fast_replaceable_group
|
|
||||||
data.raw['generator']['steam-turbine-5'].fast_replaceable_group = data.raw['generator']['steam-turbine-4'].fast_replaceable_group
|
|
||||||
|
|
||||||
data.raw['fluid']['steam'].max_temperature = 5000
|
|
||||||
|
|||||||
@@ -165,13 +165,22 @@ local function ET(source, tier)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, v in pairs(items) do
|
|
||||||
if v.enabled then
|
for k, v in pairs(items['setting']) do
|
||||||
for j=v.min, v.max, 1 do
|
for k2=1, #v.effect do
|
||||||
EE(v, j)
|
items[v.effect[k2]][v.type] = settings.startup[k].value
|
||||||
EI(v, j)
|
end
|
||||||
ER(v, j)
|
end
|
||||||
ET(v, j)
|
|
||||||
|
for k, v in pairs(items) do
|
||||||
|
if k ~= 'setting' then
|
||||||
|
if v.enabled then
|
||||||
|
for j=v.min, v.max, 1 do
|
||||||
|
EE(v, j)
|
||||||
|
EI(v, j)
|
||||||
|
ER(v, j)
|
||||||
|
ET(v, j)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
40
PHI-EN/settings.lua
Normal file
40
PHI-EN/settings.lua
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
data:extend({{
|
||||||
|
type = 'bool-setting',
|
||||||
|
name = 'PHI-EN-SOLAR',
|
||||||
|
setting_type = 'startup',
|
||||||
|
default_value = true,
|
||||||
|
order = 'A1'
|
||||||
|
}, {
|
||||||
|
type = 'bool-setting',
|
||||||
|
name = 'PHI-EN-STEAM',
|
||||||
|
setting_type = 'startup',
|
||||||
|
default_value = true,
|
||||||
|
order = 'A2'
|
||||||
|
}, {
|
||||||
|
type = 'bool-setting',
|
||||||
|
name = 'PHI-EN-NUCLEAR',
|
||||||
|
setting_type = 'startup',
|
||||||
|
default_value = true,
|
||||||
|
order = 'A3'
|
||||||
|
}, {
|
||||||
|
type = 'int-setting',
|
||||||
|
name = 'PHI-EN-SOLAR-TIER',
|
||||||
|
setting_type = 'startup',
|
||||||
|
default_value = 8,
|
||||||
|
allowed_values = {2, 3, 4, 5, 6, 7, 8},
|
||||||
|
order = 'B1'
|
||||||
|
}, {
|
||||||
|
type = 'int-setting',
|
||||||
|
name = 'PHI-EN-STEAM-TIER',
|
||||||
|
setting_type = 'startup',
|
||||||
|
default_value = 5,
|
||||||
|
allowed_values = {2, 3, 4, 5},
|
||||||
|
order = 'B2'
|
||||||
|
}, {
|
||||||
|
type = 'int-setting',
|
||||||
|
name = 'PHI-EN-NUCLEAR-TIER',
|
||||||
|
setting_type = 'startup',
|
||||||
|
default_value = 5,
|
||||||
|
allowed_values = {2, 3, 4, 5},
|
||||||
|
order = 'B3'
|
||||||
|
}})
|
||||||
Reference in New Issue
Block a user