diff --git a/src/app/components/ModificationsMenu.jsx b/src/app/components/ModificationsMenu.jsx index d2de4f32..794dd644 100644 --- a/src/app/components/ModificationsMenu.jsx +++ b/src/app/components/ModificationsMenu.jsx @@ -111,16 +111,20 @@ export default class ModificationsMenu extends TranslatedComponent { const { m, ship } = this.props; const features = m.blueprint.features[m.blueprint.grade]; for (const featureName in features) { - let value = features[featureName][0]; - if (m.grp == 'sb') { - // Shield boosters are a special case. Their boost is dependent on their base so we need to calculate the value here - value = ((1 + m.shieldboost)*(1 + value) - 1) / m.shieldboost - 1 - } + if (Modifications.modifications[featureName].method == 'overwrite') { + ship.setModification(m, featureName, features[featureName][1]); + } else { + let value = features[featureName][0]; + if (m.grp == 'sb' && featureName == 'shieldboost') { + // Shield boosters are a special case. Their boost is dependent on their base so we need to calculate the value here + value = ((1 + m.shieldboost)*(1 + value) - 1) / m.shieldboost - 1 + } - if (Modifications.modifications[featureName].type == 'percentage') { - ship.setModification(m, featureName, value * 10000); - } else if (Modifications.modifications[featureName].type == 'numeric') { - ship.setModification(m, featureName, value * 100); + if (Modifications.modifications[featureName].type == 'percentage') { + ship.setModification(m, featureName, value * 10000); + } else if (Modifications.modifications[featureName].type == 'numeric') { + ship.setModification(m, featureName, value * 100); + } } } @@ -135,16 +139,20 @@ export default class ModificationsMenu extends TranslatedComponent { const { m, ship } = this.props; const features = m.blueprint.features[m.blueprint.grade]; for (const featureName in features) { - let value = features[featureName][0] + (Math.random() * (features[featureName][1] - features[featureName][0])); - if (m.grp == 'sb') { - // Shield boosters are a special case. Their boost is dependent on their base so we need to calculate the value here - value = ((1 + m.shieldboost)*(1 + value) - 1) / m.shieldboost - 1 - } + if (Modifications.modifications[featureName].method == 'overwrite') { + ship.setModification(m, featureName, features[featureName][1]); + } else { + let value = features[featureName][0] + (Math.random() * (features[featureName][1] - features[featureName][0])); + if (m.grp == 'sb' && featureName == 'shieldboost') { + // Shield boosters are a special case. Their boost is dependent on their base so we need to calculate the value here + value = ((1 + m.shieldboost)*(1 + value) - 1) / m.shieldboost - 1 + } - if (Modifications.modifications[featureName].type == 'percentage') { - ship.setModification(m, featureName, value * 10000); - } else if (Modifications.modifications[featureName].type == 'numeric') { - ship.setModification(m, featureName, value * 100); + if (Modifications.modifications[featureName].type == 'percentage') { + ship.setModification(m, featureName, value * 10000); + } else if (Modifications.modifications[featureName].type == 'numeric') { + ship.setModification(m, featureName, value * 100); + } } } @@ -159,16 +167,20 @@ export default class ModificationsMenu extends TranslatedComponent { const { m, ship } = this.props; const features = m.blueprint.features[m.blueprint.grade]; for (const featureName in features) { - let value = features[featureName][1]; - if (m.grp == 'sb') { - // Shield boosters are a special case. Their boost is dependent on their base so we need to calculate the value here - value = ((1 + m.shieldboost)*(1 + value) - 1) / m.shieldboost - 1 - } + if (Modifications.modifications[featureName].method == 'overwrite') { + ship.setModification(m, featureName, features[featureName][1]); + } else { + let value = features[featureName][1]; + if (m.grp == 'sb' && featureName == 'shieldboost') { + // Shield boosters are a special case. Their boost is dependent on their base so we need to calculate the value here + value = ((1 + m.shieldboost)*(1 + value) - 1) / m.shieldboost - 1 + } - if (Modifications.modifications[featureName].type == 'percentage') { - ship.setModification(m, featureName, value * 10000); - } else if (Modifications.modifications[featureName].type == 'numeric') { - ship.setModification(m, featureName, value * 100); + if (Modifications.modifications[featureName].type == 'percentage') { + ship.setModification(m, featureName, value * 10000); + } else if (Modifications.modifications[featureName].type == 'numeric') { + ship.setModification(m, featureName, value * 100); + } } } @@ -211,7 +223,7 @@ export default class ModificationsMenu extends TranslatedComponent { blueprintLabel = translate(m.blueprint.name) + ' ' + translate('grade') + ' ' + m.blueprint.grade; haveBlueprint = true; } else { - blueprintLabel = translate('select a blueprint'); + blueprintLabel = translate('PHRASE_SELECT_BLUEPRINT'); } return ( @@ -220,17 +232,17 @@ export default class ModificationsMenu extends TranslatedComponent { onClick={(e) => e.stopPropagation() } onContextMenu={stopCtxPropagation} > -
{blueprintLabel}
+
{blueprintLabel}
{ blueprintMenuOpened ? this.state.blueprints : '' } { haveBlueprint ? - +
- - - - - + + + + +
{ translate('roll') } { translate('worst') } { translate('random') } { translate('best') } { translate('reset') } { translate('roll') }: { translate('worst') } { translate('random') } { translate('best') } { translate('reset') }
: '' } diff --git a/src/app/i18n/en.js b/src/app/i18n/en.js index 091cb560..93fc57b7 100644 --- a/src/app/i18n/en.js +++ b/src/app/i18n/en.js @@ -29,6 +29,11 @@ export const terms = { PHRASE_UNLADEN: 'Ship mass excluding fuel and cargo', PHRASE_UPDATE_RDY: 'Update Available! Click to refresh', PHRASE_ENGAGEMENT_RANGE: 'The distance between your ship and its target', + PHRASE_SELECT_BLUEPRINT: 'Click to select a blueprint', + PHRASE_BLUEPRINT_WORST: 'Worst primary values for this blueprint', + PHRASE_BLUEPRINT_RANDOM: 'Random selection between worst and best primary values for this blueprint', + PHRASE_BLUEPRINT_BEST: 'Best primary values for this blueprint', + PHRASE_BLUEPRINT_RESET: 'Remove all modifications and blueprint', HELP_MODIFICATIONS_MENU: 'Click on a number to enter a new value, or drag along the bar for small changes', @@ -102,6 +107,12 @@ export const terms = { rebuildsperbay: 'Rebuilds per bay', + // Blueprint rolls + worst: 'Worst', + random: 'Random', + best: 'Best', + reset: 'Reset', + // Weapon, offence, defence and movement dpe: 'Damage per MJ of energy', dps: 'Damage per second',