From 82ce86a37419811e4daf8f5a74c88a14ca84726d Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Wed, 22 Mar 2017 13:55:45 +0000 Subject: [PATCH] Updates --- ChangeLog.md | 1 + src/app/components/HardpointSlot.jsx | 2 +- src/app/components/StandardSlot.jsx | 2 +- src/app/i18n/en.js | 5 +++-- src/app/pages/OutfittingPage.jsx | 25 +++++++++++++++++++++---- 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 08bceac1..ec2992c6 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -10,6 +10,7 @@ * Ensure that boost value is set correctly when modifications to power distributor enable/disable boost * Ensure that hull reinforcement modifications take the inherent resistance in to account when calculating modification percentages * Add tooltip for blueprints providing details of the features they alter + * Use opponent's saved pips if available #2.2.19 * Power management panel now displays modules in descending order of power usage by default diff --git a/src/app/components/HardpointSlot.jsx b/src/app/components/HardpointSlot.jsx index 1a48a3a5..bca5ecbc 100644 --- a/src/app/components/HardpointSlot.jsx +++ b/src/app/components/HardpointSlot.jsx @@ -81,7 +81,7 @@ export default class HardpointSlot extends Slot { { m.getHps() ?
{translate('HPS')}: {formats.round1(m.getHps())} { m.getClip() ? ({formats.round1((m.getClip() * m.getHps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload())) }) : null }
: null } { m.getDps() && m.getEps() ?
{translate('DPE')}: {formats.f1(m.getDps() / m.getEps())}
: null } { m.getRoF() ?
{translate('ROF')}: {formats.f1(m.getRoF())}{u.ps}
: null } - { m.getRange() ?
{translate('range')} {formats.f1(m.getRange() / 1000)}{u.km}
: null } + { m.getRange() ?
{translate('range', m.grp)} {formats.f1(m.getRange() / 1000)}{u.km}
: null } { m.getScanTime() ?
{translate('scantime')} {formats.f1(m.getScanTime())}{u.s}
: null } { m.getFalloff() ?
{translate('falloff')} {formats.round(m.getFalloff() / 1000)}{u.km}
: null } { m.getShieldBoost() ?
+{formats.pct1(m.getShieldBoost())}
: null } diff --git a/src/app/components/StandardSlot.jsx b/src/app/components/StandardSlot.jsx index 8ec68235..30d5502f 100644 --- a/src/app/components/StandardSlot.jsx +++ b/src/app/components/StandardSlot.jsx @@ -100,7 +100,7 @@ export default class StandardSlot extends TranslatedComponent { { m.getMinMass() ?
{translate('minimum mass')}: {formats.int(m.getMinMass())}{units.T}
: null } { m.getOptMass() ?
{translate('optimal mass')}: {formats.int(m.getOptMass())}{units.T}
: null } { m.getMaxMass() ?
{translate('max mass')}: {formats.int(m.getMaxMass())}{units.T}
: null } - { m.getRange() ?
{translate('range')}: {formats.f2(m.getRange())}{units.km}
: null } + { m.getRange() ?
{translate('range', m.grp)}: {formats.f2(m.getRange())}{units.km}
: null } { m.time ?
{translate('time')}: {formats.time(m.time)}
: null } { m.getThermalEfficiency() ?
{translate('efficiency')}: {formats.f2(m.getThermalEfficiency())}
: null } { m.getPowerGeneration() > 0 ?
{translate('pgen')}: {formats.f1(m.getPowerGeneration())}{units.MW}
: null } diff --git a/src/app/i18n/en.js b/src/app/i18n/en.js index 6ed56ba4..36fd123e 100644 --- a/src/app/i18n/en.js +++ b/src/app/i18n/en.js @@ -230,8 +230,7 @@ export const terms = { regen: 'Regeneration rate', reload: 'Reload', rof: 'Rate of fire', - scanangle: 'Scan angle', - scanrange: 'Scan range', + angle: 'Scan angle', scantime: 'Scan time', shield: 'Shield', shieldboost: 'Shield boost', @@ -253,6 +252,8 @@ export const terms = { optmul_sg: 'Optimal strength', maxmul_sg: 'Minimum strength', + range_s: 'Typical emission range', + // Damage types absolute: 'Absolute', explosive: 'Explosive', diff --git a/src/app/pages/OutfittingPage.jsx b/src/app/pages/OutfittingPage.jsx index d9452d74..11b4b71a 100644 --- a/src/app/pages/OutfittingPage.jsx +++ b/src/app/pages/OutfittingPage.jsx @@ -90,7 +90,7 @@ export default class OutfittingPage extends Page { this._getTitle = getTitle.bind(this, data.properties.name); // Obtain ship control from code - const { sys, eng, wep, boost, fuel, cargo, opponent, opponentBuild, engagementRange } = this._obtainControlFromCode(ship, code); + const { sys, eng, wep, boost, fuel, cargo, opponent, opponentBuild, opponentSys, opponentEng, opponentWep, engagementRange } = this._obtainControlFromCode(ship, code); return { error: null, title: this._getTitle(buildName), @@ -109,6 +109,9 @@ export default class OutfittingPage extends Page { cargo, opponent, opponentBuild, + opponentSys, + opponentEng, + opponentWep, engagementRange }; } @@ -167,7 +170,10 @@ export default class OutfittingPage extends Page { let fuel = ship.fuelCapacity; let cargo = ship.cargoCapacity; let opponent = new Ship('eagle', Ships['eagle'].properties, Ships['eagle'].slots).buildWith(Ships['eagle'].defaults); - let opponentBuild = undefined; + let opponentSys = 2; + let opponentEng = 2; + let opponentWep = 2; + let opponentBuild; let engagementRange = 1000; // Obtain updates from code, if available @@ -187,8 +193,19 @@ export default class OutfittingPage extends Page { opponent = new Ship(shipId, Ships[shipId].properties, Ships[shipId].slots); if (control[7] && Persist.getBuild(shipId, control[7])) { // Ship is a particular build - opponent.buildFrom(Persist.getBuild(shipId, control[7])); + const opponentCode = Persist.getBuild(shipId, control[7]); + opponent.buildFrom(opponentCode); opponentBuild = control[7]; + if (opponentBuild) { + // Obtain opponent's sys/eng/wep pips from their code + const opponentParts = opponentCode.split('.'); + if (opponentParts.length >= 5) { + const opponentControl = LZString.decompressFromBase64(Utils.fromUrlSafe(opponentParts[4])).split('/'); + opponentSys = parseFloat(opponentControl[0]); + opponentEng = parseFloat(opponentControl[1]); + opponentWep = parseFloat(opponentControl[2]); + } + } } else { // Ship is a stock build opponent.buildWith(Ships[shipId].defaults); @@ -198,7 +215,7 @@ export default class OutfittingPage extends Page { } } - return { sys, eng, wep, boost, fuel, cargo, opponent, opponentBuild, engagementRange }; + return { sys, eng, wep, boost, fuel, cargo, opponent, opponentBuild, opponentSys, opponentEng, opponentWep, engagementRange }; } /**