From 32498bb8a78ff932a931abb99fdd682f34bf91d4 Mon Sep 17 00:00:00 2001 From: willyb321 Date: Tue, 12 Jun 2018 11:32:37 +1000 Subject: [PATCH] properly fix super cap --- src/app/shipyard/Calculations.js | 16 ++-------------- src/app/shipyard/Ship.js | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/app/shipyard/Calculations.js b/src/app/shipyard/Calculations.js index fe1574e6..e32833f4 100644 --- a/src/app/shipyard/Calculations.js +++ b/src/app/shipyard/Calculations.js @@ -45,10 +45,9 @@ export function totalJumpRange(mass, fsd, fuel) { * @param {number} baseShield Base Shield strength MJ for ship * @param {object} sg The shield generator used * @param {number} multiplier Shield multiplier for ship (1 + shield boosters if any) - * @param {Object} ship The ship object * @return {number} Approximate shield strengh in MJ */ -export function shieldStrength(mass, baseShield, sg, multiplier, ship) { +export function shieldStrength(mass, baseShield, sg, multiplier) { // sg might be a module or a template; handle either here let minMass = sg instanceof Module ? sg.getMinMass() : sg.minmass; let optMass = sg instanceof Module ? sg.getOptMass() : sg.optmass; @@ -56,17 +55,6 @@ export function shieldStrength(mass, baseShield, sg, multiplier, ship) { let minMul = sg instanceof Module ? sg.getMinMul() : sg.minmul; let optMul = sg instanceof Module ? sg.getOptMul() : sg.optmul; let maxMul = sg instanceof Module ? sg.getMaxMul() : sg.maxmul; - if (ship) { - for (const i of ship.hardpoints) { - if (!i.maxClass) { - if (i.grp === 'sb' || (i.m && i.m.grp === 'sb')) { - if (!isNaN(i.m.getModValue('optmul'))) { - optMul += i.m.getModValue('optmul') / 10000; - } - } - } - } - } let xnorm = Math.min(1, (maxMass - mass) / (maxMass - minMass)); let exponent = Math.log((optMul - minMul) / (maxMul - minMul)) / Math.log(Math.min(1, (maxMass - optMass) / (maxMass - minMass))); let ynorm = Math.pow(xnorm, exponent); @@ -362,7 +350,7 @@ export function shieldMetrics(ship, sys) { boosterKinDmg = boosterKinDmg > 0.7 ? boosterKinDmg : 0.7 - (0.7 - boosterKinDmg) / 2; boosterThermDmg = boosterThermDmg > 0.7 ? boosterThermDmg : 0.7 - (0.7 - boosterThermDmg) / 2; - const generatorStrength = this.shieldStrength(ship.hullMass, ship.baseShieldStrength, shieldGenerator, 1, ship); + const generatorStrength = this.shieldStrength(ship.hullMass, ship.baseShieldStrength, shieldGenerator, 1); const boostersStrength = generatorStrength * boost; // Recover time is the time taken to go from 0 to 50%. It includes a 16-second wait before shields start to recover diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 579aca0c..3e81877e 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -241,7 +241,7 @@ export default class Ship { } // TODO Not accurate if the ship has modified shield boosters - return Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sg, 1 + (multiplierDelta || 0), this); + return Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sg, 1 + (multiplierDelta || 0)); } /**