Separate modification slider in to its own component

This commit is contained in:
Cmdr McDonald
2016-10-31 23:19:22 +00:00
parent 1a0f05511b
commit 258701c377
5 changed files with 84 additions and 55 deletions

View File

@@ -405,8 +405,22 @@ export default class Module {
* @return {Number} the DPS of this module
*/
getDps() {
// TODO this is not correct; need to include other factors such as rate of fire, damage, etc.
return this._getModifiedValue('dps');
// Modifications are not made to DPS directly, but to damage and rate of fire
// Obtain unmodified rate of fire
let rof = this['rof'];
// Obtain unmodified damage
let damage = this['dps'] / rof;
// Obtain modified rate of fire
let modRof = this._getModifiedValue('rof');
// Obtain modified damage
let damageMult = this.getModValue('damage');
let modDamage = damageMult ? damage * (1 + damageMult) : damage;
return modDamage * modRof;
}
/**