Update costs for reload

This commit is contained in:
Cmdr McDonald
2016-11-15 13:33:59 +00:00
parent d6f213fbe7
commit 930a555425
2 changed files with 35 additions and 6 deletions

View File

@@ -507,19 +507,19 @@ export default class CostSection extends TranslatedComponent {
scoop = true; scoop = true;
break; break;
case 'scb': case 'scb':
q = slotGroup[i].m.cells; q = slotGroup[i].m.getCells();
break; break;
case 'am': case 'am':
q = slotGroup[i].m.ammo; q = slotGroup[i].m.getAmmo();
break; break;
case 'pv': case 'pv':
srvs += slotGroup[i].m.vehicles; srvs += slotGroup[i].m.getBays();
break; break;
case 'fx': case 'hb': case 'cc': case 'pc': case 'fx': case 'hb': case 'cc': case 'pc':
limpets = ship.cargoCapacity; limpets = ship.cargoCapacity;
break; break;
default: default:
q = slotGroup[i].m.clip + slotGroup[i].m.ammo; q = slotGroup[i].m.getClip() + slotGroup[i].m.getAmmo();
} }
// Calculate ammo costs only if a cost is specified // Calculate ammo costs only if a cost is specified
if (slotGroup[i].m.ammocost > 0) { if (slotGroup[i].m.ammocost > 0) {
@@ -532,6 +532,17 @@ export default class CostSection extends TranslatedComponent {
ammoCosts.push(item); ammoCosts.push(item);
ammoTotal += item.total; ammoTotal += item.total;
} }
// Add fighters
if (slotGroup[i].m.grp === 'fh') {
item = {
m: slotGroup[i].m,
max: slotGroup[i].m.getRebuildsPerBay() * slotGroup[i].m.getBays(),
cost: slotGroup[i].m.fightercost,
total: slotGroup[i].m.getRebuildsPerBay() * slotGroup[i].m.getBays() * slotGroup[i].m.fightercost
};
ammoCosts.push(item);
ammoTotal += item.total;
}
} }
} }
} }
@@ -552,12 +563,13 @@ export default class CostSection extends TranslatedComponent {
item = { item = {
m: { name: 'SRVs', class: '', rating: '' }, m: { name: 'SRVs', class: '', rating: '' },
max: srvs, max: srvs,
cost: 6005, cost: 1030,
total: srvs * 6005 total: srvs * 1030
}; };
ammoCosts.push(item); ammoCosts.push(item);
ammoTotal += item.total; ammoTotal += item.total;
} }
// Calculate refuel costs if no scoop present // Calculate refuel costs if no scoop present
if (!scoop) { if (!scoop) {
item = { item = {

View File

@@ -508,6 +508,22 @@ export default class Module {
return this._getModifiedValue('shieldreinforcement'); return this._getModifiedValue('shieldreinforcement');
} }
/**
* Get the bays for this module, taking in to account modifications
* @return {Number} the bays for this module
*/
getBays() {
return this._getModifiedValue('bays');
}
/**
* Get the rebuilds per bay for this module, taking in to account modifications
* @return {Number} the rebuilds per bay for this module
*/
getRebuildsPerBay() {
return this._getModifiedValue('rebuildsperbay');
}
/** /**
* Get the cells for this module, taking in to account modifications * Get the cells for this module, taking in to account modifications
* @return {Number} the cells for this module * @return {Number} the cells for this module
@@ -516,6 +532,7 @@ export default class Module {
return this._getModifiedValue('cells'); return this._getModifiedValue('cells');
} }
/** /**
* Get the jitter for this module, taking in to account modifications * Get the jitter for this module, taking in to account modifications
* @return {Number} the jitter for this module * @return {Number} the jitter for this module