From 63e850b5aa700a780db4c5dbe13e1a1384f79c9f Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Wed, 25 Jan 2017 14:23:57 +0000 Subject: [PATCH] Fixes for fragment cannons --- ChangeLog.md | 2 ++ src/app/components/Modification.jsx | 2 +- src/app/shipyard/Module.js | 6 +++++- src/app/utils/CompanionApiUtils.js | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 5040adbd..c62b6398 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,8 @@ * Provide damage dealt statistics for both shields and hull * Damage dealt panel only shows enabled weapons * Add engagement range to damage received panel + * Handle burst rate of fire as an absolute number rather than a perentage modification + * Ensure that clip values are always rounded up #2.2.10 * Fix detailed export of module reinforcement packages diff --git a/src/app/components/Modification.jsx b/src/app/components/Modification.jsx index e6d2bc29..c999ff35 100644 --- a/src/app/components/Modification.jsx +++ b/src/app/components/Modification.jsx @@ -72,7 +72,7 @@ export default class Modification extends TranslatedComponent { let symbol; if (name === 'jitter') { symbol = '°'; - } else if (name !== 'burst') { + } else if (name !== 'burst' && name != 'burstrof') { symbol = '%'; } if (symbol) { diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index 7b58e6b4..4e7d5805 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -78,6 +78,7 @@ export default class Module { if (!modification) { return result; } + // We store percentages as decimals, so to get them back we need to divide by 10000. Otherwise // we divide by 100. Both ways we end up with a value with two decimal places let modValue; @@ -534,7 +535,10 @@ export default class Module { * @return {Number} the clip size of this module */ getClip() { - return this._getModifiedValue('clip'); + // Clip size is always rounded up + let result = this._getModifiedValue('clip'); + if (result) { result = Math.ceil(result) }; + return result; } /** diff --git a/src/app/utils/CompanionApiUtils.js b/src/app/utils/CompanionApiUtils.js index 234ed48d..e1cf0d1a 100644 --- a/src/app/utils/CompanionApiUtils.js +++ b/src/app/utils/CompanionApiUtils.js @@ -303,7 +303,7 @@ function _addModifications(module, modifiers, blueprint, grade) { // This is an absolute number that acts as an override module.setModValue('burst', modifiers.modifiers[i].value * 100); } else if (modifiers.modifiers[i].name === 'mod_weapon_burst_rof') { - // For some reason this is a non-normalised percentage (i.e. 12.23% is 12.23 value rather than 0.1223 as everywhere else), so fix that here + // This is an absolute number that acts as an override module.setModValue('burstrof', modifiers.modifiers[i].value * 100); } else if (modifiers.modifiers[i].name === 'mod_weapon_falloffrange_from_range') { // Obtain the falloff value directly from the range