Use damage distribution numbers

This commit is contained in:
Cmdr McDonald
2017-01-15 17:10:46 +00:00
parent 1e5f66e528
commit 5bbc6e1cbe
7 changed files with 44 additions and 43 deletions

View File

@@ -650,10 +650,10 @@ export default class Module {
}
/**
* Get the damage type for this module, taking in to account modifications
* @return {string} the damage types for this module; any combination of E T and K
* Get the damage distribution for this module, taking in to account modifications
* @return {string} the damage distribution for this module
*/
getDamageType() {
return this.getModValue('type') || this.type;
getDamageDist() {
return this.getModValue('damagedist') || this.damagedist;
}
}

View File

@@ -954,20 +954,22 @@ export default class Ship {
totalDpe += dpe;
totalDps += dps;
totalSDps += sdps;
if (slot.m.getDamageType().indexOf('E') != -1) {
totalExplDpe += dpe / slot.m.getDamageType().length;
totalExplDps += dps / slot.m.getDamageType().length;
totalExplSDps += sdps / slot.m.getDamageType().length;
}
if (slot.m.getDamageType().indexOf('K') != -1) {
totalKinDpe += dpe / slot.m.getDamageType().length;
totalKinDps += dps / slot.m.getDamageType().length;
totalKinSDps += sdps / slot.m.getDamageType().length;
}
if (slot.m.getDamageType().indexOf('T') != -1) {
totalThermDpe += dpe / slot.m.getDamageType().length;
totalThermDps += dps / slot.m.getDamageType().length;
totalThermSDps += sdps / slot.m.getDamageType().length;
if (slot.m.getDamageDist()) {
if (slot.m.getDamageDist().E) {
totalExplDpe += dpe * slot.m.getDamageDist().E;
totalExplDps += dps * slot.m.getDamageDist().E;
totalExplSDps += sdps * slot.m.getDamageDist().E;
}
if (slot.m.getDamageDist().K) {
totalKinDpe += dpe * slot.m.getDamageDist().K;
totalKinDps += dps * slot.m.getDamageDist().K;
totalKinSDps += sdps * slot.m.getDamageDist().K;
}
if (slot.m.getDamageDist().T) {
totalThermDpe += dpe * slot.m.getDamageDist().T;
totalThermDps += dps * slot.m.getDamageDist().T;
totalThermSDps += sdps * slot.m.getDamageDist().T;
}
}
}
}