From 0119818911ae42ae30eea6e2512d10f785b51c05 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Thu, 24 Oct 2024 23:22:39 +0900 Subject: [PATCH] . --- PHI-CL/config.lua | 157 +++++++++++++++++++++++++++++++++++++++++++++- PHI-CL/data.lua | 9 ++- PHI-CL/main.lua | 74 ++++++---------------- 3 files changed, 182 insertions(+), 58 deletions(-) diff --git a/PHI-CL/config.lua b/PHI-CL/config.lua index 608cb62..871a675 100644 --- a/PHI-CL/config.lua +++ b/PHI-CL/config.lua @@ -356,7 +356,162 @@ local items = { } } -if mods then +--[[ +if mods['space-age'] then + items['item']['fusion-reactor'] = { + enabled = settings.startup['PHI-EN'].value, + stage = 2, + type = 'fusion-reactor', + name = 'fusion-reactor', + ref_name = 'fusion-reactor', + tech = 'fusion-reactor', + min = 2, + max = settings.startup['PHI-EN-NUCLEAR-TIER'].value + } + + items['item']['fusion-generator'] = { + enabled = settings.startup['PHI-EN'].value, + stage = 2, + type = 'fusion-generator', + name = 'fusion-generator', + ref_name = 'fusion-generator', + tech = 'fusion-reactor', + min = 2, + max = settings.startup['PHI-EN-NUCLEAR-TIER'].value + } + + items['item']['heating-tower'] = { + enabled = settings.startup['PHI-EN'].value, + stage = 2, + type = 'reactor', + name = 'heating-tower', + ref_name = 'heating-tower', + tech = 'heating-tower', + min = 2, + max = settings.startup['PHI-EN-NUCLEAR-TIER'].value + } + + items['item']['foundry'] = { + enabled = settings.startup['PHI-MB'].value, + stage = 2, + type = 'assembling-machine', + name = 'foundry', + ref_name = 'foundry', + tech = 'foundry', + min = 2, + max = settings.startup['PHI-MB-FURNACE-TIER'].value + } + + items['item']['big-mining-drill'] = { + enabled = settings.startup['PHI-MB'].value, + stage = 2, + type = 'mining-drill', + name = 'big-mining-drill', + ref_name = 'big-mining-drill', + tech = 'big-mining-drill', + min = 2, + max = settings.startup['PHI-MB-MINING-TIER'].value + } + + items['item']['biochamber'] = { + enabled = settings.startup['PHI-MB'].value, + stage = 2, + type = 'assembling-machine', + name = 'biochamber', + ref_name = 'biochamber', + tech = 'biochamber', + min = 2, + max = settings.startup['PHI-MB-ASSEMBLING-TIER'].value + } + + items['item']['crusher'] = { + enabled = settings.startup['PHI-MB'].value, + stage = 2, + type = 'furnace', + name = 'crusher', + ref_name = 'crusher', + tech = 'space-platform', + min = 2, + max = settings.startup['PHI-MB-ASSEMBLING-TIER'].value + } + + items['item']['railgun-turret'] = { + enabled = settings.startup['PHI-WE'].value, + stage = 2, + type = 'ammo-turret', + name = 'railgun-turret', + ref_name = 'railgun-turret', + tech = 'railgun', + min = 2, + max = settings.startup['PHI-WE-GUN-TIER'].value + } + + items['item']['rocket-turret'] = { + enabled = settings.startup['PHI-WE'].value, + stage = 2, + type = 'ammo-turret', + name = 'rocket-turret', + ref_name = 'rocket-turret', + tech = 'rocket-turret', + min = 2, + max = settings.startup['PHI-WE-GUN-TIER'].value + } + + items['item']['tesla-turret'] = { + enabled = settings.startup['PHI-WE'].value, + stage = 2, + type = 'electric-turret', + name = 'tesla-turret', + ref_name = 'tesla-turret', + tech = 'tesla-weapons', + min = 2, + max = settings.startup['PHI-WE-LASER-TIER'].value + } + + items['item']['biolab'] = { + enabled = settings.startup['PHI-MB'].value, + stage = 2, + type = 'lab', + name = 'biolab', + ref_name = 'biolab', + tech = 'biolab', + min = 2, + max = settings.startup['PHI-MB-LAB-TIER'].value + } + + items['item']['agricultural-tower'] = { + enabled = settings.startup['PHI-MB'].value, + stage = 2, + type = 'agricultural-tower', + name = 'agricultural-tower', + ref_name = 'agricultural-tower', + tech = 'agriculture', + min = 2, + max = settings.startup['PHI-MB-ASSEMBLING-TIER'].value + } + + items['item']['cryogenic-plant'] = { + enabled = settings.startup['PHI-MB'].value, + stage = 2, + type = 'assembling-machine', + name = 'cryogenic-plant', + ref_name = 'cryogenic-plant', + tech = 'cryogenic-plant', + min = 2, + max = settings.startup['PHI-MB-ASSEMBLING-TIER'].value + } + + items['item']['electromagnetic-plant'] = { + enabled = settings.startup['PHI-MB'].value, + stage = 2, + type = 'assembling-machine', + name = 'electromagnetic-plant', + ref_name = 'electromagnetic-plant', + tech = 'electromagnetic-plant', + min = 2, + max = settings.startup['PHI-MB-ASSEMBLING-TIER'].value + } end +]] return items diff --git a/PHI-CL/data.lua b/PHI-CL/data.lua index 3677852..358c0ce 100644 --- a/PHI-CL/data.lua +++ b/PHI-CL/data.lua @@ -240,6 +240,11 @@ if settings.startup['PHI-CT'].value and settings.startup['PHI-CT-LOADER'].value table.insert(data.raw.technology['logistics'].effects, {type='unlock-recipe', recipe='loader'}) table.insert(data.raw.technology['logistics-2'].effects, {type='unlock-recipe', recipe='fast-loader'}) table.insert(data.raw.technology['logistics-3'].effects, {type='unlock-recipe', recipe='express-loader'}) + + if mods['space-age'] then + data.raw.recipe['turbo-loader'].hidden = false + table.insert(data.raw.technology['turbo-transport-belt'].effects, {type='unlock-recipe', recipe='turbo-loader'}) + end end if settings.startup['PHI-CT'].value and settings.startup['PHI-CT-ENERGY'].value then @@ -390,12 +395,12 @@ if settings.startup['PHI-MI'].value and settings.startup['PHI-MI-CHEST'].value t for _, t in pairs({'construction', 'logistic'}) do for _, r in pairs({'passive-provider', 'storage'}) do - table.insert(data.raw.technology[t .. '-robotics'].effects, {type='unlock-recipe', recipe='basic-logistic-chest-' .. r}) + table.insert(data.raw.technology[t .. '-robotics'].effects, {type='unlock-recipe', recipe='basic-' .. r .. '-chest'}) end end for _, r in pairs({'active-provider', 'buffer', 'requester'}) do - table.insert(data.raw.technology['logistic-system'].effects, {type='unlock-recipe', recipe='basic-logistic-chest-' .. r}) + table.insert(data.raw.technology['logistic-system'].effects, {type='unlock-recipe', recipe='basic-' .. r .. '-chest'}) end end if settings.startup['PHI-EN'].value and settings.startup['PHI-EN-NUCLEAR-TIER'].value > 1 then diff --git a/PHI-CL/main.lua b/PHI-CL/main.lua index 352cbfa..b3caa8c 100644 --- a/PHI-CL/main.lua +++ b/PHI-CL/main.lua @@ -5,41 +5,15 @@ local main = {} local function tint_handle(item, tier, tl) for _, ve in pairs(tl) do if item[ve] then - for _, tc in pairs({'layers', 'sheets'}) do - if item[ve][tc] and item[ve][tc][1] then - item[ve][tc][1].tint = items['tint'][tier] - - if item[ve][tc][1].hr_version then - item[ve][tc][1].hr_version.tint = items['tint'][tier] - end - end - - for _, v in pairs(item[ve]) do - if type(v) == 'table' then - if v[tc] then - if v[tc][1] then - v[tc][1].tint = items['tint'][tier] - - if v[tc][1].hr_version then - v[tc][1].hr_version.tint = items['tint'][tier] - end - end - end - - for i=1, #v, 1 do - if v[i] and type(v[i]) == 'table' then - if v[i][tc] and v[i][tc][1] then - v[i][tc][1].tint = items['tint'][tier] - - if v[i][tc][1].hr_version then - v[i][tc][1].hr_version.tint = items['tint'][tier] - end - end - end - end + for _, tc in pairs({'layers', 'sheets', 'structure'}) do + if item[ve][tc] and type(item[ve][tc]) == 'table' then + for i=1, #item[ve][tc], 1 do + item[ve][tc][i].tint = items['tint'][tier] end end end + + item[ve].tint = items['tint'][tier] end end end @@ -198,7 +172,7 @@ function main.EEE(source, tier) end end - tint_handle(item, tier, {'picture', 'pictures', 'structure', 'frames', 'working_visualisations', 'animation', 'horizontal_animation', 'vertical_animation', 'structure', 'integration_patch'}) + tint_handle(item, tier, {'picture', 'pictures', 'frames', 'working_visualisations', 'animation', 'horizontal_animation', 'vertical_animation', 'structure', 'integration_patch'}) if item.idle_animation and item.idle_animation.layers then local i = 1 @@ -235,7 +209,7 @@ function main.EEE(source, tier) item.localised_name = {'name.' .. source.ref_name} end - item.localised_description = {'description.' .. source.ref_name} + item.localised_description = item.localised_description data:extend({item}) end @@ -245,6 +219,7 @@ function main.EEQ(source, tier) local item = table.deepcopy(data.raw[source.type][source.ref_name]) item.name = source.name .. '-mk' .. tier .. '-equipment' + item.take_result = item.name if item.power then item.power = tostring(tonumber(string.match(item.power, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.power, '%a+') @@ -322,7 +297,7 @@ function main.EEQ(source, tier) end item.localised_name = {'phi-cl.combine-gen', {'name.' .. source.ref_name}, tostring(tier)} - item.localised_description = {'description.' .. source.ref_name} + item.localised_description = item.localised_description data:extend({item}) end @@ -374,7 +349,7 @@ function main.EI(source, tier) item.localised_name = {'name.' .. source.ref_name} end - item.localised_description = {'description.' .. source.ref_name} + item.localised_description = item.localised_description data:extend({item}) end @@ -384,8 +359,6 @@ function main.ER(source, tier) local new_name = source.name local ingredient_name = source.name local result_name = source.name - local localised_name - local localised_description = {'description.' .. source.ref_name} local icons = { { icon = data.raw.item[source.ref_name].icon, @@ -404,8 +377,6 @@ function main.ER(source, tier) new_name = new_name .. '-mk' .. tier .. '-equipment' result_name = result_name .. '-mk' .. tier .. '-equipment' - localised_name = {'phi-cl.combine-gen', {'name.' .. source.ref_name}, tostring(tier)} - else if tier > 2 then ingredient_name = ingredient_name .. '-' .. (tier - 1) @@ -413,13 +384,6 @@ function main.ER(source, tier) new_name = new_name .. '-' .. tier result_name = result_name .. '-' .. tier - - if tier > 1 then - localised_name = {'phi-cl.combine', {'name.' .. source.ref_name}, tostring(tier)} - - else - localised_name = {'name.' .. source.ref_name} - end end if (source.tech == 'compound-energy') then @@ -433,8 +397,8 @@ function main.ER(source, tier) ingredients = {{type='item', name=ingredient_name, amount=4}}, results = {{type='item', name=result_name, amount=1}}, main_product = result_name, - localised_name = localised_name, - localised_description = localised_description + localised_name = data.raw[source.type][new_name].localised_name, + localised_description = data.raw[source.type][new_name].localised_description }}) else @@ -448,8 +412,8 @@ function main.ER(source, tier) ingredients = {{type='item', name=ingredient_name, amount=1}, {type='item', name=source.name, amount=1}}, results = {{type='item', name=result_name, amount=1}}, main_product = result_name, - localised_name = localised_name, - localised_description = localised_description + localised_name = data.raw[source.type][new_name].localised_name, + localised_description = data.raw[source.type][new_name].localised_description }}) else @@ -462,8 +426,8 @@ function main.ER(source, tier) ingredients = {{type='item', name=ingredient_name, amount=2}}, results = {{type='item', name=result_name, amount=1}}, main_product = result_name, - localised_name = localised_name, - localised_description = localised_description + localised_name = data.raw[source.type][new_name].localised_name, + localised_description = data.raw[source.type][new_name].localised_description }}) end end @@ -478,8 +442,8 @@ function main.ER(source, tier) ingredients = {{type='item', name=ingredient_name, amount=2}}, results = {{type='item', name=result_name, amount=1}}, main_product = result_name, - localised_name = localised_name, - localised_description = localised_description + localised_name = data.raw[source.type][new_name].localised_name, + localised_description = data.raw[source.type][new_name].localised_description }}) end end