From 041f873f97f83aae715fcce981469aee9cff8363 Mon Sep 17 00:00:00 2001 From: Cmdr McDonald Date: Tue, 13 Dec 2016 18:56:59 +0000 Subject: [PATCH] Updates --- .gitignore | 3 +- ChangeLog.md | 3 ++ env | 4 --- src/app/components/AvailableModulesMenu.jsx | 10 ++++++- src/app/components/DefenceSummary.jsx | 11 +++++++ src/app/components/InternalSlot.jsx | 1 + src/app/components/MovementSummary.jsx | 33 --------------------- src/app/i18n/en.js | 4 +++ src/app/shipyard/Constants.js | 16 +++++++--- src/app/shipyard/Module.js | 8 +++++ src/app/shipyard/Ship.js | 29 ++++++++++++++---- 11 files changed, 73 insertions(+), 49 deletions(-) delete mode 100644 env diff --git a/.gitignore b/.gitignore index 9d011721..1bbc61e9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ build *.log nginx.pid .idea -/bin \ No newline at end of file +/bin +env diff --git a/ChangeLog.md b/ChangeLog.md index 8e0b2e59..19028379 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,9 @@ * Fix issue when importing Viper Mk IV * Ensure ordering of all types of modules (standard, internal, utilities) is consistent * Add rebuilds per bay information for fighter hangars + * Add ability to show military compartments + * Add diminishing returns for shield boosters + * Show module reinforcement package results in defence summary * Use separate speed/rotation/acceleration multipliers for thrusters if available #2.2.5 diff --git a/env b/env deleted file mode 100644 index 0bb2d2e4..00000000 --- a/env +++ /dev/null @@ -1,4 +0,0 @@ -CORIOLIS_UA_TRACKING=UA-87944382-1 -export CORIOLIS_UA_TRACKING -CORIOLIS_GAPI_KEY=AIzaSyAvuJC2TECa3rulzI5rTyfycYi9T28Xhwc -export CORIOLIS_GAPI_KEY diff --git a/src/app/components/AvailableModulesMenu.jsx b/src/app/components/AvailableModulesMenu.jsx index fa4c18d5..4d3697bd 100644 --- a/src/app/components/AvailableModulesMenu.jsx +++ b/src/app/components/AvailableModulesMenu.jsx @@ -223,8 +223,16 @@ export default class AvailableModulesMenu extends TranslatedComponent { } if (a.class > b.class) { return -1; - // Rating ordered from lowest (E) to highest (A) } + // Mount type, if applicable + if (a.mount && b.mount && a.mount !== b.mount) { + if (a.mount === 'F' || (a.mount === 'G' && b.mount === 'T')) { + return -1; + } else { + return 1; + } + } + // Rating ordered from lowest (E) to highest (A) if (a.rating < b.rating) { return 1; } diff --git a/src/app/components/DefenceSummary.jsx b/src/app/components/DefenceSummary.jsx index d9ec54a9..94831068 100644 --- a/src/app/components/DefenceSummary.jsx +++ b/src/app/components/DefenceSummary.jsx @@ -67,6 +67,17 @@ export default class DefenceSummary extends TranslatedComponent { {formats.pct1(ship.hullKinRes || 1)} {formats.pct1(ship.hullThermRes || 1)} + + {ship.modulearmour > 0 ? + +

{translate('module armour')}: {formats.int(ship.modulearmour)}

+ : null } + + {ship.moduleprotection > 0 ? + + {translate('internal protection')} {formats.pct1(ship.moduleprotection)} + {translate('external protection')} {formats.pct1(ship.moduleprotection / 2)} + : null } diff --git a/src/app/components/InternalSlot.jsx b/src/app/components/InternalSlot.jsx index 369d001f..cfd6e7ff 100644 --- a/src/app/components/InternalSlot.jsx +++ b/src/app/components/InternalSlot.jsx @@ -59,6 +59,7 @@ export default class InternalSlot extends Slot { { m.rangeLS === null ?
∞{u.Ls}
: null } { m.rangeRating ?
{translate('range')}: {m.rangeRating}
: null } { m.getHullReinforcement() ?
+{formats.int(m.getHullReinforcement() + ship.baseArmour * m.getModValue('hullboost') / 10000)} {translate('armour')}
: null } + { m.getProtection() ?
{formats.rPct(m.getProtection())} {translate('protection')}
: null } { m.passengers ?
{translate('passengers')}: {m.passengers}
: null } { showModuleResistances && m.getExplosiveResistance() ?
{translate('explres')}: {formats.pct(m.getExplosiveResistance())}
: null } { showModuleResistances && m.getKineticResistance() ?
{translate('kinres')}: {formats.pct(m.getKineticResistance())}
: null } diff --git a/src/app/components/MovementSummary.jsx b/src/app/components/MovementSummary.jsx index c3b60970..f5b31699 100644 --- a/src/app/components/MovementSummary.jsx +++ b/src/app/components/MovementSummary.jsx @@ -88,38 +88,5 @@ export default class MovementSummary extends TranslatedComponent { ); -// return ( -// -//

{translate('movement summary')}

-// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -//

{translate('normal')}

{translate('speed')} {formats.int(ship.topSpeed)}{units['m/s']}{translate('pitch')} {formats.f1(ship.pitches[4])}{units['°/s']}{translate('roll')} {formats.f1(ship.rolls[4])}{units['°/s']}{translate('yaw')} {formats.f1(ship.yaws[4])}{units['°/s']}

{translate('boost')}

{translate('speed')} {formats.int(ship.topSpeed * boostMultiplier)}{units['m/s']}{translate('pitch')} {formats.f1(ship.pitches[4] * boostMultiplier)}{units['°/s']}{translate('roll')} {formats.f1(ship.rolls[4] * boostMultiplier)}{units['°/s']}{translate('yaw')} {formats.f1(ship.yaws[4] * boostMultiplier)}{units['°/s']}

Frame Shift

Maximum {formats.f2(ship.fullTankRange)} {units.LY}
-//
-// ); } } diff --git a/src/app/i18n/en.js b/src/app/i18n/en.js index 808f4e12..91c49c19 100644 --- a/src/app/i18n/en.js +++ b/src/app/i18n/en.js @@ -59,6 +59,7 @@ export const terms = { mc: 'Multi-cannon', ml: 'Mining Laser', mr: 'Missile Rack', + mrp: 'Module Reinforcement Package', nl: 'Mine Launcher', pa: 'Plasma Accelerator', pas: 'Planetary Approach Suite', @@ -116,6 +117,8 @@ export const terms = { 'pitch': 'Pitch', 'roll': 'Roll', 'yaw': 'Yaw', + 'internal protection': 'Internal protection', + 'external protection': 'External protection', // Modifications ammo: 'Ammunition maximum', @@ -144,6 +147,7 @@ export const terms = { pgen: 'Power generation', piercing: 'Piercing', power: 'Power draw', + protection: 'Protection', range: 'Range', ranget: 'Range', // Range in time (for FSD interdictor) regen: 'Regeneration rate', diff --git a/src/app/shipyard/Constants.js b/src/app/shipyard/Constants.js index e8714216..35901ee3 100755 --- a/src/app/shipyard/Constants.js +++ b/src/app/shipyard/Constants.js @@ -105,8 +105,9 @@ export const BulkheadNames = [ export const ShipFacets = [ { // 0 title: 'agility', - props: ['agility'], - fmt: 'int', + props: ['topPitch', 'topRoll', 'topYaw'], + lbls: ['pitch', 'roll', 'yaw'], + fmt: 'f1', i: 0 }, { // 1 @@ -185,11 +186,18 @@ export const ShipFacets = [ }, { // 11 title: 'DPS', - props: ['totalDps'], - lbls: ['DPS'], + props: ['totalDps', 'totalExplDps', 'totalKinDps', 'totalThermDps'], + lbls: ['total', 'explosive', 'kinetic', 'thermal'], fmt: 'round', i: 11 }, + { // 14 + title: 'Sustained DPS', + props: ['totalSDps', 'totalExplSDps', 'totalKinSDps', 'totalThermSDps'], + lbls: ['total', 'explosive', 'kinetic', 'thermal'], + fmt: 'round', + i: 14 + }, { // 12 title: 'EPS', props: ['totalEps'], diff --git a/src/app/shipyard/Module.js b/src/app/shipyard/Module.js index 31ee09e8..a9f7bd07 100755 --- a/src/app/shipyard/Module.js +++ b/src/app/shipyard/Module.js @@ -302,6 +302,14 @@ export default class Module { return this._getModifiedValue('hullreinforcement'); } + /** + * Get the protection for this module, taking in to account modifications + * @return {Number} the protection of this module + */ + getProtection() { + return this._getModifiedValue('protection'); + } + /** * Get the delay for this module, taking in to account modifications * @return {Number} the delay of this module diff --git a/src/app/shipyard/Ship.js b/src/app/shipyard/Ship.js index 32a1a969..b839a90f 100755 --- a/src/app/shipyard/Ship.js +++ b/src/app/shipyard/Ship.js @@ -452,7 +452,7 @@ export default class Ship { } else if (name === 'shieldboost') { m.setModValue(name, value); this.recalculateShield(); - } else if (name === 'hullboost' || name === 'hullreinforcement') { + } else if (name === 'hullboost' || name === 'hullreinforcement' || name === 'modulereinforcement') { m.setModValue(name, value); this.recalculateArmour(); } else if (name === 'shieldreinforcement') { @@ -801,7 +801,7 @@ export default class Ship { let epsChanged = n && n.getEps() || old && old.getEps(); let hpsChanged = n && n.getHps() || old && old.getHps(); - let armourChange = (slot === this.bulkheads) || (n && n.grp === 'hr') || (old && old.grp === 'hr'); + let armourChange = (slot === this.bulkheads) || (n && n.grp === 'hr') || (old && old.grp === 'hr') || (n && n.grp === 'mrp') || (old && old.grp === 'mrp'); let shieldChange = (n && n.grp === 'bsg') || (old && old.grp === 'bsg') || (n && n.grp === 'psg') || (old && old.grp === 'psg') || (n && n.grp === 'sg') || (old && old.grp === 'sg') || (n && n.grp === 'sb') || (old && old.grp === 'sb'); @@ -1097,10 +1097,13 @@ export default class Ship { this.topBoost = this.canBoost() ? this.speeds[4] * this.boost / this.speed : 0; this.pitches = Calc.pitch(this.unladenMass + this.fuelCapacity, this.pitch, this.standard[1].m, this.pipSpeed); + this.topPitch = this.pitches[4]; this.rolls = Calc.roll(this.unladenMass + this.fuelCapacity, this.roll, this.standard[1].m, this.pipSpeed); + this.topRoll = this.rolls[4]; this.yaws = Calc.yaw(this.unladenMass + this.fuelCapacity, this.yaw, this.standard[1].m, this.pipSpeed); + this.topYaw = this.yaws[4]; return this; } @@ -1111,6 +1114,7 @@ export default class Ship { */ recalculateShield() { let shield = 0; + let shieldBoost = 0; let shieldExplRes = null; let shieldKinRes = null; let shieldThermRes = null; @@ -1118,8 +1122,7 @@ export default class Ship { const sgSlot = this.findInternalByGroup('sg'); if (sgSlot && sgSlot.enabled) { // Shield from generator - const baseShield = Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sgSlot.m, 1); - shield = baseShield; + shield = Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sgSlot.m, 1); shieldExplRes = 1 - sgSlot.m.getExplosiveResistance(); shieldKinRes = 1 - sgSlot.m.getKineticResistance(); shieldThermRes = 1 - sgSlot.m.getThermalResistance(); @@ -1127,7 +1130,8 @@ export default class Ship { // Shield from boosters for (let slot of this.hardpoints) { if (slot.m && slot.m.grp == 'sb') { - shield += baseShield * slot.m.getShieldBoost(); + //shield += baseShield * slot.m.getShieldBoost(); + shieldBoost += slot.m.getShieldBoost(); shieldExplRes *= (1 - slot.m.getExplosiveResistance()); shieldKinRes *= (1 - slot.m.getKineticResistance()); shieldThermRes *= (1 - slot.m.getThermalResistance()); @@ -1135,6 +1139,10 @@ export default class Ship { } } + // We apply diminishing returns to the boosted value + shieldBoost = Math.min(shieldBoost, (1 - Math.pow(Math.E, -0.7 * shieldBoost)) * 2.5); + shield = shield * shieldBoost; + this.shield = shield; this.shieldExplRes = shieldExplRes ? 1 - this.diminishingReturns(1 - shieldExplRes, 0.5, 0.75) : null; this.shieldKinRes = shieldKinRes ? 1 - this.diminishingReturns(1 - shieldKinRes, 0.5, 0.75) : null; @@ -1169,11 +1177,13 @@ export default class Ship { // Armour from bulkheads let bulkhead = this.bulkheads.m; let armour = this.baseArmour + (this.baseArmour * bulkhead.getHullBoost()); + let modulearmour = 0; + let moduleprotection = 1; let hullExplRes = 1 - bulkhead.getExplosiveResistance(); let hullKinRes = 1 - bulkhead.getKineticResistance(); let hullThermRes = 1 - bulkhead.getThermalResistance(); - // Armour from HRPs + // Armour from HRPs and module armour from MRPs for (let slot of this.internal) { if (slot.m && slot.m.grp == 'hr') { armour += slot.m.getHullReinforcement(); @@ -1184,9 +1194,16 @@ export default class Ship { hullKinRes *= (1 - slot.m.getKineticResistance()); hullThermRes *= (1 - slot.m.getThermalResistance()); } + if (slot.m && slot.m.grp == 'mrp') { + modulearmour += slot.m.getIntegrity(); + moduleprotection = moduleprotection * (1 - slot.m.getProtection()); + } } + moduleprotection = 1 - moduleprotection; this.armour = armour; + this.modulearmour = modulearmour; + this.moduleprotection = moduleprotection; this.hullExplRes = 1 - this.diminishingReturns(1 - hullExplRes, 0.5, 0.75); this.hullKinRes = 1 - this.diminishingReturns(1 - hullKinRes, 0.5, 0.75); this.hullThermRes = 1 - this.diminishingReturns(1 - hullThermRes, 0.5, 0.75);