From 4e87b3a0b888bfdf536e3de5fed3300066d4b20c Mon Sep 17 00:00:00 2001 From: Felix Linker Date: Mon, 20 Aug 2018 03:44:24 +0200 Subject: [PATCH] Fixed shield proportion calc in defence panel --- src/app/components/Defence.jsx | 14 +++++++------- src/app/shipyard/Calculations.js | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/components/Defence.jsx b/src/app/components/Defence.jsx index 4dbf0dc1..0528c192 100644 --- a/src/app/components/Defence.jsx +++ b/src/app/components/Defence.jsx @@ -102,19 +102,19 @@ export default class Defence extends TranslatedComponent { // Add effective shield from resistances const rawMj = shield.generator + shield.boosters + shield.cells; - const explosiveMj = rawMj / shield.explosive.total - rawMj; + const explosiveMj = rawMj / (shield.explosive.base) - rawMj; if (explosiveMj != 0) effectiveShieldExplosiveTt.push(
{translate('resistance') + ' ' + formats.int(explosiveMj)}{units.MJ}
); - const kineticMj = rawMj / shield.kinetic.total - rawMj; + const kineticMj = rawMj / (shield.kinetic.base) - rawMj; if (kineticMj != 0) effectiveShieldKineticTt.push(
{translate('resistance') + ' ' + formats.int(kineticMj)}{units.MJ}
); - const thermalMj = rawMj / shield.thermal.total - rawMj; + const thermalMj = rawMj / (shield.thermal.base) - rawMj; if (thermalMj != 0) effectiveShieldThermalTt.push(
{translate('resistance') + ' ' + formats.int(thermalMj)}{units.MJ}
); // Add effective shield from power distributor SYS pips if (shield.absolute.sys != 1) { - effectiveShieldAbsoluteTt.push(
{translate('power distributor') + ' ' + formats.int(rawMj / shield.absolute.sys - rawMj)}{units.MJ}
); - effectiveShieldExplosiveTt.push(
{translate('power distributor') + ' ' + formats.int(rawMj / shield.explosive.sys - rawMj)}{units.MJ}
); - effectiveShieldKineticTt.push(
{translate('power distributor') + ' ' + formats.int(rawMj / shield.kinetic.sys - rawMj)}{units.MJ}
); - effectiveShieldThermalTt.push(
{translate('power distributor') + ' ' + formats.int(rawMj / shield.thermal.sys - rawMj)}{units.MJ}
); + effectiveShieldAbsoluteTt.push(
{translate('power distributor') + ' ' + formats.int(rawMj / shield.absolute.total - rawMj)}{units.MJ}
); + effectiveShieldExplosiveTt.push(
{translate('power distributor') + ' ' + formats.int(rawMj / shield.explosive.total - rawMj / shield.explosive.base)}{units.MJ}
); + effectiveShieldKineticTt.push(
{translate('power distributor') + ' ' + formats.int(rawMj / shield.kinetic.total - rawMj / shield.kinetic.base)}{units.MJ}
); + effectiveShieldThermalTt.push(
{translate('power distributor') + ' ' + formats.int(rawMj / shield.thermal.total - rawMj / shield.thermal.base)}{units.MJ}
); } } diff --git a/src/app/shipyard/Calculations.js b/src/app/shipyard/Calculations.js index 867f8d8b..467d67b8 100644 --- a/src/app/shipyard/Calculations.js +++ b/src/app/shipyard/Calculations.js @@ -486,6 +486,7 @@ export function shieldMetrics(ship, sys) { generator: sgExplosiveDmg, boosters: sgSbExplosiveDmg - sgExplosiveDmg, sys: (1 - sysResistance), + base: sgSbExplosiveDmg, total: sgSbExplosiveDmg * (1 - sysResistance), max: sgSbExplosiveDmg * (1 - maxSysResistance), }; @@ -496,6 +497,7 @@ export function shieldMetrics(ship, sys) { generator: sgKineticDmg, boosters: sgSbKineticDmg - sgKineticDmg, sys: (1 - sysResistance), + base: sgSbKineticDmg, total: sgSbKineticDmg * (1 - sysResistance), max: sgSbKineticDmg * (1 - maxSysResistance), }; @@ -506,6 +508,7 @@ export function shieldMetrics(ship, sys) { generator: sgThermalDmg, boosters: sgSbThermalDmg - sgThermalDmg, sys: (1 - sysResistance), + base: sgSbThermalDmg, total: sgSbThermalDmg * (1 - sysResistance), max: sgSbThermalDmg * (1 - maxSysResistance), };