diff --git a/PHI-CL/config.lua b/PHI-CL/config.lua index e1c387e..4dec700 100644 --- a/PHI-CL/config.lua +++ b/PHI-CL/config.lua @@ -243,6 +243,90 @@ local items = { min = 2, max = settings.startup['PHI-WE-RADAR-TIER'].value } + }, + ['equipment'] = { + ['solar-panel-equipment'] = { + enabled = settings.startup['PHI-EQ'].value, + stage = 1, + type = 'solar-panel-equipment', + name = 'solar-panel', + ref_name = 'solar-panel-equipment', + tech = 'solar-panel-equipment', + min = 2, + max = settings.startup['PHI-EQ-POWER-TIER'].value, + base = 30, + graphics_name = 'solar-panel-equipment' + }, + ['fusion-reactor-equipment'] = { + enabled = settings.startup['PHI-EQ'].value, + stage = 1, + type = 'generator-equipment', + name = 'fusion-reactor', + ref_name = 'fusion-reactor-equipment', + tech = 'fusion-reactor-equipment', + min = 2, + max = settings.startup['PHI-EQ-POWER-TIER'].value + }, + ['battery-equipment'] = { + enabled = settings.startup['PHI-EQ'].value, + stage = 1, + type = 'battery-equipment', + name = 'battery', + ref_name = 'battery-mk3-equipment', + tech = 'battery-mk3-equipment', + min = 4, + max = settings.startup['PHI-EQ-POWER-TIER'].value + }, + ['personal-laser-defense-equipment'] = { + enabled = settings.startup['PHI-EQ'].value, + stage = 1, + type = 'active-defense-equipment', + name = 'personal-laser-defense', + ref_name = 'personal-laser-defense-equipment', + tech = 'personal-laser-defense-equipment', + min = 2, + max = settings.startup['PHI-EQ-DEFENSE-TIER'].value + }, + ['energy-shield-equipment'] = { + enabled = settings.startup['PHI-EQ'].value, + stage = 1, + type = 'energy-shield-equipment', + name = 'energy-shield', + ref_name = 'energy-shield-mk2-equipment', + tech = 'energy-shield-mk2-equipment', + min = 3, + max = settings.startup['PHI-EQ-DEFENSE-TIER'].value + }, + ['personal-roboport-equipment'] = { + enabled = settings.startup['PHI-EQ'].value, + stage = 1, + type = 'roboport-equipment', + name = 'personal-roboport', + ref_name = 'personal-roboport-mk2-equipment', + tech = 'personal-roboport-mk2-equipment', + min = 3, + max = settings.startup['PHI-EQ-TOOL-TIER'].value + }, + ['night-vision-equipment'] = { + enabled = settings.startup['PHI-EQ'].value, + stage = 1, + type = 'night-vision-equipment', + name = 'night-vision', + ref_name = 'night-vision-equipment', + tech = 'night-vision-equipment', + min = 2, + max = settings.startup['PHI-EQ-UTILITY-TIER'].value + }, + ['exoskeleton-equipment'] = { + enabled = settings.startup['PHI-EQ'].value, + stage = 1, + type = 'movement-bonus-equipment', + name = 'exoskeleton', + ref_name = 'exoskeleton-equipment', + tech = 'exoskeleton-equipment', + min = 2, + max = settings.startup['PHI-EQ-UTILITY-TIER'].value + } } } diff --git a/PHI-CL/data-updates.lua b/PHI-CL/data-updates.lua index d7323a1..7a0b0a7 100644 --- a/PHI-CL/data-updates.lua +++ b/PHI-CL/data-updates.lua @@ -16,3 +16,16 @@ for _, v in pairs(items['item']) do main.EL(v) end end + +for _, v in pairs(items['equipment']) do + if (v.stage == file_stage) and v.enabled and (v.max >= v.min) then + v.category = 'equipment' + + for j=v.min, v.max, 1 do + main.EEQ(v, j) + main.EI(v, j) + main.ER(v, j) + main.ET(v, j) + end + end +end diff --git a/PHI-CL/data.lua b/PHI-CL/data.lua index 47e86d9..d13c4df 100644 --- a/PHI-CL/data.lua +++ b/PHI-CL/data.lua @@ -8,7 +8,6 @@ if settings.startup['PHI-EN'].value and settings.startup['PHI-EN-SOLAR-TIER'].va for i=1, 7 do local tn = 'compound-energy-' .. i local prereq - local e = true if i > 1 then prereq = {'compound-energy-' .. (i - 1)} @@ -17,14 +16,10 @@ if settings.startup['PHI-EN'].value and settings.startup['PHI-EN-SOLAR-TIER'].va prereq = {'solar-energy', 'advanced-circuit', 'electric-energy-accumulators'} end - if i > ml then - e = false - end - data:extend({{ type = 'technology', name = tn, - enabled = e, + enabled = (i <= ml), prerequisites = prereq, effects = {}, unit = { @@ -602,7 +597,7 @@ if settings.startup['PHI-CT'].value and settings.startup['PHI-CT-FLUID'].value t main_product = v.name, hide_from_player_crafting = true, allow_productivity = false, - crafting_machine_tint = v.flow_color, + crafting_machine_tint = {primary=v.flow_color}, localised_name = v.localised_name, localised_description = nil }}) @@ -624,3 +619,16 @@ for _, v in pairs(items['item']) do main.EL(v) end end + +for _, v in pairs(items['equipment']) do + if (v.stage == file_stage) and v.enabled and (v.max >= v.min) then + v.category = 'equipment' + + for j=v.min, v.max, 1 do + main.EEQ(v, j) + main.EI(v, j) + main.ER(v, j) + main.ET(v, j) + end + end +end diff --git a/PHI-CL/info.json b/PHI-CL/info.json index 8952ddb..5b9bc58 100644 --- a/PHI-CL/info.json +++ b/PHI-CL/info.json @@ -1,13 +1,13 @@ { "name": "PHI-CL", - "version": "3.0.0", + "version": "3.0.1", "factorio_version": "2.0", - "date": "2024-10-16", + "date": "2024-10-29", "title": "Phidias Collection", "author": "PHIDIAS0303", "contributers": "", "homepage": "", - "description": "Additional compound entities and items to reduce the space needed\nSuch as better solar panel, accumulator\nAnd other feature such as water pump placement anywhere, large range radar, trash chest and pipe, passive power void, linked chest, empty world generation", + "description": "Additional compound entities and items to reduce the space needed\nSuch as better solar panel, accumulator\nAnd other feature such as large range radar, trash chest and pipe, passive power void, linked chest, empty world generation", "dependencies": [ "base >= 2.0.0", "? space-age", diff --git a/PHI-CL/locale/en/locale.cfg b/PHI-CL/locale/en/locale.cfg index 2ad1e32..478834b 100644 --- a/PHI-CL/locale/en/locale.cfg +++ b/PHI-CL/locale/en/locale.cfg @@ -60,6 +60,7 @@ thruster=Thruster solar-panel-equipment=Portable solar panel battery-mk2-equipment=Personal battery +battery-mk3-equipment=Personal battery fusion-reactor-equipment=Portable fusion reactor energy-shield-mk2-equipment=Energy shield personal-laser-defense-equipment=Personal laser defense @@ -101,15 +102,11 @@ PHI-WE-TURRET-TIER=WE1 turret tier PHI-WE-RADAR-TIER=WE2 Radar tier PHI-EQ=EQ Armor equipment -PHI-EQ-SOLAR-TIER=EQ1 Portable solar panel tier -PHI-EQ-BATTERY-TIER=EQ2 Personal battery tier -PHI-EQ-REACTOR-TIER=EQ3 Portable fusion reactor tier -PHI-EQ-LASER-TIER=EQ4 Personal laser defense tier -PHI-EQ-ROBOPORT-TIER=EQ5 Personal roboport tier -PHI-EQ-SHIELD-TIER=EQ6 Energy shield tier -PHI-EQ-NIGHT-TIER=EQ7 Nightvision equipment tier -PHI-EQ-EXO-TIER=EQ8 Exoskeleton tier -PHI-EQ-ARMOR=EQ9 Enable armor +PHI-EQ-POWER-TIER=EQ1 Power tier +PHI-EQ-DEFENSE-TIER=EQ2 Defense tier +PHI-EQ-TOOL-TIER=EQ3 Tool tier +PHI-EQ-UTILITY-TIER=EQ4 Utility tier +PHI-EQ-ARMOR=EQ5 Enable armor PHI-MI=MI Miscellaneous change PHI-MI-LANDFILL=MI1 Landfill requirement @@ -143,14 +140,10 @@ PHI-MB-MACHINE-TIER=Default 3 ; Disable 1 PHI-WE-TURRET-TIER=Default 3 ; Disable 1 PHI-WE-RADAR-TIER=Default 3 ; Disable 1 -PHI-EQ-SOLAR-TIER=Default 8 ; Disable 1 -PHI-EQ-BATTERY-TIER=Default 8 ; Disable 2 -PHI-EQ-REACTOR-TIER=Default 8 ; Disable 1 -PHI-EQ-LASER-TIER=Default 8 ; Disable 1 -PHI-EQ-ROBOPORT-TIER=Default 8 ; Disable 2 -PHI-EQ-SHIELD-TIER=Default 8 ; Disable 2 -PHI-EQ-NIGHT-TIER=Default 2 ; Disable 1 -PHI-EQ-EXO-TIER=Default 2 ; Disable 1 +PHI-EQ-POWER-TIER=Default 8 ; Disable 1 +PHI-EQ-DEFENSE-TIER=Default 8 ; Disable 1 +PHI-EQ-TOOL-TIER=Default 8 ; Disable 1 +PHI-EQ-UTILITY-TIER=Default 2 ; Disable 1 PHI-MI-LANDFILL=Default 20 PHI-MI-REPAIR=Default 1 diff --git a/PHI-CL/locale/ja/locale.cfg b/PHI-CL/locale/ja/locale.cfg index e0e266b..f3422b1 100644 --- a/PHI-CL/locale/ja/locale.cfg +++ b/PHI-CL/locale/ja/locale.cfg @@ -59,6 +59,7 @@ thruster=スラスター solar-panel-equipment=携帯ソーラーパネルモジュール battery-mk2-equipment=個人用バッテリー +battery-mk3-equipment=個人用バッテリー fusion-reactor-equipment=携帯核融合炉モジュール energy-shield-mk2-equipment=エネルギーシールドモジュール personal-laser-defense-equipment=携帯レーザー防御モジュール @@ -100,15 +101,11 @@ PHI-WE-TURRET-TIER=WE1 タレットの最高等級 PHI-WE-RADAR-TIER=WE2 レーダーの最高等級 PHI-EQ=EQ アーマー設備を有効にする -PHI-EQ-SOLAR-TIER=EQ1 携帯ソーラーパネルモジュールの最高等級 -PHI-EQ-BATTERY-TIER=EQ2 個人用バッテリーの最高等級 -PHI-EQ-REACTOR-TIER=EQ3 携帯核融合炉モジュールの最高等級 -PHI-EQ-LASER-TIER=EQ4 携帯レーザー防御モジュールの最高等級 -PHI-EQ-ROBOPORT-TIER=EQ5 携帯ロボットステーションの最高等級 -PHI-EQ-SHIELD-TIER=EQ6 エネルギーシールドモジュールの最高等級 -PHI-EQ-NIGHT-TIER=EQ7 暗視モジュールの最高等級 -PHI-EQ-EXO-TIER=EQ8 強化外骨格モジュールの最高等級 -PHI-EQ-ARMOR=EQ9 アーマーを有効にする +PHI-EQ-POWER-TIER=EQ1 発電モジュールの最高等級 +PHI-EQ-DEFENSE-TIER=EQ2 防御モジュールの最高等級 +PHI-EQ-TOOL-TIER=EQ3 ツールモジュールの最高等級 +PHI-EQ-UTILITY-TIER=EQ4 ユーティリティモジュールの最高等級 +PHI-EQ-ARMOR=EQ5 アーマーを有効にする PHI-MI=MI その他の変更 PHI-MI-LANDFILL=MI1 埋立地要件 @@ -142,14 +139,10 @@ PHI-MB-MACHINE-TIER=デフォルト 3 ; 止める 1 PHI-WE-TURRET-TIER=デフォルト 3 ; 止める 1 PHI-WE-RADAR-TIER=デフォルト 3 ; 止める 1 -PHI-EQ-SOLAR-TIER=デフォルト 8 ; 止める 1 -PHI-EQ-BATTERY-TIER=デフォルト 8 ; 止める 2 -PHI-EQ-REACTOR-TIER=デフォルト 8 ; 止める 1 -PHI-EQ-LASER-TIER=デフォルト 8 ; 止める 1 -PHI-EQ-ROBOPORT-TIER=デフォルト 8 ; 止める 2 -PHI-EQ-SHIELD-TIER=デフォルト 8 ; 止める 2 -PHI-EQ-NIGHT-TIER=デフォルト 2 ; 止める 1 -PHI-EQ-EXO-TIER=デフォルト 2 ; 止める 1 +PHI-EQ-POWER-TIER=デフォルト 8 ; 止める 1 +PHI-EQ-DEFENSE-TIER=デフォルト 8 ; 止める 1 +PHI-EQ-TOOL-TIER=デフォルト 8 ; 止める 1 +PHI-EQ-UTILITY-TIER=デフォルト 2 ; 止める 1 PHI-MI-LANDFILL=デフォルト 20 PHI-MI-REPAIR=デフォルト 1 diff --git a/PHI-CL/locale/zh-CN/locale.cfg b/PHI-CL/locale/zh-CN/locale.cfg index 258f642..f989452 100644 --- a/PHI-CL/locale/zh-CN/locale.cfg +++ b/PHI-CL/locale/zh-CN/locale.cfg @@ -59,6 +59,7 @@ thruster=推進器 solar-panel-equipment=攜帶式太陽能板 battery-mk2-equipment=電池設備 +battery-mk3-equipment=電池設備 fusion-reactor-equipment=攜帶式核融合反應器 energy-shield-mk2-equipment=能量護盾 personal-laser-defense-equipment=個人雷射防禦 @@ -100,15 +101,11 @@ PHI-WE-TURRET-TIER=WE1 炮塔的最高等級 PHI-WE-RADAR-TIER=WE2 雷達的最高等級 PHI-EQ=EQ 啟用裝甲設備 -PHI-EQ-SOLAR-TIER=EQ1 攜帶式太陽能板的最高等級 -PHI-EQ-BATTERY-TIER=EQ2 電池設備的最高等級 -PHI-EQ-REACTOR-TIER=EQ3 攜帶式核融合反應器的最高等級 -PHI-EQ-LASER-TIER=EQ4 個人雷射防禦的最高等級 -PHI-EQ-ROBOPORT-TIER=EQ5 機動無人機調度站的最高等級 -PHI-EQ-SHIELD-TIER=EQ6 能量護盾的最高等級 -PHI-EQ-NIGHT-TIER=EQ7 夜視鏡的最高等級 -PHI-EQ-EXO-TIER=EQ8 動力外骨骼的最高等級 -PHI-EQ-ARMOR=EQ9 護甲啟用 +PHI-EQ-POWER-TIER=EQ1 發電的最高等級 +PHI-EQ-DEFENSE-TIER=EQ2 防禦的最高等級 +PHI-EQ-TOOL-TIER=EQ3 工具的最高等級 +PHI-EQ-UTILITY-TIER=EQ4 雜項的最高等級 +PHI-EQ-ARMOR=EQ5 護甲啟用 PHI-MI=MI 雜項小變化 PHI-MI-LANDFILL=MI1 人造陸地需求 @@ -142,14 +139,10 @@ PHI-MB-MACHINE-TIER=預設 3 ; 停用 1 PHI-WE-TURRET-TIER=預設 3 ; 停用 1 PHI-WE-RADAR-TIER=預設 3 ; 停用 1 -PHI-EQ-SOLAR-TIER=預設 8 ; 停用 1 -PHI-EQ-BATTERY-TIER=預設 8 ; 停用 2 -PHI-EQ-REACTOR-TIER=預設 8 ; 停用 1 -PHI-EQ-LASER-TIER=預設 8 ; 停用 1 -PHI-EQ-ROBOPORT-TIER=預設 8 ; 停用 2 -PHI-EQ-SHIELD-TIER=預設 8 ; 停用 2 -PHI-EQ-NIGHT-TIER=預設 2 ; 停用 1 -PHI-EQ-EXO-TIER=預設 2 ; 停用 1 +PHI-EQ-POWER-TIER=預設 8 ; 停用 1 +PHI-EQ-DEFENSE-TIER=預設 8 ; 停用 1 +PHI-EQ-TOOL-TIER=預設 8 ; 停用 1 +PHI-EQ-UTILITY-TIER=預設 2 ; 停用 1 PHI-MI-LANDFILL=預設 20 PHI-MI-REPAIR=預設 1 diff --git a/PHI-CL/locale/zh-TW/locale.cfg b/PHI-CL/locale/zh-TW/locale.cfg index 258f642..f989452 100644 --- a/PHI-CL/locale/zh-TW/locale.cfg +++ b/PHI-CL/locale/zh-TW/locale.cfg @@ -59,6 +59,7 @@ thruster=推進器 solar-panel-equipment=攜帶式太陽能板 battery-mk2-equipment=電池設備 +battery-mk3-equipment=電池設備 fusion-reactor-equipment=攜帶式核融合反應器 energy-shield-mk2-equipment=能量護盾 personal-laser-defense-equipment=個人雷射防禦 @@ -100,15 +101,11 @@ PHI-WE-TURRET-TIER=WE1 炮塔的最高等級 PHI-WE-RADAR-TIER=WE2 雷達的最高等級 PHI-EQ=EQ 啟用裝甲設備 -PHI-EQ-SOLAR-TIER=EQ1 攜帶式太陽能板的最高等級 -PHI-EQ-BATTERY-TIER=EQ2 電池設備的最高等級 -PHI-EQ-REACTOR-TIER=EQ3 攜帶式核融合反應器的最高等級 -PHI-EQ-LASER-TIER=EQ4 個人雷射防禦的最高等級 -PHI-EQ-ROBOPORT-TIER=EQ5 機動無人機調度站的最高等級 -PHI-EQ-SHIELD-TIER=EQ6 能量護盾的最高等級 -PHI-EQ-NIGHT-TIER=EQ7 夜視鏡的最高等級 -PHI-EQ-EXO-TIER=EQ8 動力外骨骼的最高等級 -PHI-EQ-ARMOR=EQ9 護甲啟用 +PHI-EQ-POWER-TIER=EQ1 發電的最高等級 +PHI-EQ-DEFENSE-TIER=EQ2 防禦的最高等級 +PHI-EQ-TOOL-TIER=EQ3 工具的最高等級 +PHI-EQ-UTILITY-TIER=EQ4 雜項的最高等級 +PHI-EQ-ARMOR=EQ5 護甲啟用 PHI-MI=MI 雜項小變化 PHI-MI-LANDFILL=MI1 人造陸地需求 @@ -142,14 +139,10 @@ PHI-MB-MACHINE-TIER=預設 3 ; 停用 1 PHI-WE-TURRET-TIER=預設 3 ; 停用 1 PHI-WE-RADAR-TIER=預設 3 ; 停用 1 -PHI-EQ-SOLAR-TIER=預設 8 ; 停用 1 -PHI-EQ-BATTERY-TIER=預設 8 ; 停用 2 -PHI-EQ-REACTOR-TIER=預設 8 ; 停用 1 -PHI-EQ-LASER-TIER=預設 8 ; 停用 1 -PHI-EQ-ROBOPORT-TIER=預設 8 ; 停用 2 -PHI-EQ-SHIELD-TIER=預設 8 ; 停用 2 -PHI-EQ-NIGHT-TIER=預設 2 ; 停用 1 -PHI-EQ-EXO-TIER=預設 2 ; 停用 1 +PHI-EQ-POWER-TIER=預設 8 ; 停用 1 +PHI-EQ-DEFENSE-TIER=預設 8 ; 停用 1 +PHI-EQ-TOOL-TIER=預設 8 ; 停用 1 +PHI-EQ-UTILITY-TIER=預設 2 ; 停用 1 PHI-MI-LANDFILL=預設 20 PHI-MI-REPAIR=預設 1 diff --git a/PHI-CL/main.lua b/PHI-CL/main.lua index 90dd1d7..1007bd8 100644 --- a/PHI-CL/main.lua +++ b/PHI-CL/main.lua @@ -220,6 +220,94 @@ function main.EEE(source, tier) data:extend({item}) end +-- equipment +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 = source.name .. '-mk' .. tier .. '-equipment' + + if item.power then + item.power = tostring(tonumber(string.match(item.power, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.power, '%a+') + end + + if item.energy_source then + if item.energy_source.buffer_capacity 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 + + if item.energy_source.input_flow_limit then + item.energy_source.input_flow_limit = tostring(tonumber(string.match(item.energy_source.input_flow_limit, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_source.input_flow_limit, '%a+') + end + + if item.energy_source.output_flow_limit then + item.energy_source.output_flow_limit = tostring(tonumber(string.match(item.energy_source.output_flow_limit, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_source.output_flow_limit, '%a+') + end + end + + if item.energy_consumption then + item.energy_consumption = tostring(tonumber(string.match(item.energy_consumption, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_consumption, '%a+') + + elseif item.energy_input then + item.energy_input = tostring(tonumber(string.match(item.energy_input, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_input, '%a+') + end + + if item.darkness_to_turn_on and item.color_lookup then + item.darkness_to_turn_on = 0 + item.color_lookup = {{0, '__core__/graphics/color_luts/lut-sunset.png'}} + + elseif item.attack_parameters then + if item.attack_parameters.cooldown then + item.attack_parameters.cooldown = math.floor(item.attack_parameters.cooldown * ((32 - (tier - source.min + 1)) / 32)) + end + + if item.attack_parameters.damage_modifier then + item.attack_parameters.damage_modifier = item.attack_parameters.damage_modifier * (2 ^ (tier - source.min + 1)) + end + + if item.attack_parameters.ammo_type then + if item.attack_parameters.ammo_type.energy_consumption then + item.attack_parameters.ammo_type.energy_consumption = tostring(tonumber(string.match(item.attack_parameters.ammo_type.energy_consumption, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.attack_parameters.ammo_type.energy_consumption, '%a+') + end + + if item.attack_parameters.ammo_type.action_delivery then + + if item.attack_parameters.ammo_type.action_delivery then + item.attack_parameters.ammo_type.action_delivery.max_length = item.attack_parameters.ammo_type.action_delivery.max_length + (tier - source.min + 1) + end + end + end + + if item.attack_parameters.range then + item.attack_parameters.range = item.attack_parameters.range + (tier - source.min + 1) + end + + elseif item.max_shield_value and item.energy_per_shield then + item.max_shield_value = item.max_shield_value * (2 ^ (tier - source.min + 1)) + item.energy_per_shield = tostring(math.floor(tonumber(string.match(item.energy_per_shield, '[%d%.]+')) * ((32 - (tier - source.min + 1)) / 32))) .. string.match(item.energy_per_shield, '%a+') + + elseif item.movement_bonus then + item.movement_bonus = item.movement_bonus * (2 ^ (tier - source.min + 1)) + + elseif item.charging_energy and item.charging_station_count then + item.charging_station_count = math.max(item.charging_station_count, 4) + item.charging_energy = tostring(tonumber(string.match(item.charging_energy, '[%d%.]+')) * (2 ^ (tier - source.min + 2))) .. string.match(item.charging_energy, '%a+') + end + + if item.sprite then + item.sprite.tint = items['tint'][tier] + + if item.sprite.hr_version then + item.sprite.hr_version.tint = items['tint'][tier] + end + end + + item.localised_name = {'phi-cl.combine-gen', {'name.' .. source.ref_name}, tostring(tier)} + item.localised_description = item.localised_description + + data:extend({item}) +end + -- item function main.EI(source, tier) local item = table.deepcopy(data.raw.item[source.ref_name]) diff --git a/PHI-CL/note.lua b/PHI-CL/note.lua index ba0080f..5bf7cc6 100644 --- a/PHI-CL/note.lua +++ b/PHI-CL/note.lua @@ -11,92 +11,7 @@ max = settings.startup['PHI-MB-MACHINE-TIER'].value } -['equipment'] = { - ['solar-panel-equipment'] = { - enabled = settings.startup['PHI-EQ'].value, - stage = 1, - type = 'solar-panel-equipment', - name = 'solar-panel', - ref_name = 'solar-panel-equipment', - tech = 'solar-panel-equipment', - min = 2, - max = settings.startup['PHI-EQ-SOLAR-TIER'].value, - base = 30, - graphics_name = 'solar-panel-equipment' - }, - ['fusion-reactor-equipment'] = { - enabled = settings.startup['PHI-EQ'].value, - stage = 1, - type = 'generator-equipment', - name = 'fusion-reactor', - ref_name = 'fusion-reactor-equipment', - tech = 'fusion-reactor-equipment', - min = 2, - max = settings.startup['PHI-EQ-REACTOR-TIER'].value - }, - ['battery-equipment'] = { - enabled = settings.startup['PHI-EQ'].value, - stage = 1, - type = 'battery-equipment', - name = 'battery', - ref_name = 'battery-mk3-equipment', - tech = 'battery-mk3-equipment', - min = 4, - max = settings.startup['PHI-EQ-BATTERY-TIER'].value - }, - ['personal-laser-defense-equipment'] = { - enabled = settings.startup['PHI-EQ'].value, - stage = 1, - type = 'active-defense-equipment', - name = 'personal-laser-defense', - ref_name = 'personal-laser-defense-equipment', - tech = 'personal-laser-defense-equipment', - min = 2, - max = settings.startup['PHI-EQ-LASER-TIER'].value - }, - ['energy-shield-equipment'] = { - enabled = settings.startup['PHI-EQ'].value, - stage = 1, - type = 'energy-shield-equipment', - name = 'energy-shield', - ref_name = 'energy-shield-mk2-equipment', - tech = 'energy-shield-mk2-equipment', - min = 3, - max = settings.startup['PHI-EQ-SHIELD-TIER'].value - }, - ['personal-roboport-equipment'] = { - enabled = settings.startup['PHI-EQ'].value, - stage = 1, - type = 'roboport-equipment', - name = 'personal-roboport', - ref_name = 'personal-roboport-mk2-equipment', - tech = 'personal-roboport-mk2-equipment', - min = 3, - max = settings.startup['PHI-EQ-ROBOPORT-TIER'].value - }, - ['night-vision-equipment'] = { - enabled = settings.startup['PHI-EQ'].value, - stage = 1, - type = 'night-vision-equipment', - name = 'night-vision', - ref_name = 'night-vision-equipment', - tech = 'night-vision-equipment', - min = 2, - max = settings.startup['PHI-EQ-NIGHT-TIER'].value - }, - ['exoskeleton-equipment'] = { - enabled = settings.startup['PHI-EQ'].value, - stage = 1, - type = 'movement-bonus-equipment', - name = 'exoskeleton', - ref_name = 'exoskeleton-equipment', - tech = 'exoskeleton-equipment', - min = 2, - max = settings.startup['PHI-EQ-EXO-TIER'].value - } - }, - - if mods['aai-industry'] then + if mods['aai-industry'] then items['item']['industrial-furnace'] = { enabled = settings.startup['PHI-MB'].value, stage = 2, @@ -700,96 +615,6 @@ end ** MAIN - --- equipment -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 = source.name .. '-mk' .. tier .. '-equipment' - - if item.power then - item.power = tostring(tonumber(string.match(item.power, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.power, '%a+') - end - - if item.energy_source then - if item.energy_source.buffer_capacity 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 - - if item.energy_source.input_flow_limit then - item.energy_source.input_flow_limit = tostring(tonumber(string.match(item.energy_source.input_flow_limit, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_source.input_flow_limit, '%a+') - end - - if item.energy_source.output_flow_limit then - item.energy_source.output_flow_limit = tostring(tonumber(string.match(item.energy_source.output_flow_limit, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_source.output_flow_limit, '%a+') - end - end - - if item.energy_consumption then - item.energy_consumption = tostring(tonumber(string.match(item.energy_consumption, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_consumption, '%a+') - - elseif item.energy_input then - item.energy_input = tostring(tonumber(string.match(item.energy_input, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.energy_input, '%a+') - end - - if item.darkness_to_turn_on and item.color_lookup then - item.darkness_to_turn_on = 0 - item.color_lookup = {{0, '__core__/graphics/color_luts/lut-sunset.png'}} - - elseif item.attack_parameters then - if item.attack_parameters.cooldown then - item.attack_parameters.cooldown = math.floor(item.attack_parameters.cooldown * ((32 - (tier - source.min + 1)) / 32)) - end - - if item.attack_parameters.damage_modifier then - item.attack_parameters.damage_modifier = item.attack_parameters.damage_modifier * (2 ^ (tier - source.min + 1)) - end - - if item.attack_parameters.ammo_type then - if item.attack_parameters.ammo_type.energy_consumption then - item.attack_parameters.ammo_type.energy_consumption = tostring(tonumber(string.match(item.attack_parameters.ammo_type.energy_consumption, '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. string.match(item.attack_parameters.ammo_type.energy_consumption, '%a+') - end - - if item.attack_parameters.ammo_type.action_delivery then - - if item.attack_parameters.ammo_type.action_delivery then - item.attack_parameters.ammo_type.action_delivery.max_length = item.attack_parameters.ammo_type.action_delivery.max_length + (tier - source.min + 1) - end - end - end - - if item.attack_parameters.range then - item.attack_parameters.range = item.attack_parameters.range + (tier - source.min + 1) - end - - elseif item.max_shield_value and item.energy_per_shield then - item.max_shield_value = item.max_shield_value * (2 ^ (tier - source.min + 1)) - item.energy_per_shield = tostring(math.floor(tonumber(string.match(item.energy_per_shield, '[%d%.]+')) * ((32 - (tier - source.min + 1)) / 32))) .. string.match(item.energy_per_shield, '%a+') - - elseif item.movement_bonus then - item.movement_bonus = item.movement_bonus * (2 ^ (tier - source.min + 1)) - - elseif item.charging_energy and item.charging_station_count then - item.charging_station_count = math.max(item.charging_station_count, 4) - item.charging_energy = tostring(tonumber(string.match(item.charging_energy, '[%d%.]+')) * (2 ^ (tier - source.min + 2))) .. string.match(item.charging_energy, '%a+') - end - - if item.sprite then - item.sprite.tint = items['tint'][tier] - - if item.sprite.hr_version then - item.sprite.hr_version.tint = items['tint'][tier] - end - end - - item.localised_name = {'phi-cl.combine-gen', {'name.' .. source.ref_name}, tostring(tier)} - item.localised_description = item.localised_description - - data:extend({item}) -end - - 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] @@ -834,20 +659,6 @@ end end ** DATA -for _, v in pairs(items['equipment']) do - if (v.stage == file_stage) and v.enabled and (v.max >= v.min) then - v.category = 'equipment' - - for j=v.min, v.max, 1 do - main.EEQ(v, j) - main.EI(v, j) - main.ER(v, j) - main.ET(v, j) - end - end -end - - if settings.startup['PHI-CT'].value and settings.startup['PHI-CT-TRAIN'].value then local item = table.deepcopy(data.raw['item']['used-up-uranium-fuel-cell']) item.name = 'empty-train-battery' @@ -1120,76 +931,6 @@ if settings.startup['PHI-CT'].value and settings.startup['PHI-CT-TILE'].value th end ** SETTING -{ - type = 'bool-setting', - name = 'PHI-EQ', - setting_type = 'startup', - default_value = false, - order = 'D00' - }, -, { - type = 'int-setting', - name = 'PHI-EQ-SOLAR-TIER', - setting_type = 'startup', - default_value = 8, - allowed_values = {1, 2, 3, 4, 5, 6, 7, 8}, - order = 'D01' - }, { - type = 'int-setting', - name = 'PHI-EQ-BATTERY-TIER', - setting_type = 'startup', - default_value = 8, - allowed_values = {2, 3, 4, 5, 6, 7, 8}, - order = 'D02' - }, { - type = 'int-setting', - name = 'PHI-EQ-REACTOR-TIER', - setting_type = 'startup', - default_value = 8, - allowed_values = {1, 2, 3, 4, 5, 6, 7, 8}, - order = 'D03' - }, { - type = 'int-setting', - name = 'PHI-EQ-LASER-TIER', - setting_type = 'startup', - default_value = 8, - allowed_values = {1, 2, 3, 4, 5, 6, 7, 8}, - order = 'D04' - }, { - type = 'int-setting', - name = 'PHI-EQ-ROBOPORT-TIER', - setting_type = 'startup', - default_value = 8, - allowed_values = {2, 3, 4, 5, 6, 7, 8}, - order = 'D05' - }, { - type = 'int-setting', - name = 'PHI-EQ-SHIELD-TIER', - setting_type = 'startup', - default_value = 8, - allowed_values = {2, 3, 4, 5, 6, 7, 8}, - order = 'D06' - }, { - type = 'int-setting', - name = 'PHI-EQ-NIGHT-TIER', - setting_type = 'startup', - default_value = 2, - allowed_values = {1, 2}, - order = 'D07' - }, { - type = 'int-setting', - name = 'PHI-EQ-EXO-TIER', - setting_type = 'startup', - default_value = 2, - allowed_values = {1, 2}, - order = 'D08' - }, { - type = 'bool-setting', - name = 'PHI-EQ-ARMOR', - setting_type = 'startup', - default_value = true, - order = 'D09' - }, { type = 'int-setting', name = 'PHI-MI-REPAIR', @@ -1224,6 +965,19 @@ end setting_type = 'startup', default_value = true, order = 'E10' + }, { + type = 'bool-setting', + name = 'PHI-CT-TILE', + setting_type = 'startup', + default_value = true, + order = 'J03' + }, { + type = 'string-setting', + name = 'PHI-CT-TILE-CHOICE', + setting_type = 'startup', + default_value = 'grass-1', + allowed_values = {'concrete', 'deepwater', 'deepwater-green', 'dirt-1', 'dirt-2', 'dirt-3', 'dirt-4', 'dirt-5', 'dirt-6', 'dirt-7', 'dry-dirt', 'grass-1', 'grass-2', 'grass-3', 'grass-4', 'hazard-concrete-left', 'hazard-concrete-right', 'lab-dark-1', 'lab-dark-2', 'lab-white', 'landfill', 'out-of-map', 'red-desert-0', 'red-desert-1', 'red-desert-2', 'red-desert-3', 'refined-concrete', 'refined-hazard-concrete-left', 'refined-hazard-concrete-right', 'sand-1', 'sand-2', 'sand-3', 'stone-path', 'tutorial-grid', 'water', 'water-green', 'water-mud', 'water-shallow'}, + order = 'J04' }, "? aai-industry >= 0.5.0", diff --git a/PHI-CL/settings.lua b/PHI-CL/settings.lua index d6e4c21..1e00847 100644 --- a/PHI-CL/settings.lua +++ b/PHI-CL/settings.lua @@ -52,6 +52,40 @@ data:extend({ default_value = 3, allowed_values = {1, 2, 3}, order = 'C02' + }, { + type = 'bool-setting', + name = 'PHI-EQ', + setting_type = 'startup', + default_value = false, + order = 'D00' + }, { + type = 'int-setting', + name = 'PHI-EQ-POWER-TIER', + setting_type = 'startup', + default_value = 8, + allowed_values = {1, 2, 3, 4, 5, 6, 7, 8}, + order = 'D01' + }, { + type = 'int-setting', + name = 'PHI-EQ-DEFENSE-TIER', + setting_type = 'startup', + default_value = 8, + allowed_values = {1, 2, 3, 4, 5, 6, 7, 8}, + order = 'D02' + }, { + type = 'int-setting', + name = 'PHI-EQ-TOOL-TIER', + setting_type = 'startup', + default_value = 8, + allowed_values = {1, 2, 3, 4, 5, 6, 7, 8}, + order = 'D03' + }, { + type = 'int-setting', + name = 'PHI-EQ-UTILITY-TIER', + setting_type = 'startup', + default_value = 2, + allowed_values = {1, 2}, + order = 'D04' }, { type = 'bool-setting', name = 'PHI-MI', @@ -108,19 +142,6 @@ data:extend({ setting_type = 'startup', default_value = true, order = 'J02' - }, { - type = 'bool-setting', - name = 'PHI-CT-TILE', - setting_type = 'startup', - default_value = true, - order = 'J03' - }, { - type = 'string-setting', - name = 'PHI-CT-TILE-CHOICE', - setting_type = 'startup', - default_value = 'grass-1', - allowed_values = {'concrete', 'deepwater', 'deepwater-green', 'dirt-1', 'dirt-2', 'dirt-3', 'dirt-4', 'dirt-5', 'dirt-6', 'dirt-7', 'dry-dirt', 'grass-1', 'grass-2', 'grass-3', 'grass-4', 'hazard-concrete-left', 'hazard-concrete-right', 'lab-dark-1', 'lab-dark-2', 'lab-white', 'landfill', 'out-of-map', 'red-desert-0', 'red-desert-1', 'red-desert-2', 'red-desert-3', 'refined-concrete', 'refined-hazard-concrete-left', 'refined-hazard-concrete-right', 'sand-1', 'sand-2', 'sand-3', 'stone-path', 'tutorial-grid', 'water', 'water-green', 'water-mud', 'water-shallow'}, - order = 'J04' }, { type = 'bool-setting', name = 'PHI-CT-TRASH',