From f82b0212b50b8eab91cc6cb51cdfe2ea8fd99df7 Mon Sep 17 00:00:00 2001 From: ItsUnknownGamer Date: Fri, 4 Mar 2022 17:44:49 +0100 Subject: [PATCH] shield recovery time depending on distributor draw --- src/app/shipyard/Calculations.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/shipyard/Calculations.js b/src/app/shipyard/Calculations.js index 6fcde9f8..d6326f01 100644 --- a/src/app/shipyard/Calculations.js +++ b/src/app/shipyard/Calculations.js @@ -383,7 +383,8 @@ export function shieldMetrics(ship, sys) { // Our initial regeneration comes from the SYS capacitor store, which is replenished as it goes // 0.6 is a magic number from FD: each 0.6 MW of energy from the power distributor recharges 1 MJ/s of regeneration - let capacitorDrain = (shieldGenerator.getBrokenRegenerationRate() * 0.6) - sysRechargeRate; + let capacitorDrain = (shieldGenerator.getBrokenRegenerationRate() * shieldGenerator.getDistDraw()) - sysRechargeRate; + let capacitorLifetime = powerDistributor.getSystemsCapacity() / capacitorDrain; let recover = 16; @@ -399,7 +400,7 @@ export function shieldMetrics(ship, sys) { recover = Math.Infinity; } else { // Recover remaining shields at the rate of the power distributor's recharge - recover += remainingShieldToRecover / (sysRechargeRate / 0.6); + recover += remainingShieldToRecover / (sysRechargeRate / shieldGenerator.getDistDraw()); } } @@ -408,7 +409,7 @@ export function shieldMetrics(ship, sys) { // Our initial regeneration comes from the SYS capacitor store, which is replenished as it goes // 0.6 is a magic number from FD: each 0.6 MW of energy from the power distributor recharges 1 MJ/s of regeneration - capacitorDrain = (shieldGenerator.getRegenerationRate() * 0.6) - sysRechargeRate; + capacitorDrain = (shieldGenerator.getRegenerationRate() * shieldGenerator.getDistDraw()) - sysRechargeRate; capacitorLifetime = powerDistributor.getSystemsCapacity() / capacitorDrain; let recharge = 0; @@ -424,7 +425,7 @@ export function shieldMetrics(ship, sys) { recharge = Math.Inf; } else { // Recharge remaining shields at the rate of the power distributor's recharge - recharge += remainingShieldToRecharge / (sysRechargeRate / 0.6); + recharge += remainingShieldToRecharge / (sysRechargeRate / shieldGenerator.getDistDraw()); } }