diff --git a/src/app/Router.js b/src/app/Router.js index 3e7f19e1..37bd2305 100644 --- a/src/app/Router.js +++ b/src/app/Router.js @@ -269,6 +269,8 @@ function gaTrack(path) { } } ReactGA.pageview(path); + const _paq = window._paq || []; + _paq.push(['trackPageView']); } /** diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index cb37a9a7..8efd1bb4 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -639,15 +639,6 @@ export default class Module { return this.get('protection', modified); } - /** - * Get the delay for this module - * @param {Boolean} [modified=true] Whether to take modifications into account - * @return {Number} the delay of this module - */ - getDelay(modified = true) { - return this.get('delay', modified); - } - /** * Get the duration for this module * @param {Boolean} [modified=true] Whether to take modifications into account @@ -792,24 +783,6 @@ export default class Module { return this.get('distdraw', modified); } - /** - * Get the thermal load for this module - * @param {Boolean} [modified=true] Whether to take modifications into account - * @return {Number} the thermal load of this module - */ - getThermalLoad(modified = true) { - return this.get('thermload', modified); - } - - /** - * Get the rounds per shot for this module - * @param {Boolean} [modified=true] Whether to take modifications into account - * @return {Number} the rounds per shot of this module - */ - getRoundsPerShot(modified = true) { - return this.get('roundspershot', modified); - } - /** * Get the DPS for this module * @param {Boolean} [modified=true] Whether to take modifications into account @@ -875,7 +848,7 @@ export default class Module { */ getHps(modified = true) { // HPS is a synthetic value - let heat = this.getThermalLoad(modified); + let heat = this.get('thermload', modified); // We don't use rpshot here as dist draw is per combined shot let rof = this.getRoF(modified) || 1; @@ -912,24 +885,6 @@ export default class Module { return this.get('reload', modified); } - /** - * Get the burst size for this module - * @param {Boolean} [modified=true] Whether to take modifications into account - * @return {Number} the burst size of this module - */ - getBurst(modified = true) { - return this.get('burst', modified); - } - - /** - * Get the burst rate of fire for this module - * @param {Boolean} [modified=true] Whether to take modifications into account - * @return {Number} the burst rate of fire of this module - */ - getBurstRoF(modified = true) { - return this.get('burstrof', modified); - } - /** * Get the rate of fire for this module. * The rate of fire is a combination value, and needs to take in to account @@ -940,8 +895,8 @@ export default class Module { * @return {Number} the rate of fire for this module */ getRoF(modified = true) { - const burst = this.getBurst(modified) || 1; - const burstRoF = this.getBurstRoF(modified) || 1; + const burst = this.get('burst', modified) || 1; + const burstRoF = this.get('burstrof', modified) || 1; const intRoF = this.get('rof', modified); return burst / (((burst - 1) / burstRoF) + 1 / intRoF); diff --git a/src/app/utils/BlueprintFunctions.js b/src/app/utils/BlueprintFunctions.js index 2c38449d..93f26a14 100644 --- a/src/app/utils/BlueprintFunctions.js +++ b/src/app/utils/BlueprintFunctions.js @@ -372,9 +372,7 @@ export function getPercent(m) { let value = _getValue(m, featureName); let mult; - if (featureName == 'shieldboost') { - mult = ((1 + value) * (1 + m.shieldboost)) - 1 - m.shieldboost; - } else if (Modifications.modifications[featureName].higherbetter) { + if (Modifications.modifications[featureName].higherbetter) { // Higher is better, but is this making it better or worse? if (features[featureName][0] < 0 || (features[featureName][0] === 0 && features[featureName][1] < 0)) { mult = Math.round((value - features[featureName][1]) / (features[featureName][0] - features[featureName][1]) * 100); diff --git a/src/app/utils/SlotFunctions.js b/src/app/utils/SlotFunctions.js index 6c3245ff..8a969f3b 100644 --- a/src/app/utils/SlotFunctions.js +++ b/src/app/utils/SlotFunctions.js @@ -1,6 +1,7 @@ import React from 'react'; import Persist from '../stores/Persist'; import * as ModuleUtils from '../shipyard/ModuleUtils'; +import Module from '../shipyard/Module'; /** * Determine if a slot on a ship can mount a module of a particular class and group @@ -139,20 +140,21 @@ function diff(format, mVal, mmVal) { export function diffDetails(language, m, mm) { let { formats, translate, units } = language; let propDiffs = []; + m = new Module(m); // Module-specific items if (m.grp === 'pp') { - let mPowerGeneration = m.pgen || 0; + let mPowerGeneration = m.getPowerGeneration() || 0; let mmPowerGeneration = mm ? mm.getPowerGeneration() : 0; if (mPowerGeneration != mmPowerGeneration) propDiffs.push(