From dc11cc182f6835c9b6877b35ba77ed1e363112b2 Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Sat, 4 Mar 2017 15:42:24 +0000 Subject: [PATCH] Fixes --- ChangeLog.md | 2 ++ src/app/components/DefenceSummary.jsx | 16 ++++++++++++++++ src/app/i18n/en.js | 3 +++ src/app/shipyard/Ship.js | 7 ++++--- src/schemas/ship-loadout/4.json | 6 +++--- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index e6872137..43906cb4 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,8 @@ * Make scan time visible on scanners where available * Update power distributor able-to-boost calculation to take fractional MJ values in to account * Revert to floating header due to issues on iOS + * Add effective total shield value to defence summary + * Fix issue where new module added to a slot did not reset its enabled status #2.2.19 * Power management panel now displays modules in descending order of power usage by default diff --git a/src/app/components/DefenceSummary.jsx b/src/app/components/DefenceSummary.jsx index 21896b90..66cfd5de 100644 --- a/src/app/components/DefenceSummary.jsx +++ b/src/app/components/DefenceSummary.jsx @@ -64,6 +64,22 @@ export default class DefenceSummary extends TranslatedComponent { {formats.pct1(1 - ship.shieldThermRes)} : null } + {ship.shield ? + + {translate('total effective shield')} + +   + {formats.int((ship.shield + ship.shieldCells) / (1 - ship.shieldExplRes))}{units.MJ} + + +   + {formats.int((ship.shield + ship.shieldCells) / (1 - ship.shieldKinRes))}{units.MJ} + + +   + {formats.int((ship.shield + ship.shieldCells) / (1 - ship.shieldThermRes))}{units.MJ} + + : null } { ship.shield && ship.shieldCells ? diff --git a/src/app/i18n/en.js b/src/app/i18n/en.js index a77101b1..4b338ae4 100644 --- a/src/app/i18n/en.js +++ b/src/app/i18n/en.js @@ -38,6 +38,7 @@ export const terms = { PHRASE_SELECT_SPECIAL: 'Click to select an experimental effect', PHRASE_NO_SPECIAL: 'No experimental effect', PHRASE_SHOPPING_LIST: 'Stations that sell this build', + PHRASE_TOTAL_EFFECTIVE_SHIELD: 'Total amount of damage that can be taken from each damage type, if using all shield cells', HELP_MODIFICATIONS_MENU: 'Click on a number to enter a new value, or drag along the bar for small changes', @@ -104,6 +105,8 @@ export const terms = { 'damage received from': 'Damage received from', 'against shields': 'Against shields', 'against hull': 'Against hull', + 'total effective shield': 'Total effective shield', + // 'ammo' was overloaded for outfitting page and modul info, so changed to ammunition for outfitting page ammunition: 'Ammo', diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 145b850d..2370a295 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -569,7 +569,6 @@ export default class Ship { for (i = 0; i < cl; i++) { standard[i].cat = 0; - standard[i].enabled = enabled ? enabled[i + 1] * 1 : true; standard[i].priority = priorities && priorities[i + 1] ? priorities[i + 1] * 1 : 0; standard[i].type = 'SYS'; standard[i].m = null; // Resetting 'old' modul if there was one @@ -582,6 +581,7 @@ export default class Ship { } this.use(standard[i], module, true); } + standard[i].enabled = enabled ? enabled[i + 1] * 1 : true; } standard[1].type = 'ENG'; // Thrusters @@ -590,7 +590,6 @@ export default class Ship { for (i = 0, l = hps.length; i < l; i++) { hps[i].cat = 1; - hps[i].enabled = enabled ? enabled[cl + i] * 1 : true; hps[i].priority = priorities && priorities[cl + i] ? priorities[cl + i] * 1 : 0; hps[i].type = hps[i].maxClass ? 'WEP' : 'SYS'; hps[i].m = null; // Resetting 'old' modul if there was one @@ -604,13 +603,13 @@ export default class Ship { } this.use(hps[i], module, true); } + hps[i].enabled = enabled ? enabled[cl + i] * 1 : true; } cl += hps.length; // Increase accounts for hardpoints for (i = 0, l = internal.length; i < l; i++) { internal[i].cat = 2; - internal[i].enabled = enabled ? enabled[cl + i] * 1 : true; internal[i].priority = priorities && priorities[cl + i] ? priorities[cl + i] * 1 : 0; internal[i].type = 'SYS'; internal[i].m = null; // Resetting 'old' modul if there was one @@ -624,6 +623,7 @@ export default class Ship { } this.use(internal[i], module, true); } + internal[i].enabled = enabled ? enabled[cl + i] * 1 : true; } // Update aggragated stats @@ -1640,6 +1640,7 @@ export default class Ship { } let oldModule = slot.m; slot.m = m; + slot.enabled = true; slot.discountedCost = (m && m.cost) ? m.cost * this.moduleCostMultiplier : 0; this.updateStats(slot, m, oldModule, preventUpdate); diff --git a/src/schemas/ship-loadout/4.json b/src/schemas/ship-loadout/4.json index 474d40d5..7dcc1987 100644 --- a/src/schemas/ship-loadout/4.json +++ b/src/schemas/ship-loadout/4.json @@ -230,16 +230,16 @@ }, "armour": { "description": "Sum of base armour + any hull reinforcements", - "type": "integer", + "type": "number", "minimum": 1 }, "armourAdded":{ "description": "Armour added through Hull reinforcement", - "type": "integer", + "type": "number", "minimum": 0 }, "baseShieldStrength": { - "type": "integer", + "type": "number", "minimum": 1 }, "baseArmour": {