Allow to retrieve unmodded vals from module

This commit is contained in:
felixlinker
2018-09-05 17:58:16 +02:00
parent b419b8b104
commit 9fba1be814

View File

@@ -119,6 +119,20 @@ export default class Module {
} }
} }
/**
* Helper to obtain a module's value.
* @param {String} name The name of the modifier to obtain
* @param {Number} modified Whether to return the raw or modified value
* @return {Number} The value queried
*/
_getValue(name, modified) {
if (modified) {
return this._getModifiedValue(name);
} else {
return this[name];
}
}
/** /**
* Helper to obtain a modified value using standard multipliers * Helper to obtain a modified value using standard multipliers
* @param {String} name the name of the modifier to obtain * @param {String} name the name of the modifier to obtain
@@ -174,160 +188,190 @@ export default class Module {
} }
/** /**
* Get the power generation of this module, taking in to account modifications * Get the power generation of this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the power generation of this module * @return {Number} the power generation of this module
*/ */
getPowerGeneration() { getPowerGeneration(modified = true) {
return this._getModifiedValue('pgen'); return this._getValue('pgen', modified);
} }
/** /**
* Get the power usage of this module, taking in to account modifications * Get the power usage of this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the power usage of this module * @return {Number} the power usage of this module
*/ */
getPowerUsage() { getPowerUsage(modified = true) {
return this._getModifiedValue('power'); return this._getValue('power', modified);
} }
/** /**
* Get the integrity of this module, taking in to account modifications * Get the integrity of this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the integrity of this module * @return {Number} the integrity of this module
*/ */
getIntegrity() { getIntegrity(modified = true) {
return this._getModifiedValue('integrity'); return this._getValue('integrity', modified);
} }
/** /**
* Get the mass of this module, taking in to account modifications * Get the mass of this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the mass of this module * @return {Number} the mass of this module
*/ */
getMass() { getMass(modified = true) {
return this._getModifiedValue('mass'); return this._getValue('mass', modified);
} }
/** /**
* Get the thermal efficiency of this module, taking in to account modifications * Get the thermal efficiency of this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the thermal efficiency of this module * @return {Number} the thermal efficiency of this module
*/ */
getThermalEfficiency() { getThermalEfficiency(modified = true) {
return this._getModifiedValue('eff'); return this._getValue('eff', modified);
} }
/** /**
* Get the maximum fuel per jump for this module, taking in to account modifications * Get the maximum fuel per jump for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the maximum fuel per jump of this module * @return {Number} the maximum fuel per jump of this module
*/ */
getMaxFuelPerJump() { getMaxFuelPerJump(modified = true) {
return this._getModifiedValue('maxfuel'); return this._getValue('maxfuel', modified);
} }
/** /**
* Get the systems capacity for this module, taking in to account modifications * Get the systems capacity for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the systems capacity of this module * @return {Number} the systems capacity of this module
*/ */
getSystemsCapacity() { getSystemsCapacity(modified = true) {
return this._getModifiedValue('syscap'); return this._getValue('syscap', modified);
} }
/** /**
* Get the engines capacity for this module, taking in to account modifications * Get the engines capacity for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the engines capacity of this module * @return {Number} the engines capacity of this module
*/ */
getEnginesCapacity() { getEnginesCapacity(modified = true) {
return this._getModifiedValue('engcap'); return this._getValue('engcap', modified);
} }
/** /**
* Get the weapons capacity for this module, taking in to account modifications * Get the weapons capacity for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the weapons capacity of this module * @return {Number} the weapons capacity of this module
*/ */
getWeaponsCapacity() { getWeaponsCapacity(modified = true) {
return this._getModifiedValue('wepcap'); return this._getValue('wepcap', modified);
} }
/** /**
* Get the systems recharge rate for this module, taking in to account modifications * Get the systems recharge rate for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the systems recharge rate of this module * @return {Number} the systems recharge rate of this module
*/ */
getSystemsRechargeRate() { getSystemsRechargeRate(modified = true) {
return this._getModifiedValue('sysrate'); return this._getValue('sysrate', modified);
} }
/** /**
* Get the engines recharge rate for this module, taking in to account modifications * Get the engines recharge rate for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the engines recharge rate of this module * @return {Number} the engines recharge rate of this module
*/ */
getEnginesRechargeRate() { getEnginesRechargeRate(modified = true) {
return this._getModifiedValue('engrate'); return this._getValue('engrate', modified);
} }
/** /**
* Get the weapons recharge rate for this module, taking in to account modifications * Get the weapons recharge rate for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the weapons recharge rate of this module * @return {Number} the weapons recharge rate of this module
*/ */
getWeaponsRechargeRate() { getWeaponsRechargeRate(modified = true) {
return this._getModifiedValue('weprate'); return this._getValue('weprate', modified);
} }
/** /**
* Get the kinetic resistance for this module, taking in to account modifications * Get the kinetic resistance for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the kinetic resistance of this module * @return {Number} the kinetic resistance of this module
*/ */
getKineticResistance() { getKineticResistance(modified = true) {
return this._getModifiedValue('kinres'); return this._getValue('kinres', modified);
} }
/** /**
* Get the thermal resistance for this module, taking in to account modifications * Get the thermal resistance for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the thermal resistance of this module * @return {Number} the thermal resistance of this module
*/ */
getThermalResistance() { getThermalResistance(modified = true) {
return this._getModifiedValue('thermres'); return this._getValue('thermres', modified);
} }
/** /**
* Get the explosive resistance for this module, taking in to account modifications * Get the explosive resistance for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the explosive resistance of this module * @return {Number} the explosive resistance of this module
*/ */
getExplosiveResistance() { getExplosiveResistance(modified = true) {
return this._getModifiedValue('explres'); return this._getValue('explres', modified);
}
getCausticResistance() {
return this._getModifiedValue('causres');
} }
/** /**
* Get the regeneration rate for this module, taking in to account modifications * Get the caustic resistance for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the caustic resistance of this module
*/
getCausticResistance(modified = true) {
return this._getValue('causres', modified);
}
/**
* Get the regeneration rate for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the regeneration rate of this module * @return {Number} the regeneration rate of this module
*/ */
getRegenerationRate() { getRegenerationRate(modified = true) {
return this._getModifiedValue('regen'); return this._getValue('regen', modified);
} }
/** /**
* Get the broken regeneration rate for this module, taking in to account modifications * Get the broken regeneration rate for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the broken regeneration rate of this module * @return {Number} the broken regeneration rate of this module
*/ */
getBrokenRegenerationRate() { getBrokenRegenerationRate(modified = true) {
return this._getModifiedValue('brokenregen'); return this._getValue('brokenregen', modified);
} }
/** /**
* Get the range for this module, taking in to account modifications * Get the range for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the range rate of this module * @return {Number} the range rate of this module
*/ */
getRange() { getRange(modified = true) {
return this._getModifiedValue('range'); return this._getValue('range', modified);
} }
/** /**
* Get the falloff for this module, taking in to account modifications * Get the falloff for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the falloff of this module * @return {Number} the falloff of this module
*/ */
getFalloff() { getFalloff(modified = true) {
if (this.getModValue('fallofffromrange')) { if (!modified) {
// Falloff from range means what it says, so use range instead of falloff const range = this.getRange(false);
const falloff = this._getValue('falloff', false);
return (falloff > range ? range : falloff);
}
// Falloff from range is mapped to range
if (this.mods['fallofffromrange']) {
return this.getRange(); return this.getRange();
} else { } else {
// Need to find out if we have a focused modification, in which case our falloff is scaled to range // Need to find out if we have a focused modification, in which case our falloff is scaled to range
@@ -344,79 +388,88 @@ export default class Module {
} }
/** /**
* Get the range (in terms of seconds, for FSDI) for this module, taking in to account modifications * Get the range (in terms of seconds, for FSDI) for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the range of this module * @return {Number} the range of this module
*/ */
getRangeT() { getRangeT(modified = true) {
return this._getModifiedValue('ranget'); return this._getValue('ranget', modified);
} }
/** /**
* Get the scan time for this module, taking in to account modifications * Get the scan time for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the scan time of this module * @return {Number} the scan time of this module
*/ */
getScanTime() { getScanTime(modified = true) {
return this._getModifiedValue('scantime'); return this._getValue('scantime', modified);
} }
/** /**
* Get the capture arc for this module, taking in to account modifications * Get the capture arc for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the capture arc of this module * @return {Number} the capture arc of this module
*/ */
getCaptureArc() { getCaptureArc(modified = true) {
return this._getModifiedValue('arc'); return this._getValue('arc', modified);
} }
/** /**
* Get the hull reinforcement for this module, taking in to account modifications * Get the hull reinforcement for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the hull reinforcement of this module * @return {Number} the hull reinforcement of this module
*/ */
getHullReinforcement() { getHullReinforcement(modified = true) {
return this._getModifiedValue('hullreinforcement'); return this._getValue('hullreinforcement', modified);
} }
/** /**
* Get the protection for this module, taking in to account modifications * Get the protection for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the protection of this module * @return {Number} the protection of this module
*/ */
getProtection() { getProtection(modified = true) {
return this._getModifiedValue('protection'); return this._getValue('protection', modified);
} }
/** /**
* Get the delay for this module, taking in to account modifications * Get the delay for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the delay of this module * @return {Number} the delay of this module
*/ */
getDelay() { getDelay(modified = true) {
return this._getModifiedValue('delay'); return this._getValue('delay', modified);
} }
/** /**
* Get the duration for this module, taking in to account modifications * Get the duration for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the duration of this module * @return {Number} the duration of this module
*/ */
getDuration() { getDuration(modified = true) {
return this._getModifiedValue('duration'); return this._getValue('duration', modified);
} }
/** /**
* Get the shield boost for this module, taking in to account modifications * Get the shield boost for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the shield boost of this module * @return {Number} the shield boost of this module
*/ */
getShieldBoost() { getShieldBoost(modified = true) {
return this._getModifiedValue('shieldboost'); return this._getValue('shieldboost', modified);
} }
/** /**
* Get the minimum mass for this module, taking in to account modifications * Get the minimum mass for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the minimum mass of this module * @return {Number} the minimum mass of this module
*/ */
getMinMass() { getMinMass(modified = true) {
// Modifier is optmass // Modifier is optmass
let result = 0; let result = 0;
if (this['minmass']) { if (this['minmass']) {
result = this['minmass']; result = this['minmass'];
if (result) { if (result && modified) {
let mult = this.getModValue('optmass') / 10000; let mult = this.getModValue('optmass') / 10000;
if (mult) { result = result * (1 + mult); } if (mult) { result = result * (1 + mult); }
} }
@@ -425,23 +478,25 @@ export default class Module {
} }
/** /**
* Get the optimum mass for this module, taking in to account modifications * Get the optimum mass for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the optimum mass of this module * @return {Number} the optimum mass of this module
*/ */
getOptMass() { getOptMass(modified = true) {
return this._getModifiedValue('optmass'); return this._getValue('optmass', modified);
} }
/** /**
* Get the maximum mass for this module, taking in to account modifications * Get the maximum mass for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the maximum mass of this module * @return {Number} the maximum mass of this module
*/ */
getMaxMass() { getMaxMass(modified = true) {
// Modifier is optmass // Modifier is optmass
let result = 0; let result = 0;
if (this['maxmass']) { if (this['maxmass']) {
result = this['maxmass']; result = this['maxmass'];
if (result) { if (result && modified) {
let mult = this.getModValue('optmass') / 10000; let mult = this.getModValue('optmass') / 10000;
if (mult) { result = result * (1 + mult); } if (mult) { result = result * (1 + mult); }
} }
@@ -450,11 +505,12 @@ export default class Module {
} }
/** /**
* Get the minimum multiplier for this module, taking in to account modifications * Get the minimum multiplier for this module
* @param {string} type the type for which we are obtaining the multiplier. Can be 'speed', 'rotation', 'acceleration', or null * @param {string} type the type for which we are obtaining the multiplier. Can be 'speed', 'rotation', 'acceleration', or null
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the minimum multiplier of this module * @return {Number} the minimum multiplier of this module
*/ */
getMinMul(type = null) { getMinMul(type = null, modified = true) {
// Modifier is optmul // Modifier is optmul
let result = 0; let result = 0;
if (this['minmul' + type]) { if (this['minmul' + type]) {
@@ -462,7 +518,7 @@ export default class Module {
} else if (this['minmul']) { } else if (this['minmul']) {
result = this['minmul']; result = this['minmul'];
} }
if (result) { if (result && modified) {
let mult = this.getModValue('optmul') / 10000; let mult = this.getModValue('optmul') / 10000;
if (mult) { result = result * (1 + mult); } if (mult) { result = result * (1 + mult); }
} }
@@ -470,11 +526,12 @@ export default class Module {
} }
/** /**
* Get the optimum multiplier for this module, taking in to account modifications * Get the optimum multiplier for this module
* @param {string} type the type for which we are obtaining the multiplier. Can be 'speed', 'rotation', 'acceleration', or null * @param {string} type the type for which we are obtaining the multiplier. Can be 'speed', 'rotation', 'acceleration', or null
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the optimum multiplier of this module * @return {Number} the optimum multiplier of this module
*/ */
getOptMul(type = null) { getOptMul(type = null, modified = true) {
// Modifier is optmul // Modifier is optmul
let result = 0; let result = 0;
if (this['optmul' + type]) { if (this['optmul' + type]) {
@@ -482,7 +539,7 @@ export default class Module {
} else if (this['optmul']) { } else if (this['optmul']) {
result = this['optmul']; result = this['optmul'];
} }
if (result) { if (result && modified) {
let mult = this.getModValue('optmul') / 10000; let mult = this.getModValue('optmul') / 10000;
if (mult) { result = result * (1 + mult); } if (mult) { result = result * (1 + mult); }
} }
@@ -490,11 +547,12 @@ export default class Module {
} }
/** /**
* Get the maximum multiplier for this module, taking in to account modifications * Get the maximum multiplier for this module
* @param {string} type the type for which we are obtaining the multiplier. Can be 'speed', 'rotation', 'acceleration', or null * @param {string} type the type for which we are obtaining the multiplier. Can be 'speed', 'rotation', 'acceleration', or null
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the maximum multiplier of this module * @return {Number} the maximum multiplier of this module
*/ */
getMaxMul(type = null) { getMaxMul(type = null, modified = true) {
// Modifier is optmul // Modifier is optmul
let result = 0; let result = 0;
if (this['maxmul' + type]) { if (this['maxmul' + type]) {
@@ -502,7 +560,7 @@ export default class Module {
} else if (this['maxmul']) { } else if (this['maxmul']) {
result = this['maxmul']; result = this['maxmul'];
} }
if (result) { if (result && modified) {
let mult = this.getModValue('optmul') / 10000; let mult = this.getModValue('optmul') / 10000;
if (mult) { result = result * (1 + mult); } if (mult) { result = result * (1 + mult); }
} }
@@ -510,266 +568,294 @@ export default class Module {
} }
/** /**
* Get the damage for this module, taking in to account modifications * Get the damage for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the damage of this module * @return {Number} the damage of this module
*/ */
getDamage() { getDamage(modified = true) {
return this._getModifiedValue('damage'); return this._getValue('damage', modified);
} }
/** /**
* Get the distributor draw for this module, taking in to account modifications * Get the distributor draw for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the distributor draw of this module * @return {Number} the distributor draw of this module
*/ */
getDistDraw() { getDistDraw(modified = true) {
return this._getModifiedValue('distdraw'); return this._getValue('distdraw', modified);
} }
/** /**
* Get the thermal load for this module, taking in to account modifications * 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 * @return {Number} the thermal load of this module
*/ */
getThermalLoad() { getThermalLoad(modified = true) {
return this._getModifiedValue('thermload'); return this._getValue('thermload', modified);
} }
/** /**
* Get the rounds per shot for this module, taking in to account modifications * 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 * @return {Number} the rounds per shot of this module
*/ */
getRoundsPerShot() { getRoundsPerShot(modified = true) {
return this._getModifiedValue('roundspershot'); return this._getValue('roundspershot', modified);
} }
/** /**
* Get the DPS for this module, taking in to account modifications * Get the DPS for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the DPS of this module * @return {Number} the DPS of this module
*/ */
getDps() { getDps(modified = true) {
// DPS is a synthetic value // DPS is a synthetic value
let damage = this.getDamage(); let damage = this.getDamage(modified);
let rpshot = this.roundspershot || 1; let rpshot = this.roundspershot || 1;
let rof = this.getRoF() || 1; let rof = this.getRoF(modified) || 1;
return damage * rpshot * rof; return damage * rpshot * rof;
} }
/** /**
* Get the SDPS for this module, taking into account modifications and special /**
* effects. * Get the SDPS for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} The SDPS of this module * @return {Number} The SDPS of this module
*/ */
getSDps() { getSDps(modified = true) {
let dps = this.getDps(); let dps = this.getDps(modified);
if (this.getClip()) { if (this.getClip(modified)) {
let clipSize = this.getClip(); let clipSize = this.getClip(modified);
// If auto-loader is applied, effective clip size will be nearly doubled // If auto-loader is applied, effective clip size will be nearly doubled
// as you get one reload for every two shots fired. // as you get one reload for every two shots fired.
if (this.blueprint && this.blueprint.special && this.blueprint.special.edname === 'special_auto_loader') { if (this.blueprint && this.blueprint.special && this.blueprint.special.edname === 'special_auto_loader' && modified) {
clipSize += clipSize - 1; clipSize += clipSize - 1;
} }
let timeToDeplete = clipSize / this.getRoF(); let timeToDeplete = clipSize / this.getRoF(modified);
return dps * timeToDeplete / (timeToDeplete + this.getReload()); return dps * timeToDeplete / (timeToDeplete + this.getReload(modified));
} else { } else {
return dps; return dps;
} }
} }
/** /**
* Get the EPS for this module, taking in to account modifications * Get the EPS for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the EPS of this module * @return {Number} the EPS of this module
*/ */
getEps() { getEps(modified = true) {
// EPS is a synthetic value // EPS is a synthetic value
let distdraw = this.getDistDraw(); let distdraw = this.getDistDraw(modified);
// We don't use rpshot here as dist draw is per combined shot // We don't use rpshot here as dist draw is per combined shot
let rof = this.getRoF() || 1; let rof = this.getRoF(modified) || 1;
return distdraw * rof; return distdraw * rof;
} }
/** /**
* Get the HPS for this module, taking in to account modifications * Get the HPS for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the HPS of this module * @return {Number} the HPS of this module
*/ */
getHps() { getHps(modified = true) {
// HPS is a synthetic value // HPS is a synthetic value
let heat = this.getThermalLoad(); let heat = this.getThermalLoad(modified);
// We don't use rpshot here as dist draw is per combined shot // We don't use rpshot here as dist draw is per combined shot
let rof = this.getRoF() || 1; let rof = this.getRoF(modified) || 1;
return heat * rof; return heat * rof;
} }
/** /**
* Get the clip size for this module, taking in to account modifications * Get the clip size for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the clip size of this module * @return {Number} the clip size of this module
*/ */
getClip() { getClip(modified = true) {
// Clip size is always rounded up // Clip size is always rounded up
let result = this._getModifiedValue('clip'); let result = this._getValue('clip', modified);
if (result) { result = Math.ceil(result); } if (result) { result = Math.ceil(result); }
return result; return result;
} }
/** /**
* Get the ammo size for this module, taking in to account modifications * Get the ammo size for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the ammo size of this module * @return {Number} the ammo size of this module
*/ */
getAmmo() { getAmmo(modified = true) {
return this._getModifiedValue('ammo'); return this._getValue('ammo', modified);
} }
/** /**
* Get the reload time for this module, taking in to account modifications * Get the reload time for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the reload time of this module * @return {Number} the reload time of this module
*/ */
getReload() { getReload(modified = true) {
return this._getModifiedValue('reload'); return this._getValue('reload', modified);
} }
/** /**
* Get the burst size for this module, taking in to account modifications * 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 * @return {Number} the burst size of this module
*/ */
getBurst() { getBurst(modified = true) {
return this._getModifiedValue('burst'); return this._getValue('burst', modified);
} }
/** /**
* Get the burst rate of fire for this module, taking in to account modifications * 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 * @return {Number} the burst rate of fire of this module
*/ */
getBurstRoF() { getBurstRoF(modified = true) {
return this._getModifiedValue('burstrof'); return this._getValue('burstrof', modified);
} }
/** /**
* Get the rate of fire for this module, taking in to account modifications. * Get the rate of fire for this module.
* The rate of fire is a combination value, and needs to take in to account * The rate of fire is a combination value, and needs to take in to account
* bursts of fire. * bursts of fire.
* Firing goes [burst 1] [burst interval] [burst 2] [burst interval] ... [burst n] [interval] * Firing goes [burst 1] [burst interval] [burst 2] [burst interval] ... [burst n] [interval]
* where 'n' is 'burst', 'burst interval' is '1/burstrof' and 'interval' is '1/rof' * where 'n' is 'burst', 'burst interval' is '1/burstrof' and 'interval' is '1/rof'
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the rate of fire for this module * @return {Number} the rate of fire for this module
*/ */
getRoF() { getRoF(modified = true) {
const burst = this.getBurst() || 1; const burst = this.getBurst(modified) || 1;
const burstRoF = this.getBurstRoF() || 1; const burstRoF = this.getBurstRoF(modified) || 1;
const intRoF = this._getModifiedValue('rof'); const intRoF = this._getValue('rof', modified);
return burst / (((burst - 1) / burstRoF) + 1 / intRoF); return burst / (((burst - 1) / burstRoF) + 1 / intRoF);
} }
/** /**
* Get the facing limit for this module, taking in to account modifications * Get the facing limit for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the facing limit for this module * @return {Number} the facing limit for this module
*/ */
getFacingLimit() { getFacingLimit(modified = true) {
return this._getModifiedValue('facinglimit'); return this._getValue('facinglimit', modified);
} }
/** /**
* Get the hull boost for this module, taking in to account modifications * Get the hull boost for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the hull boost for this module * @return {Number} the hull boost for this module
*/ */
getHullBoost() { getHullBoost(modified = true) {
return this._getModifiedValue('hullboost'); return this._getValue('hullboost', modified);
} }
/** /**
* Get the shield reinforcement for this module, taking in to account modifications * Get the shield reinforcement for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the shield reinforcement for this module * @return {Number} the shield reinforcement for this module
*/ */
getShieldReinforcement() { getShieldReinforcement(modified = true) {
return this._getModifiedValue('shieldreinforcement'); return this._getValue('shieldreinforcement', modified);
} }
/** /**
* Get the shield addition for this module, taking in to account modifications * Get the shield addition for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the shield addition for this module * @return {Number} the shield addition for this module
*/ */
getShieldAddition() { getShieldAddition(modified = true) {
return this._getModifiedValue('shieldaddition'); return this._getValue('shieldaddition', modified);
} }
/** /**
* Get the jump range boost for this module, taking in to account modifications * Get the jump range boost for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the jump range boost for this module * @return {Number} the jump range boost for this module
*/ */
getJumpBoost() { getJumpBoost(modified = true) {
return this._getModifiedValue('jumpboost'); return this._getValue('jumpboost', modified);
} }
/** /**
* Get the piercing for this module, taking in to account modifications * Get the piercing for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the piercing for this module * @return {Number} the piercing for this module
*/ */
getPiercing() { getPiercing(modified = true) {
return this._getModifiedValue('piercing'); return this._getValue('piercing', modified);
} }
/** /**
* Get the bays for this module, taking in to account modifications * Get the bays for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the bays for this module * @return {Number} the bays for this module
*/ */
getBays() { getBays(modified) {
return this._getModifiedValue('bays'); return this._getValue('bays', modified);
} }
/** /**
* Get the rebuilds per bay for this module, taking in to account modifications * Get the rebuilds per bay for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the rebuilds per bay for this module * @return {Number} the rebuilds per bay for this module
*/ */
getRebuildsPerBay() { getRebuildsPerBay(modified = true) {
return this._getModifiedValue('rebuildsperbay'); return this._getValue('rebuildsperbay', modified);
} }
/** /**
* Get the jitter for this module, taking in to account modifications * Get the jitter for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {Number} the jitter for this module * @return {Number} the jitter for this module
*/ */
getJitter() { getJitter(modified = true) {
return this._getModifiedValue('jitter', true); return this._getValue('jitter', modified);
} }
/** /**
* Get the damage distribution for this module, taking in to account modifications * Get the damage distribution for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {string} the damage distribution for this module * @return {string} the damage distribution for this module
*/ */
getDamageDist() { getDamageDist(modified = true) {
return this.getModValue('damagedist') || this.damagedist; return (modified && this.getModValue('damagedist')) || this.damagedist;
} }
/** /**
* Get the shot speed for this module, taking in to account modifications * Get the shot speed for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {string} the shot speed for this module * @return {string} the shot speed for this module
*/ */
getShotSpeed() { getShotSpeed(modified = true) {
return this._getModifiedValue('shotspeed'); return this._getValue('shotspeed', modified);
} }
/** /**
* Get the spinup for this module, taking in to account modifications * Get the spinup for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {string} the spinup for this module * @return {string} the spinup for this module
*/ */
getSpinup() { getSpinup(modified = true) {
return this._getModifiedValue('spinup'); return this._getValue('spinup', modified);
} }
/** /**
* Get the time for this module, taking in to account modifications * Get the time for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {string} the time for this module * @return {string} the time for this module
*/ */
getTime() { getTime(modified = true) {
return this._getModifiedValue('time'); return this._getValue('time', modified);
} }
/** /**
* Get the hack time for this module, taking in to account modifications * Get the hack time for this module
* @param {Boolean} [modified=true] Whether to take modifications into account
* @return {string} the time for this module * @return {string} the time for this module
*/ */
getHackTime() { getHackTime(modified = true) {
return this._getModifiedValue('hacktime'); return this._getValue('hacktime', modified);
} }
} }