mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
sb mod displays percentage change relative to 1+boost; sb special effect applied correctly
This commit is contained in:
@@ -145,6 +145,8 @@ export default class Module {
|
|||||||
result = result + modValue;
|
result = result + modValue;
|
||||||
} else if (modification.method === 'overwrite') {
|
} else if (modification.method === 'overwrite') {
|
||||||
result = modValue;
|
result = modValue;
|
||||||
|
} else if (name === 'shieldboost') {
|
||||||
|
result = (1 + result) * (1 + modValue) - 1;
|
||||||
} else {
|
} else {
|
||||||
result = result * (1 + modValue);
|
result = result * (1 + modValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,21 +294,6 @@ export function getBlueprint(name, module) {
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
const blueprint = JSON.parse(JSON.stringify(found));
|
const blueprint = JSON.parse(JSON.stringify(found));
|
||||||
if (module) {
|
|
||||||
if (module.grp === 'sb') {
|
|
||||||
// Shield boosters are treated internally as straight modifiers, so rather than (for example)
|
|
||||||
// being a 4% boost they are a 104% multiplier. We need to fix the values here so that they look
|
|
||||||
// accurate as per the information in Elite
|
|
||||||
for (const grade in blueprint.grades) {
|
|
||||||
for (const feature in blueprint.grades[grade].features) {
|
|
||||||
if (feature === 'shieldboost') {
|
|
||||||
blueprint.grades[grade].features[feature][0] = ((1 + blueprint.grades[grade].features[feature][0]) * (1 + module.shieldboost) - 1) / module.shieldboost - 1;
|
|
||||||
blueprint.grades[grade].features[feature][1] = ((1 + blueprint.grades[grade].features[feature][1]) * (1 + module.shieldboost) - 1) / module.shieldboost - 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return blueprint;
|
return blueprint;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +372,9 @@ export function getPercent(m) {
|
|||||||
|
|
||||||
let value = _getValue(m, featureName);
|
let value = _getValue(m, featureName);
|
||||||
let mult;
|
let mult;
|
||||||
if (Modifications.modifications[featureName].higherbetter) {
|
if (featureName == 'shieldboost') {
|
||||||
|
mult = ((1 + value) * (1 + m.shieldboost)) - 1 - m.shieldboost;
|
||||||
|
} else if (Modifications.modifications[featureName].higherbetter) {
|
||||||
// Higher is better, but is this making it better or worse?
|
// Higher is better, but is this making it better or worse?
|
||||||
if (features[featureName][0] < 0 || (features[featureName][0] === 0 && features[featureName][1] < 0)) {
|
if (features[featureName][0] < 0 || (features[featureName][0] === 0 && features[featureName][1] < 0)) {
|
||||||
mult = Math.round((value - features[featureName][1]) / (features[featureName][0] - features[featureName][1]) * 100);
|
mult = Math.round((value - features[featureName][1]) / (features[featureName][0] - features[featureName][1]) * 100);
|
||||||
|
|||||||
Reference in New Issue
Block a user