Merge pull request #52 from stuartwill/ki-plus-tech-fix

KIX techs fix
This commit is contained in:
PreLeyZero 2024-02-20 21:24:06 +01:00 committed by GitHub
commit 4783ab1f44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 6 deletions

View file

@ -212,7 +212,7 @@ data:extend({
}, },
energy_usage = '40MW', energy_usage = '40MW',
module_specification = { module_specification = {
module_slots = 20, module_slots = 18,
module_info_icon_shift = {0, 0.5}, module_info_icon_shift = {0, 0.5},
module_info_multi_row_initial_height_modifier = -0.3, module_info_multi_row_initial_height_modifier = -0.3,
}, },

View file

@ -633,9 +633,17 @@ function el_ki_single_beacon_update(id)
local coreunit = global.ki.channel[channel].core local coreunit = global.ki.channel[channel].core
if global.ki.core[coreunit] then if global.ki.core[coreunit] then
if global.ki.core[coreunit].active then if global.ki.core[coreunit].active then
for i,v in pairs(global.ki.core[coreunit].totalmodules) do local moduleset = global.ki.core[coreunit].totalmodules
if beacon_inv.can_insert({name=global.ki.core[coreunit].totalmodules[i], count=1}) then if beacon_entity.name == 'fu_ki_beacon_entity' then
beacon_inv.insert({name=global.ki.core[coreunit].totalmodules[i], count=1}) if game.forces[1].technologies['fu_ki_plus_2_tech'].researched then
moduleset = global.ki.core[coreunit].fu_ki_plus_2_modules
elseif game.forces[1].technologies['fu_ki_plus_1_tech'].researched then
moduleset = global.ki.core[coreunit].fu_ki_plus_1_modules
end
end
for i,v in pairs(moduleset) do
if beacon_inv.can_insert({name=moduleset[i], count=1}) then
beacon_inv.insert({name=moduleset[i], count=1})
end end
end end
end end
@ -691,6 +699,8 @@ function el_ki_buffer1_adder()
local coreid = global.ki.channel[i].core local coreid = global.ki.channel[i].core
global.ki.core[coreid].totalmodules = {} global.ki.core[coreid].totalmodules = {}
global.ki.core[coreid].fu_ki_plus_1_modules = {}
global.ki.core[coreid].fu_ki_plus_2_modules = {}
for x,f in pairs(global.ki.core[coreid].modules) do for x,f in pairs(global.ki.core[coreid].modules) do
@ -725,7 +735,7 @@ function el_ki_buffer1_adder()
table.insert(moduletable, v) table.insert(moduletable, v)
end end
global.ki.core[coreid].totalmodules = moduletable global.ki.core[coreid].fu_ki_plus_2_modules = moduletable
elseif game.forces[1].technologies['fu_ki_plus_1_tech'].researched then elseif game.forces[1].technologies['fu_ki_plus_1_tech'].researched then
local moduletable = {} local moduletable = {}
for _,v in pairs(global.ki.core[coreid].totalmodules) do for _,v in pairs(global.ki.core[coreid].totalmodules) do
@ -733,7 +743,7 @@ function el_ki_buffer1_adder()
table.insert(moduletable, v) table.insert(moduletable, v)
end end
global.ki.core[coreid].totalmodules = moduletable global.ki.core[coreid].fu_ki_plus_1_modules = moduletable
end end
end end
end end