diff --git a/app/js/shipyard/factory-ship.js b/app/js/shipyard/factory-ship.js index d3be8a14..f930ee70 100755 --- a/app/js/shipyard/factory-ship.js +++ b/app/js/shipyard/factory-ship.js @@ -1,4 +1,4 @@ -angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', 'calcJumpRange', 'calcTotalRange', 'lodash', function(Components, calcShieldStrength, calcJumpRange, calcTotalRange, _) { +angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', 'calcJumpRange', 'calcTotalRange', 'lodash', 'ArmourMultiplier', function(Components, calcShieldStrength, calcJumpRange, calcTotalRange, _, ArmourMultiplier) { /** * Returns the power usage type of a slot and it's particular component @@ -84,10 +84,10 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', this.cargoCapacity = 0; this.ladenMass = 0; this.armourAdded = 0; + this.armourMultiplier = 1; this.shieldMultiplier = 1; this.totalCost = this.c.incCost ? this.c.discountedCost : 0; this.unladenMass = this.hullMass; - this.armour = this.baseArmour; this.totalDps = 0; this.bulkheads.c = null; @@ -158,6 +158,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', this.bulkheads.id = index; this.bulkheads.c = Components.bulkheads(this.id, index); this.bulkheads.discountedCost = this.bulkheads.c.cost * this.componentCostMultiplier; + this.armourMultiplier = ArmourMultiplier[index]; this.updateStats(this.bulkheads, this.bulkheads.c, oldBulkhead, preventUpdate); }; @@ -359,7 +360,7 @@ angular.module('shipyard').factory('Ship', ['Components', 'calcShieldStrength', } this.ladenMass = this.unladenMass + this.cargoCapacity + this.fuelCapacity; - this.armour = this.armourAdded + this.baseArmour; + this.armour = this.armourAdded + Math.round(this.baseArmour * this.armourMultiplier); if (!preventUpdate) { if (powerChange) { diff --git a/app/js/shipyard/module-shipyard.js b/app/js/shipyard/module-shipyard.js index d3323e0d..8afb1ecd 100755 --- a/app/js/shipyard/module-shipyard.js +++ b/app/js/shipyard/module-shipyard.js @@ -10,6 +10,13 @@ angular.module('shipyard', ['ngLodash']) // Create 'angularized' references to DB.This will aid testing .constant('ShipsDB', DB.ships) .constant('ComponentsDB', DB.components) + .value('ArmourMultiplier', [ + 1, // Lightweight + 1.4, // Reinforced + 1.945, // Military + 1.945, // Mirrored + 1.945 // Reactive + ]) .value('commonArray', [ 'Power Plant', 'Thrusters', diff --git a/app/views/page-outfit.html b/app/views/page-outfit.html index b1e19797..9b58eb5d 100644 --- a/app/views/page-outfit.html +++ b/app/views/page-outfit.html @@ -62,7 +62,11 @@ {{fRound(ship.speed)}} m/s {{fRound(ship.boost)}} m/s {{fRound(ship.totalDps)}} - {{ship.armour}} ({{ship.baseArmour}} + {{ship.armourAdded}}) + + {{ship.armour}} + ({{fRPct(ship.armourMultiplier)}} + + {{ship.armourAdded}}) + {{fRound(ship.shieldStrength)}} MJ ({{fRPct(ship.shieldMultiplier)}}) {{ship.hullMass}} T {{fRound(ship.unladenMass)}} T diff --git a/test/fixtures/anaconda-test-detailed-export.json b/test/fixtures/anaconda-test-detailed-export.json index ee9027cd..6b8ef67e 100644 --- a/test/fixtures/anaconda-test-detailed-export.json +++ b/test/fixtures/anaconda-test-detailed-export.json @@ -198,11 +198,12 @@ "fuelCapacity": 32, "cargoCapacity": 128, "ladenMass": 1339.2, + "armour": 2078, "armourAdded": 240, + "armourMultiplier": 1.95, "shieldMultiplier": 1.4, "totalCost": 882362049, "unladenMass": 1179.2, - "armour": 1185, "totalDps": 29, "powerAvailable": 36, "powerRetracted": 23.93,