diff --git a/ChangeLog.md b/ChangeLog.md index 2cf6c679..8fb6b19f 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,6 @@ +#2.2.5 + * Calculate rate of fire for multi-burst weapons + #2.2.4 * Add shortlink for outfitting page * Use coriolis-data 2.2.4: diff --git a/__tests__/fixtures/anaconda-test-detailed-export-v4.json b/__tests__/fixtures/anaconda-test-detailed-export-v4.json index 4bda3ad3..c925f052 100644 --- a/__tests__/fixtures/anaconda-test-detailed-export-v4.json +++ b/__tests__/fixtures/anaconda-test-detailed-export-v4.json @@ -271,7 +271,7 @@ "totalExplDpe": 0, "totalExplDps": 0, "totalExplSDps": 0, - "totalHps": 33.28, + "totalHps": 33.62, "totalKinDpe": 103.97, "totalKinDps": 28.92, "totalKinSDps": 21.23, diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index 6e8533da..72a1ec1f 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -482,11 +482,34 @@ export default class Module { } /** - * Get the rate of fire for this module, taking in to account modifications + * Get the burst size for this module, taking in to account modifications + * @return {Number} the burst size of this module + */ + getBurst() { + return this._getModifiedValue('burst'); + } + + /** + * Get the burst rate of fire for this module, taking in to account modifications + * @return {Number} the burst rate of fire of this module + */ + getBurstRoF() { + return this._getModifiedValue('burstrof'); + } + + /** + * Get the rate of fire for this module, taking in to account modifications. + * The rate of fire is a combination value, and needs to take in to account + * bursts of fire. + * 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' * @return {Number} the rate of fire for this module */ getRoF() { - return this._getModifiedValue('rof'); + const burst = this.getBurst() || 1; + const burstRoF = this.getBurstRoF() || 1; + const intRoF = this._getModifiedValue('rof'); + return burst / (((burst - 1)/burstRoF) + 1/intRoF); } /**