Adding total DPS to outfit page and comparisons

This commit is contained in:
Colin McLeod
2015-06-29 11:57:29 -07:00
parent aa7479d111
commit f1d804e3a1
3 changed files with 19 additions and 1 deletions

View File

@@ -88,6 +88,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
this.totalCost = this.c.incCost ? this.c.discountedCost : 0;
this.unladenMass = this.mass;
this.armourTotal = this.armour;
this.totalDps = 0;
this.bulkheads.c = null;
this.useBulkhead(comps.bulkheads || 0, true);
@@ -258,6 +259,8 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
} else if (slot.c.grp == 'sb') {
this.shieldMultiplier += slot.c.shieldmul * (enabled ? 1 : -1);
this.updateShieldStrength();
} else if (slot.c.dps) {
this.totalDps += slot.c.dps * (enabled ? 1 : -1);
}
this.updatePower();
@@ -308,6 +311,10 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
if (old.power && slot.enabled) {
this.priorityBands[slot.priority][powerUsageType(slot, old)] -= old.power;
powerChange = true;
if (old.dps) {
this.totalDps -= old.dps;
}
}
this.unladenMass -= old.mass || 0;
}
@@ -338,6 +345,10 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength',
if (n.power && slot.enabled) {
this.priorityBands[slot.priority][powerUsageType(slot, n)] += n.power;
powerChange = true;
if (n.dps) {
this.totalDps += n.dps;
}
}
this.unladenMass += n.mass || 0;
}

View File

@@ -163,6 +163,13 @@ angular.module('shipyard', ['ngLodash'])
lbls: ['Unladen', 'Laden'],
unit: 'LY',
fmt: 'fRound'
},
{ // 11
title: 'DPS',
props: ['totalDps'],
lbls: ['Dps'],
unit: '',
fmt: 'fRound'
}
])
/**

View File

@@ -6,7 +6,7 @@
</div>
<div ng-show="processed">
<table class="l" style="overflow:hidden;margin: 1em 0;">
<table class="l" style="overflow:hidden;margin: 1em 0; width: 100%;">
<thead><tr><th>Ship</th><th>Build Name</th><th>Action</th></tr></thead>
<tbody ng-repeat="(shipId,shipBuilds) in builds">
<tr class="cb" ng-repeat="(buildName, b) in shipBuilds">