From 7811a70c624473b3f99cf7eb082442d06d52f616 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Fri, 28 Feb 2025 00:31:52 +0900 Subject: [PATCH] . --- PHI-CL/main.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/PHI-CL/main.lua b/PHI-CL/main.lua index 081aaab..7043a6f 100644 --- a/PHI-CL/main.lua +++ b/PHI-CL/main.lua @@ -33,14 +33,15 @@ function main.EEE(source, tier) item.next_upgrade = ((tier < source.max) and source.name .. '-' .. (tier + 1)) or nil item.production = item.production and (((source.tech == 'compound-energy' and source.type == 'solar-panel') and (tonumber(string.match(item.production, '[%d%.]+')) * (settings.startup['PHI-MB-ENERGY-SOLAR-RATIO'].value ^ (tier - source.min + 1)) .. (string.match(item.production, '%a+') or ''))) or (tonumber(string.match(item.production, '[%d%.]+')) * (2 ^ (tier - source.min + 1)) .. (string.match(item.production, '%a+') or ''))) or nil - for _, v in pairs({'energy_usage', 'heating_energy', 'crane_energy_usage', 'energy_per_shot', 'researching_speed', 'mining_speed', 'crafting_speed'}) do - if not (source.tech == 'compound-energy' and (source.type == 'solar-panel' or source.type == 'accumulator')) and item[v] then + for _, v in pairs({'researching_speed', 'mining_speed', 'crafting_speed'}) do + if item[v] then item[v] = tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1)) - local a = string.match(item[v], '%a+') + end + end - if a then - item[v] = item[v] .. a - end + for _, v in pairs({'energy_usage', 'heating_energy', 'crane_energy_usage', 'energy_per_shot'}) do + if not (source.tech == 'compound-energy' and (source.type == 'solar-panel' or source.type == 'accumulator')) and item[v] then + item[v] = (tonumber(string.match(item[v], '[%d%.]+')) * (2 ^ (tier - source.min + 1))) .. (string.match(item[v], '%a+') or '') end end