From f863daa347b01e32bfa1eed5fdd5cd5bbafaf196 Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Wed, 23 Nov 2016 00:54:42 +0000 Subject: [PATCH] Fix hull boost calculation. Partial fix for #29 --- ChangeLog.md | 5 ++++- src/app/utils/CompanionApiUtils.js | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 777085b7..c9c5400e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,7 @@ -#2.2.x +#2.2.3 + * Fix hull boost calculation + +#2.2.2 * Update DPS/HPS/EPS in real-time as modifiers change * Use coriolis-data 2.2.2: * Add distributor draw modifier to shield generators diff --git a/src/app/utils/CompanionApiUtils.js b/src/app/utils/CompanionApiUtils.js index c6c3b71f..713e6e70 100644 --- a/src/app/utils/CompanionApiUtils.js +++ b/src/app/utils/CompanionApiUtils.js @@ -355,6 +355,12 @@ function _addModifications(module, modifiers) { } } + // Bulkhead boost is based off the inherent boost of the module + if (module.grp == 'bh') { + const alteredBoost = (1 + module.hullboost) * (1 + module.getModValue('hullboost') / 10000) - 1; + module.setModValue('hullboost', (alteredBoost / module.hullboost - 1) * 10000); + } + // Jitter is an absolute number, so we need to divide it by 100 if (module.getModValue('jitter')) { module.setModValue('jitter', module.getModValue('jitter') / 100);