From baab91e3710f9b6be997dc19798f52839f5f3a81 Mon Sep 17 00:00:00 2001 From: felixlinker Date: Mon, 19 Aug 2019 18:52:15 +0200 Subject: [PATCH 1/8] Rename "Boost Time" to "Boost Interval" Closes #537 --- src/app/components/ShipSummaryTable.jsx | 2 +- src/app/i18n/cn.json | 4 ++-- src/app/i18n/en.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/components/ShipSummaryTable.jsx b/src/app/components/ShipSummaryTable.jsx index ea6e9f1b..74ffe4ef 100644 --- a/src/app/components/ShipSummaryTable.jsx +++ b/src/app/components/ShipSummaryTable.jsx @@ -86,7 +86,7 @@ export default class ShipSummaryTable extends TranslatedComponent { {translate('hrd')} {translate('crew')} {translate('MLF')} - {translate('boost time')} + {translate('boost interval')} {translate('resting heat (Beta)')} diff --git a/src/app/i18n/cn.json b/src/app/i18n/cn.json index ccbc4e0f..dcafd813 100644 --- a/src/app/i18n/cn.json +++ b/src/app/i18n/cn.json @@ -61,7 +61,7 @@ "TT_SUMMARY_SPEED": "给推进器分配4格能量值且满燃料", "TT_SUMMARY_SPEED_NONFUNCTIONAL": "推进器被关闭或者飞船满燃料满载时的总质量超出推进器最大可推进质量", "TT_SUMMARY_BOOST": "给推进器分配4格能量值且满燃料", - "TT_SUMMARY_BOOST_TIME": "给推进器分配4格能量值时,每次助推间隔时间", + "TT_SUMMARY_BOOST_INTERVAL": "给推进器分配4格能量值时,每次助推间隔时间", "TT_SUMMARY_BOOST_NONFUNCTIONAL": "配电器无法提供足够的能量以供助推", "TT_SUMMARY_SHIELDS": "护盾的绝对值,包含增幅装置", "TT_SUMMARY_SHIELDS_SCB": "护盾的绝对值,包含增幅装置和护盾电池", @@ -157,7 +157,7 @@ "shield": "护盾", "integrity": "强度", "mass": "质量", - "boost time": "推进时间", + "boost interval": "推进时间", "resting heat (Beta)": "待机热量(测试)", "No Shield": "无护盾", "resistance": "抗性", diff --git a/src/app/i18n/en.json b/src/app/i18n/en.json index 6e05a98b..a1446bcd 100644 --- a/src/app/i18n/en.json +++ b/src/app/i18n/en.json @@ -63,7 +63,7 @@ "TT_SUMMARY_SPEED": "With full fuel tank and 4 pips to ENG", "TT_SUMMARY_SPEED_NONFUNCTIONAL": "Thrusters powered off or over maximum mass with full fuel and cargo loads", "TT_SUMMARY_BOOST": "With full fuel tank and 4 pips to ENG", - "TT_SUMMARY_BOOST_TIME": "Time between each boost with 4 pips to ENG", + "TT_SUMMARY_BOOST_INTERVAL": "Time between each boost with 4 pips to ENG", "TT_SUMMARY_BOOST_NONFUNCTIONAL": "Power distributor not able to supply enough power to boost", "TT_SUMMARY_SHIELDS": "Raw shield strength, including boosters", "TT_SUMMARY_SHIELDS_SCB": "Raw shield strength, including boosters and SCBs", @@ -205,7 +205,7 @@ "internal protection": "Internal protection", "external protection": "External protection", "engagement range": "Engagement range", - "boost time": "Boost time", + "boost interval": "Boost intervall", "total": "Total", "ammo": "Ammunition maximum", "boot": "Boot time", From b689605ac251cb13d65c870fc10e57faa2a4bb6a Mon Sep 17 00:00:00 2001 From: felixlinker Date: Mon, 19 Aug 2019 18:59:11 +0200 Subject: [PATCH 2/8] Maximum active limpets does not show twice now Closes #532 --- src/app/components/InternalSlot.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/app/components/InternalSlot.jsx b/src/app/components/InternalSlot.jsx index 2460830b..f1ac0a8b 100644 --- a/src/app/components/InternalSlot.jsx +++ b/src/app/components/InternalSlot.jsx @@ -78,7 +78,6 @@ export default class InternalSlot extends Slot { { m.rangeLS ?
{translate('range')}: {m.rangeLS}{u.Ls}
: null } { m.rangeLS === null ?
∞{u.Ls}
: null } { m.rangeRating ?
{translate('range')}: {m.rangeRating}
: null } - { m.maximum ?
{translate('max')}: {(m.maximum)}
: null } { m.passengers ?
{translate('passengers')}: {m.passengers}
: null } { m.getRegenerationRate() ?
{translate('regen')}: {formats.round1(m.getRegenerationRate())}{u.ps}
: null } { m.getBrokenRegenerationRate() ?
{translate('brokenregen')}: {formats.round1(m.getBrokenRegenerationRate())}{u.ps}
: null } From 0c9db5305732b10de819d9dfda9ee58d0ef74680 Mon Sep 17 00:00:00 2001 From: felixlinker Date: Mon, 19 Aug 2019 19:13:39 +0200 Subject: [PATCH 3/8] Use shield and armour metrics in ship summary table --- src/app/components/ShipSummaryTable.jsx | 18 +++++++++--------- src/app/shipyard/Calculations.js | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/components/ShipSummaryTable.jsx b/src/app/components/ShipSummaryTable.jsx index 74ffe4ef..a98ad465 100644 --- a/src/app/components/ShipSummaryTable.jsx +++ b/src/app/components/ShipSummaryTable.jsx @@ -160,10 +160,10 @@ export default class ShipSummaryTable extends TranslatedComponent { {formats.pct1(ship.shieldThermRes)} - {int(ship && ship.shield > 0 ? ship.shield : 0)}{u.MJ} - {int(ship && ship.shield > 0 ? ship.shield * ((1 / (1 - (ship.shieldExplRes)))) : 0)}{u.MJ} - {int(ship && ship.shield > 0 ? ship.shield * ((1 / (1 - (ship.shieldKinRes)))) : 0)}{u.MJ} - {int(ship && ship.shield > 0 ? ship.shield * ((1 / (1 - (ship.shieldThermRes)))) : 0)}{u.MJ} + {int(ship && sgMetrics.summary > 0 ? sgMetrics.summary : 0)}{u.MJ} + {int(ship && sgMetrics.summary > 0 ? sgMetrics.summary / sgMetrics.explosive.base : 0)}{u.MJ} + {int(ship && sgMetrics.summary ? sgMetrics.summary / sgMetrics.kinetic.base : 0)}{u.MJ} + {int(ship && sgMetrics.summary ? sgMetrics.summary / sgMetrics.thermal.base : 0)}{u.MJ} {sgMetrics && sgMetrics.recover === Math.Inf ? translate('Never') : formats.time(sgMetrics.recover)} {sgMetrics && sgMetrics.recharge === Math.Inf ? translate('Never') : formats.time(sgMetrics.recharge)} @@ -198,11 +198,11 @@ export default class ShipSummaryTable extends TranslatedComponent { {formats.pct1(ship.hullKinRes)} {formats.pct1(ship.hullThermRes)} {formats.pct1(ship.hullCausRes)} - {int(ship.armour)} - {int(ship.armour * ((1 / (1 - (ship.hullExplRes)))))} - {int(ship.armour * ((1 / (1 - (ship.hullKinRes)))))} - {int(ship.armour * ((1 / (1 - (ship.hullThermRes)))))} - {int(ship.armour * ((1 / (1 - (ship.hullCausRes)))))} + {int(armourMetrics.total)} + {int(armourMetrics.total / armourMetrics.explosive.total)} + {int(armourMetrics.total/ armourMetrics.kinetic.total)} + {int(armourMetrics.total / armourMetrics.thermal.total)} + {int(armourMetrics.total/ armourMetrics.caustic.total)} {int(armourMetrics.modulearmour)} {int(armourMetrics.moduleprotection * 100) + '%'} diff --git a/src/app/shipyard/Calculations.js b/src/app/shipyard/Calculations.js index 8159fcac..e0f396c3 100644 --- a/src/app/shipyard/Calculations.js +++ b/src/app/shipyard/Calculations.js @@ -465,6 +465,7 @@ export function shieldMetrics(ship, sys) { boosters: boostersStrength, addition: shieldAddition, cells: ship.shieldCells, + summary: generatorStrength + boostersStrength + shieldAddition, total: generatorStrength + boostersStrength + ship.shieldCells + shieldAddition, recover, recharge, From 5d4ab6f2adc26e2ef575cdeec60fd2784457b3b1 Mon Sep 17 00:00:00 2001 From: felixlinker Date: Mon, 19 Aug 2019 19:15:47 +0200 Subject: [PATCH 4/8] Disabling guardian shield/module/hull reinforcement packages has an effect now Closes #523 --- src/app/shipyard/Calculations.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/shipyard/Calculations.js b/src/app/shipyard/Calculations.js index e0f396c3..83718991 100644 --- a/src/app/shipyard/Calculations.js +++ b/src/app/shipyard/Calculations.js @@ -400,7 +400,7 @@ export function shieldMetrics(ship, sys) { let shieldAddition = 0; if (ship) { for (const module of ship.internal) { - if (module && module.m && module.m.grp === 'gsrp') { + if (module && module.m && module.m.grp === 'gsrp' && module.enabled) { shieldAddition += module.m.getShieldAddition(); } } @@ -574,7 +574,7 @@ export function armourMetrics(ship) { // }; // Armour from HRPs and module armour from MRPs for (let slot of ship.internal) { - if (slot.m && (slot.m.grp === 'hr' || slot.m.grp === 'ghrp' || slot.m.grp == 'mahr')) { + if (slot.m && slot.enabled && (slot.m.grp === 'hr' || slot.m.grp === 'ghrp' || slot.m.grp == 'mahr')) { armourReinforcement += slot.m.getHullReinforcement(); // Hull boost for HRPs is applied against the ship's base armour armourReinforcement += ship.baseArmour * slot.m.getModValue('hullboost') / 10000; @@ -586,7 +586,7 @@ export function armourMetrics(ship) { hullThermDmg = hullThermDmg * (1 - slot.m.getThermalResistance()); hullCausDmg = hullCausDmg * (1 - slot.m.getCausticResistance()); } - if (slot.m && (slot.m.grp == 'mrp' || slot.m.grp == 'gmrp')) { + if (slot.m && slot.enabled && (slot.m.grp == 'mrp' || slot.m.grp == 'gmrp')) { moduleArmour += slot.m.getIntegrity(); moduleProtection = moduleProtection * (1 - slot.m.getProtection()); } From af37c2bfc568890754de34d1164983d8a4556942 Mon Sep 17 00:00:00 2001 From: Felix Linker Date: Sat, 24 Aug 2019 12:02:16 +0200 Subject: [PATCH 5/8] Fix import falloff References #535 --- src/app/utils/JournalUtils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/utils/JournalUtils.js b/src/app/utils/JournalUtils.js index a3ca11c1..c0f7df34 100644 --- a/src/app/utils/JournalUtils.js +++ b/src/app/utils/JournalUtils.js @@ -274,6 +274,9 @@ function _addModifications(module, modifiers, blueprint, grade, specialModificat if (value === Infinity) { value = modifiers[i].Value * 100; } + if (modifiers[i].Label.search('DamageFalloffRange') >= 0) { + value = (modifiers[i].Value / module.range - 1) * 100; + } if (modifiers[i].Label.search('Resistance') >= 0) { value = (modifiers[i].Value * 100) - (modifiers[i].OriginalValue * 100); } From 4f1e32b154e6cd0b46ff359302ce4b2a639d7830 Mon Sep 17 00:00:00 2001 From: Felix Linker Date: Sat, 24 Aug 2019 14:16:03 +0200 Subject: [PATCH 6/8] Move sustained factor calculation into own function Closes #517 --- src/app/components/HardpointSlot.jsx | 4 ++-- src/app/shipyard/Module.js | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/components/HardpointSlot.jsx b/src/app/components/HardpointSlot.jsx index 1833d7d4..724d9fd5 100644 --- a/src/app/components/HardpointSlot.jsx +++ b/src/app/components/HardpointSlot.jsx @@ -104,10 +104,10 @@ export default class HardpointSlot extends Slot { onMouseOut={tooltip.bind(null, null)}>{translate('shotdmg')}: {formats.round1(m.getDamage())} : null} {m.getEps() ?
{translate('EPS')}: {formats.round1(m.getEps())}{u.MW} {m.getClip() ? - ({formats.round1(m.getEps() / m.getDps() * m.getSDps())}{u.MW}) : null}
: null} + ({formats.round1(m.getEps() * m.getSustainedFactor())}{u.MW}) : null} : null} {m.getHps() ?
{translate('HPS')}: {formats.round1(m.getHps())} {m.getClip() ? - ({formats.round1(m.getHps() / m.getDps() * m.getSDps())}) : null}
: null} + ({formats.round1(m.getHps() * m.getSustainedFactor())}) : null} : null} {m.getDps() && m.getEps() ?
{translate('DPE')}: {formats.f1(m.getDps() / m.getEps())}
: null} {m.getRoF() ?
Date: Wed, 14 Aug 2019 02:47:05 +0200 Subject: [PATCH 7/8] Implement blueprint changes to focused weapon --- src/app/shipyard/Module.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index 9012f812..22466f93 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -583,20 +583,9 @@ export default class Module { * @return {Number} the falloff of this module */ getFalloff(modified = true) { - if (!modified) { - const range = this.getRange(false); - const falloff = this.get('falloff', false); - return (falloff > range ? range : falloff); - } - // Falloff from range is mapped to range - if (this.mods && this.mods['fallofffromrange']) { + if (modified && this.mods && this.mods['fallofffromrange']) { return this.getRange(); - // Need to find out if we have a focused modification, in which case our - // falloff is scaled to range - } else if (this.blueprint && this.blueprint.name === 'Focused') { - const rangeMod = this.getModValue('range') / 10000; - return this.falloff * (1 + rangeMod); // Standard falloff calculation } else { const range = this.getRange(); From ba6d758ed5af19154f4520696cd8410c89fb0a7d Mon Sep 17 00:00:00 2001 From: Felix Linker Date: Fri, 13 Sep 2019 22:36:56 +0200 Subject: [PATCH 8/8] Import plasma slug correctly References #450 --- src/app/utils/JournalUtils.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/utils/JournalUtils.js b/src/app/utils/JournalUtils.js index c0f7df34..1b264530 100644 --- a/src/app/utils/JournalUtils.js +++ b/src/app/utils/JournalUtils.js @@ -249,6 +249,13 @@ function _addModifications(module, modifiers, blueprint, grade, specialModificat if (!modifiers) return; let special; if (specialModifications) { + if (specialModifications == 'special_plasma_slug') { + if (module.symbol.match(/PlasmaAccelerator/i)) { + specialModifications = 'special_plasma_slug_pa'; + } else { + specialModifications = 'special_plasma_slug_cooled'; + } + } special = Modifications.specials[specialModifications]; } // Add the blueprint definition, grade and special