From 25d9f8ec61dca72bd1f11b3f90c90ec6a82a93a8 Mon Sep 17 00:00:00 2001 From: Felix Linker Date: Sat, 15 Sep 2018 00:50:14 +0200 Subject: [PATCH] Fix experimental effect reverse engineering for resistance modding --- src/app/shipyard/Module.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index afed8fae..9c0f2c3b 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -95,7 +95,13 @@ export default class Module { if (modifierActions && modifierActions[name]) { // This special effect modifies the value being set, so we need to revert it prior to storing the value const modification = Modifications.modifications[name]; - if (modification.method === 'additive') { + if (name === 'explres' || name === 'kinres' || name === 'thermres' || name === 'causres') { + // Resistance modifications in itself are additive but their + // experimentals are applied multiplicatively therefor we must handle + // them differently here (cf. documentation in getModValue). + let baseMult = (this[name] ? 1 - this[name] : 1); + value = ((baseMult - value / 10000) / (1 - modifierActions[name] / 100) - baseMult) * -10000; + } else if (modification.method === 'additive') { value = value - modifierActions[name]; } else if (modification.method === 'overwrite') { value = null;