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 @@