diff --git a/PHI-CL/config.lua b/PHI-CL/config.lua index 6d37c95..7280c48 100644 --- a/PHI-CL/config.lua +++ b/PHI-CL/config.lua @@ -32,94 +32,6 @@ local items = { [8] = {r=233, g=63, b=233} }, ['item'] = { - ['solar-panel'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'base', - type = 'solar-panel', - name = 'solar-panel', - ref_name = 'solar-panel', - tech = 'compound-energy', - min = 2, - max = settings.startup['PHI-MB-ENERGY-POWER-TIER'].value - }, - ['accumulator'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'base', - type = 'accumulator', - name = 'accumulator', - ref_name = 'accumulator', - tech = 'compound-energy', - min = 2, - max = settings.startup['PHI-MB-ENERGY-POWER-TIER'].value - }, - ['boiler'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'base', - type = 'boiler', - name = 'boiler', - ref_name = 'boiler', - tech = 'compound-energy', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - }, - ['steam-engine'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'base', - type = 'generator', - name = 'steam-engine', - ref_name = 'steam-engine', - tech = 'compound-energy', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - }, - ['nuclear-reactor'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'base', - type = 'reactor', - name = 'nuclear-reactor', - ref_name = 'nuclear-reactor', - tech = 'compound-energy', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - }, - ['heat-pipe'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'base', - type = 'heat-pipe', - name = 'heat-pipe', - ref_name = 'heat-pipe', - tech = 'compound-energy', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - }, - ['heat-exchanger'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'base', - type = 'boiler', - name = 'heat-exchanger', - ref_name = 'heat-exchanger', - tech = 'compound-energy', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - }, - ['steam-turbine'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'base', - type = 'generator', - name = 'steam-turbine', - ref_name = 'steam-turbine', - tech = 'compound-energy', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - }, ['assembling-machine'] = { enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-MACHINE'].value, stage = 1, @@ -691,42 +603,6 @@ local items = { } if mods and mods['space-age'] then - items['item']['fusion-reactor'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'space-age', - type = 'fusion-reactor', - name = 'fusion-reactor', - ref_name = 'fusion-reactor', - tech = 'compound-energy', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - } - - items['item']['fusion-generator'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'space-age', - type = 'fusion-generator', - name = 'fusion-generator', - ref_name = 'fusion-generator', - tech = 'compound-energy', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - } - - items['item']['heating-tower'] = { - enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-ENERGY'].value, - stage = 1, - mod = 'space-age', - type = 'reactor', - name = 'heating-tower', - ref_name = 'heating-tower', - tech = 'heating-tower', - min = 2, - max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) - } - items['item']['railgun-turret'] = { enabled = settings.startup['PHI-MB'].value and settings.startup['PHI-MB-MACHINE'].value, stage = 1, diff --git a/PHI-CL/data.lua b/PHI-CL/data.lua index 03651f1..a01fdfe 100644 --- a/PHI-CL/data.lua +++ b/PHI-CL/data.lua @@ -7,11 +7,9 @@ if settings.startup['PHI-MB'].value then require 'data.mbe' end - --[[ if settings.startup['PHI-MB-MACHINE'].value then require 'data.mbm' end - ]] if settings.startup['PHI-MB-EQUIPMENT'].value then require 'data.mbq' diff --git a/PHI-CL/data/mbe-config.lua b/PHI-CL/data/mbe-config.lua new file mode 100644 index 0000000..6fef09a --- /dev/null +++ b/PHI-CL/data/mbe-config.lua @@ -0,0 +1,94 @@ +return { + -- MBE A 7 BASE ENTITY,RECIPE,RESEARCH_EFFECT + ['solar-panel'] = { + enabled = true, + type = 'solar-panel', + name = 'solar-panel', + max = settings.startup['PHI-MB-ENERGY-POWER-TIER'].value + }, + -- MBE A 7 BASE ENTITY,RECIPE,RESEARCH_EFFECT + ['accumulator'] = { + enabled = true, + type = 'accumulator', + name = 'accumulator', + max = settings.startup['PHI-MB-ENERGY-POWER-TIER'].value + }, + -- MBE A 4 BASE ENTITY,RECIPE,RESEARCH_EFFECT + ['boiler'] = { + enabled = true, + type = 'boiler', + name = 'boiler', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 4 BASE ENTITY,RECIPE,RESEARCH_EFFECT + ['steam-engine'] = { + enabled = true, + type = 'generator', + name = 'steam-engine', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 4 BASE ENTITY,RECIPE,RESEARCH_EFFECT + ['nuclear-reactor'] = { + enabled = true, + type = 'reactor', + name = 'nuclear-reactor', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 4 BASE ENTITY,RECIPE,RESEARCH_EFFECT + ['heat-pipe'] = { + enabled = true, + type = 'heat-pipe', + name = 'heat-pipe', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 4 BASE ENTITY,RECIPE,RESEARCH_EFFECT + ['heat-exchanger'] = { + enabled = true, + type = 'boiler', + name = 'heat-exchanger', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 4 BASE ENTITY,RECIPE,RESEARCH_EFFECT + ['steam-turbine'] = { + enabled = true, + type = 'generator', + name = 'steam-turbine', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 4 SPACE_AGE ENTITY,RECIPE,RESEARCH_EFFECT + ['fusion-reactor'] = { + enabled = mods['space-age'], + mod = 'space-age', + type = 'fusion-reactor', + name = 'fusion-reactor', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 4 SPACE_AGE ENTITY,RECIPE,RESEARCH_EFFECT + ['fusion-generator'] = { + enabled = mods['space-age'], + mod = 'space-age', + type = 'fusion-generator', + name = 'fusion-generator', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 4 SPACE_AGE ENTITY,RECIPE,RESEARCH_EFFECT + ['heating-tower'] = { + enabled = mods['space-age'], + mod = 'space-age', + type = 'reactor', + name = 'heating-tower', + tech = 'heating-tower', + max = math.min(settings.startup['PHI-MB-ENERGY-POWER-TIER'].value, 5) + }, + -- MBE A 5 SPACE_EXPLORATION ENTITY,RECIPE,RESEARCH_EFFECT + ['se-space-solar-panel'] = { + enabled = mods['space-exploration'], + stage = 2, + mod = 'space-exploration', + type = 'solar-panel', + name = 'se-space-solar-panel', + tech = 'compound-energy', + min = 4, + max = settings.startup['PHI-MB-ENERGY-POWER-TIER'].value + } +} diff --git a/PHI-CL/data/mbe.lua b/PHI-CL/data/mbe.lua index 3b1d5de..075886a 100644 --- a/PHI-CL/data/mbe.lua +++ b/PHI-CL/data/mbe.lua @@ -1,9 +1,11 @@ -local items = require 'config' +local param = require 'config' +local main = require 'main' +local items = require 'mbe-config' --- MBE C 1 FLUID +-- MBE C 1 BASE FLUID data.raw['fluid']['steam'].max_temperature = ((settings.startup['PHI-MB-ENERGY-POWER-TIER'].value > 1) and 5000) or data.raw['fluid']['steam'].max_temperature --- MBE A 7 RESEARCH +-- MBE A 7 BASE RESEARCH for i = 1, 7 do data:extend({{ type = 'technology', @@ -13,9 +15,28 @@ for i = 1, 7 do effects = {}, upgrade = true, unit = {count = math.floor(125 * (i ^ 2)), ingredients = {{'automation-science-pack', 1}, {'logistic-science-pack', 1}}, time = 30}, - icons = {{icon = '__base__/graphics/technology/solar-energy.png', icon_size = 256, tint = items['tint'][i]}}, + icons = {{icon = '__base__/graphics/technology/solar-energy.png', icon_size = 256, tint = param['tint'][i]}}, order = 'a-h-' .. i, localised_name = {'phi-cl.combine', {'technology-name.compound-energy'}, tostring(i)}, localised_description = {'technology-description.compound-energy'} }}) end + +for _, v in pairs(items) do + if v.enabled and (v.max >= v.min) then + v.mod = v.mod or 'base' + v.category = v.category or 'item' + v.ref_name = v.ref_name or v.name + v.tech = v.tech or 'compound-energy' + v.min = v.min or 2 + + for j=v.min, v.max, 1 do + main.EEE(v, j) + main.EI(v, j) + main.ER(v, j) + main.ET(v, j) + end + + main.EL(v) + end +end diff --git a/PHI-CL/data/mbm.lua b/PHI-CL/data/mbm.lua new file mode 100644 index 0000000..e69de29