eslint indentation fixes

This commit is contained in:
felixlinker
2018-09-29 01:03:00 +01:00
parent c9866c146b
commit d195b568b0

View File

@@ -81,8 +81,8 @@ export default class Module {
// the amount of base resistance the hrp has. // the amount of base resistance the hrp has.
if (!isNaN(result) && this.grp === 'hr' && if (!isNaN(result) && this.grp === 'hr' &&
(name === 'kinres' || name === 'thermres' || name === 'explres')) { (name === 'kinres' || name === 'thermres' || name === 'explres')) {
let baseRes = this[name]; let baseRes = this[name];
result = result * (1 - baseRes); result = result * (1 - baseRes);
} }
// Sanitise the resultant value to 4dp equivalent // Sanitise the resultant value to 4dp equivalent
@@ -180,7 +180,7 @@ export default class Module {
modValue = value - baseValue; modValue = value - baseValue;
if (this.grp === 'hr' && if (this.grp === 'hr' &&
(name === 'kinres' || name === 'thermres' || name === 'explres')) { (name === 'kinres' || name === 'thermres' || name === 'explres')) {
modValue = modValue / (1 - baseValue); modValue = modValue / (1 - baseValue);
} }
} else if (name === 'shieldboost' || name === 'hullboost') { } else if (name === 'shieldboost' || name === 'hullboost') {
modValue = (1 + value) / (1 + baseValue) - 1; modValue = (1 + value) / (1 + baseValue) - 1;
@@ -192,7 +192,7 @@ export default class Module {
modValue = modValue * 10000; modValue = modValue * 10000;
} else if (modification.type === 'numeric' && name !== 'burst' && } else if (modification.type === 'numeric' && name !== 'burst' &&
name !== 'burstrof') { name !== 'burstrof') {
modValue = modValue * 100; modValue = modValue * 100;
} }
this.setModValue(name, modValue, valueIsWithSpecial); this.setModValue(name, modValue, valueIsWithSpecial);
@@ -242,38 +242,38 @@ export default class Module {
const modification = Modifications.modifications[name]; const modification = Modifications.modifications[name];
let result = this[name]; let result = this[name];
if (modification) { if (modification) {
// We store percentages as decimals, so to get them back we need to divide by 10000. Otherwise // 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 // we divide by 100. Both ways we end up with a value with two decimal places
let modValue; let modValue;
if (modification.type === 'percentage') { if (modification.type === 'percentage') {
modValue = this.getModValue(name) / 10000; modValue = this.getModValue(name) / 10000;
} else if (modification.type === 'numeric') { } else if (modification.type === 'numeric') {
modValue = this.getModValue(name) / 100; modValue = this.getModValue(name) / 100;
} else { } else {
modValue = this.getModValue(name); modValue = this.getModValue(name);
}
if (modValue) {
if (!result && modification.method === 'additive') {
// If the modification is additive and no value is given by default we
// start at zero
result = 0;
} }
if (modValue) {
if (!result && modification.method === 'additive') {
// If the modification is additive and no value is given by default we
// start at zero
result = 0;
}
if (result !== undefined) { if (result !== undefined) {
if (modification.method === 'additive') { if (modification.method === 'additive') {
result = result + modValue; result = result + modValue;
} else if (modification.method === 'overwrite') { } else if (modification.method === 'overwrite') {
result = modValue; result = modValue;
} else if (name === 'shieldboost' || name === 'hullboost') { } else if (name === 'shieldboost' || name === 'hullboost') {
result = (1 + result) * (1 + modValue) - 1; result = (1 + result) * (1 + modValue) - 1;
} else { } else {
result = result * (1 + modValue); result = result * (1 + modValue);
} }
} else if (name === 'burstrof') { } else if (name === 'burstrof') {
// Burst and burst rate of fire are special, as it can not exist but // Burst and burst rate of fire are special, as it can not exist but
// have a modification // have a modification
result = modValue / 100; result = modValue / 100;
} }
} }
} }