From 2425c34cb483239bcf0d621b620921e6603400fb Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 17 Jun 2024 13:51:58 +0900 Subject: [PATCH] . --- PHI-CL/main.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/PHI-CL/main.lua b/PHI-CL/main.lua index d6d9c18..b8bee22 100644 --- a/PHI-CL/main.lua +++ b/PHI-CL/main.lua @@ -323,19 +323,23 @@ function main.ET(source, tier) end elseif data.raw.technology[source.tech] then + local recipe_name = source.name + if source.category == 'equipment' then - table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-mk' .. tier .. '-equipment'}) + recipe_name = recipe_name .. '-mk' .. tier .. '-equipment' else - table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) + recipe_name = recipe_name .. tier + end - if source.type == 'ammo-turret' or source.type == 'fluid-turret' then - for i=1, #items['research_modifier'][source.type], 1 do - for j=1, #data.raw.technology[items['research_modifier'][source.type][i]].effects, 1 do - if (data.raw.technology[items['research_modifier'][source.type][i]].effects[j].type == 'turret-attack') then - if (data.raw.technology[items['research_modifier'][source.type][i]].effects[j].turret_id == source.ref_name) then - table.insert(data.raw.technology[items['research_modifier'][source.type][i]].effects, {type='turret-attack', turret_id=source.name .. '-' .. tier, modifier=data.raw.technology[items['research_modifier'][source.type][i]].effects[j].modifier}) - end + table.insert(data.raw.technology[source.tech].effects, {type='unlock-recipe', recipe=source.name .. '-' .. tier}) + + if source.type == 'ammo-turret' or source.type == 'fluid-turret' then + for i=1, #items['research_modifier'][source.type], 1 do + for j=1, #data.raw.technology[items['research_modifier'][source.type][i]].effects, 1 do + if (data.raw.technology[items['research_modifier'][source.type][i]].effects[j].type == 'turret-attack') then + if (data.raw.technology[items['research_modifier'][source.type][i]].effects[j].turret_id == source.ref_name) then + table.insert(data.raw.technology[items['research_modifier'][source.type][i]].effects, {type='turret-attack', turret_id=source.name .. '-' .. tier, modifier=data.raw.technology[items['research_modifier'][source.type][i]].effects[j].modifier}) end end end