diff --git a/PHI-CL/main.lua b/PHI-CL/main.lua index 0e56697..6ba4002 100644 --- a/PHI-CL/main.lua +++ b/PHI-CL/main.lua @@ -273,33 +273,18 @@ end -- equipment function main.EEQ(source, tier) local item = table.deepcopy(data.raw[source.type][source.ref_name]) - -- local item = {} - item['name'] = source.name .. '-mk' .. tier .. '-equipment' - item['type'] = source.type - item['categories'] = {'armor'} + item.name = source.name .. '-mk' .. tier .. '-equipment' - -- local w = 1 - -- local h = 1 - - if (source.name == 'solar-panel') then + if (source.type == 'solar-equipment') or (source.type == 'fusion-equipment') then item.power = tostring(tonumber(string.match(item.power, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.power, '%a+') - -- item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'} + + elseif (source.type == 'battery-equipment') then + item['energy_source']['buffer_capacity'] = tostring(tonumber(string.match(item['energy_source']['buffer_capacity'], '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item['energy_source']['buffer_capacity'], '%a+') end + --[[ - elseif (source.name == 'battery') then - h = 2 - item['energy_source'] = {type = 'electric', usage_priority = 'tertiary', buffer_capacity= (source.base * (2 ^ (tier - source.min + 1))) .. 'MJ'} - - elseif (source.name == 'fusion-reactor') then - w = 4 - h = 4 - item['power'] = (source.base * (2 ^ (tier - source.min + 1))) .. 'kW' - item['energy_source'] = {type = 'electric', usage_priority = 'primary-output'} - elseif (source.name == 'personal-laser-defense') then - w = 2 - h = 2 item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (250 * (2 ^ (tier - source.min + 1))) .. 'kJ'} -- item['source_direction_count'] = 64 -- item['source_offset'] = {0, -3.423489 / 4} @@ -307,15 +292,11 @@ function main.EEQ(source, tier) item['automatic'] = true elseif (source.name == 'energy-shield') then - w = 2 - h = 2 item['energy_source'] = {type = 'electric', usage_priority = 'primary-input', input_flow_limit = (source.base * 4 * (2 ^ (tier - source.min + 1))) .. 'kW', buffer_capacity = (source.base * 2 * (2 ^ (tier - 1))) .. 'kJ'} item['max_shield_value'] = (source.base * (2 ^ (tier - 2))) item['energy_per_shield'] = '80kJ' elseif (source.name == 'personal-roboport') then - w = 2 - h = 2 item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = (source.base * 32 * (2 ^ (tier - source.min + 1))) .. 'MJ'} item['robot_limit'] = 50 item['construction_radius'] = 32 @@ -333,8 +314,6 @@ function main.EEQ(source, tier) item['charging_threshold_distance'] = 5 elseif (source.name == 'night-vision') then - w = 2 - h = 2 item['energy_source'] = {type = 'electric', usage_priority = 'primary-input', buffer_capacity = '240kJ'} item['energy_input'] = '20kW' item['activate_sound'] = {filename = '__base__/sound/nightvision-on.ogg', volume = 0.5} @@ -343,8 +322,6 @@ function main.EEQ(source, tier) item['color_lookup'] = {{0, '__core__/graphics/color_luts/lut-sunset.png'}} elseif (source.name == 'exoskeleton') then - w = 2 - h = 4 item['energy_source'] = {type = 'electric', usage_priority = 'secondary-input', buffer_capacity = '10MJ'} item['energy_consumption'] = '400kW' item['movement_bonus'] = source.base