This commit is contained in:
Cmdr McDonald
2016-12-13 18:56:59 +00:00
parent b944035541
commit 041f873f97
11 changed files with 73 additions and 49 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ build
nginx.pid nginx.pid
.idea .idea
/bin /bin
env

View File

@@ -6,6 +6,9 @@
* Fix issue when importing Viper Mk IV * Fix issue when importing Viper Mk IV
* Ensure ordering of all types of modules (standard, internal, utilities) is consistent * Ensure ordering of all types of modules (standard, internal, utilities) is consistent
* Add rebuilds per bay information for fighter hangars * 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 * Use separate speed/rotation/acceleration multipliers for thrusters if available
#2.2.5 #2.2.5

4
env
View File

@@ -1,4 +0,0 @@
CORIOLIS_UA_TRACKING=UA-87944382-1
export CORIOLIS_UA_TRACKING
CORIOLIS_GAPI_KEY=AIzaSyAvuJC2TECa3rulzI5rTyfycYi9T28Xhwc
export CORIOLIS_GAPI_KEY

View File

@@ -223,8 +223,16 @@ export default class AvailableModulesMenu extends TranslatedComponent {
} }
if (a.class > b.class) { if (a.class > b.class) {
return -1; 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) { if (a.rating < b.rating) {
return 1; return 1;
} }

View File

@@ -67,6 +67,17 @@ export default class DefenceSummary extends TranslatedComponent {
<td className='ri' onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /> {formats.pct1(ship.hullKinRes || 1)}</td> <td className='ri' onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /> {formats.pct1(ship.hullKinRes || 1)}</td>
<td className='ri' onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /> {formats.pct1(ship.hullThermRes || 1)}</td> <td className='ri' onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /> {formats.pct1(ship.hullThermRes || 1)}</td>
</tr> </tr>
{ship.modulearmour > 0 ?
<tr>
<td colSpan='4'><h2>{translate('module armour')}: {formats.int(ship.modulearmour)}</h2></td>
</tr> : null }
{ship.moduleprotection > 0 ?
<tr>
<td colSpan='2' className='cn'>{translate('internal protection')} {formats.pct1(ship.moduleprotection)}</td>
<td colSpan='2' className='cn'>{translate('external protection')} {formats.pct1(ship.moduleprotection / 2)}</td>
</tr> : null }
</tbody> </tbody>
</table> </table>
</span> </span>

View File

@@ -59,6 +59,7 @@ export default class InternalSlot extends Slot {
{ m.rangeLS === null ? <div className={'l'}>{u.Ls}</div> : null } { m.rangeLS === null ? <div className={'l'}>{u.Ls}</div> : null }
{ m.rangeRating ? <div className={'l'}>{translate('range')}: {m.rangeRating}</div> : null } { m.rangeRating ? <div className={'l'}>{translate('range')}: {m.rangeRating}</div> : null }
{ m.getHullReinforcement() ? <div className={'l'}>+{formats.int(m.getHullReinforcement() + ship.baseArmour * m.getModValue('hullboost') / 10000)} <u className='cap'>{translate('armour')}</u></div> : null } { m.getHullReinforcement() ? <div className={'l'}>+{formats.int(m.getHullReinforcement() + ship.baseArmour * m.getModValue('hullboost') / 10000)} <u className='cap'>{translate('armour')}</u></div> : null }
{ m.getProtection() ? <div className={'l'}>{formats.rPct(m.getProtection())} <u className='cap'>{translate('protection')}</u></div> : null }
{ m.passengers ? <div className={'l'}>{translate('passengers')}: {m.passengers}</div> : null } { m.passengers ? <div className={'l'}>{translate('passengers')}: {m.passengers}</div> : null }
{ showModuleResistances && m.getExplosiveResistance() ? <div className='l'>{translate('explres')}: {formats.pct(m.getExplosiveResistance())}</div> : null } { showModuleResistances && m.getExplosiveResistance() ? <div className='l'>{translate('explres')}: {formats.pct(m.getExplosiveResistance())}</div> : null }
{ showModuleResistances && m.getKineticResistance() ? <div className='l'>{translate('kinres')}: {formats.pct(m.getKineticResistance())}</div> : null } { showModuleResistances && m.getKineticResistance() ? <div className='l'>{translate('kinres')}: {formats.pct(m.getKineticResistance())}</div> : null }

View File

@@ -88,38 +88,5 @@ export default class MovementSummary extends TranslatedComponent {
</table> </table>
</span> </span>
); );
// return (
// <span>
// <h1>{translate('movement summary')}</h1>
// <table className='summary' style={{ marginLeft: 'auto', marginRight: 'auto', lineHeight: '1em', backgroundColor: 'transparent' }}>
// <tbody>
// <tr>
// <td colSpan='4' className='summary'><h2>{translate('normal')}</h2></td>
// </tr>
// <tr>
// <td className='summary'>{translate('speed')} {formats.int(ship.topSpeed)}{units['m/s']}</td>
// <td className='summary'>{translate('pitch')} {formats.f1(ship.pitches[4])}{units['°/s']}</td>
// <td className='summary'>{translate('roll')} {formats.f1(ship.rolls[4])}{units['°/s']}</td>
// <td className='summary'>{translate('yaw')} {formats.f1(ship.yaws[4])}{units['°/s']}</td>
// </tr>
// <tr>
// <td colSpan='4' className='summary'><h2>{translate('boost')}</h2></td>
// </tr>
// <tr>
// <td className='summary'>{translate('speed')} {formats.int(ship.topSpeed * boostMultiplier)}{units['m/s']}</td>
// <td className='summary'>{translate('pitch')} {formats.f1(ship.pitches[4] * boostMultiplier)}{units['°/s']}</td>
// <td className='summary'>{translate('roll')} {formats.f1(ship.rolls[4] * boostMultiplier)}{units['°/s']}</td>
// <td className='summary'>{translate('yaw')} {formats.f1(ship.yaws[4] * boostMultiplier)}{units['°/s']}</td>
// </tr>
// <tr>
// <td colSpan='4' className='summary'><h2>Frame Shift</h2></td>
// </tr>
// <tr>
// <td colSpan='4' className='summary'>Maximum {formats.f2(ship.fullTankRange)} {units.LY}</td>
// </tr>
// </tbody>
// </table>
// </span>
// );
} }
} }

View File

@@ -59,6 +59,7 @@ export const terms = {
mc: 'Multi-cannon', mc: 'Multi-cannon',
ml: 'Mining Laser', ml: 'Mining Laser',
mr: 'Missile Rack', mr: 'Missile Rack',
mrp: 'Module Reinforcement Package',
nl: 'Mine Launcher', nl: 'Mine Launcher',
pa: 'Plasma Accelerator', pa: 'Plasma Accelerator',
pas: 'Planetary Approach Suite', pas: 'Planetary Approach Suite',
@@ -116,6 +117,8 @@ export const terms = {
'pitch': 'Pitch', 'pitch': 'Pitch',
'roll': 'Roll', 'roll': 'Roll',
'yaw': 'Yaw', 'yaw': 'Yaw',
'internal protection': 'Internal protection',
'external protection': 'External protection',
// Modifications // Modifications
ammo: 'Ammunition maximum', ammo: 'Ammunition maximum',
@@ -144,6 +147,7 @@ export const terms = {
pgen: 'Power generation', pgen: 'Power generation',
piercing: 'Piercing', piercing: 'Piercing',
power: 'Power draw', power: 'Power draw',
protection: 'Protection',
range: 'Range', range: 'Range',
ranget: 'Range', // Range in time (for FSD interdictor) ranget: 'Range', // Range in time (for FSD interdictor)
regen: 'Regeneration rate', regen: 'Regeneration rate',

View File

@@ -105,8 +105,9 @@ export const BulkheadNames = [
export const ShipFacets = [ export const ShipFacets = [
{ // 0 { // 0
title: 'agility', title: 'agility',
props: ['agility'], props: ['topPitch', 'topRoll', 'topYaw'],
fmt: 'int', lbls: ['pitch', 'roll', 'yaw'],
fmt: 'f1',
i: 0 i: 0
}, },
{ // 1 { // 1
@@ -185,11 +186,18 @@ export const ShipFacets = [
}, },
{ // 11 { // 11
title: 'DPS', title: 'DPS',
props: ['totalDps'], props: ['totalDps', 'totalExplDps', 'totalKinDps', 'totalThermDps'],
lbls: ['DPS'], lbls: ['total', 'explosive', 'kinetic', 'thermal'],
fmt: 'round', fmt: 'round',
i: 11 i: 11
}, },
{ // 14
title: 'Sustained DPS',
props: ['totalSDps', 'totalExplSDps', 'totalKinSDps', 'totalThermSDps'],
lbls: ['total', 'explosive', 'kinetic', 'thermal'],
fmt: 'round',
i: 14
},
{ // 12 { // 12
title: 'EPS', title: 'EPS',
props: ['totalEps'], props: ['totalEps'],

View File

@@ -302,6 +302,14 @@ export default class Module {
return this._getModifiedValue('hullreinforcement'); 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 * Get the delay for this module, taking in to account modifications
* @return {Number} the delay of this module * @return {Number} the delay of this module

View File

@@ -452,7 +452,7 @@ export default class Ship {
} else if (name === 'shieldboost') { } else if (name === 'shieldboost') {
m.setModValue(name, value); m.setModValue(name, value);
this.recalculateShield(); this.recalculateShield();
} else if (name === 'hullboost' || name === 'hullreinforcement') { } else if (name === 'hullboost' || name === 'hullreinforcement' || name === 'modulereinforcement') {
m.setModValue(name, value); m.setModValue(name, value);
this.recalculateArmour(); this.recalculateArmour();
} else if (name === 'shieldreinforcement') { } else if (name === 'shieldreinforcement') {
@@ -801,7 +801,7 @@ export default class Ship {
let epsChanged = n && n.getEps() || old && old.getEps(); let epsChanged = n && n.getEps() || old && old.getEps();
let hpsChanged = n && n.getHps() || old && old.getHps(); 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'); 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.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.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.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.yaws = Calc.yaw(this.unladenMass + this.fuelCapacity, this.yaw, this.standard[1].m, this.pipSpeed);
this.topYaw = this.yaws[4];
return this; return this;
} }
@@ -1111,6 +1114,7 @@ export default class Ship {
*/ */
recalculateShield() { recalculateShield() {
let shield = 0; let shield = 0;
let shieldBoost = 0;
let shieldExplRes = null; let shieldExplRes = null;
let shieldKinRes = null; let shieldKinRes = null;
let shieldThermRes = null; let shieldThermRes = null;
@@ -1118,8 +1122,7 @@ export default class Ship {
const sgSlot = this.findInternalByGroup('sg'); const sgSlot = this.findInternalByGroup('sg');
if (sgSlot && sgSlot.enabled) { if (sgSlot && sgSlot.enabled) {
// Shield from generator // Shield from generator
const baseShield = Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sgSlot.m, 1); shield = Calc.shieldStrength(this.hullMass, this.baseShieldStrength, sgSlot.m, 1);
shield = baseShield;
shieldExplRes = 1 - sgSlot.m.getExplosiveResistance(); shieldExplRes = 1 - sgSlot.m.getExplosiveResistance();
shieldKinRes = 1 - sgSlot.m.getKineticResistance(); shieldKinRes = 1 - sgSlot.m.getKineticResistance();
shieldThermRes = 1 - sgSlot.m.getThermalResistance(); shieldThermRes = 1 - sgSlot.m.getThermalResistance();
@@ -1127,7 +1130,8 @@ export default class Ship {
// Shield from boosters // Shield from boosters
for (let slot of this.hardpoints) { for (let slot of this.hardpoints) {
if (slot.m && slot.m.grp == 'sb') { 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()); shieldExplRes *= (1 - slot.m.getExplosiveResistance());
shieldKinRes *= (1 - slot.m.getKineticResistance()); shieldKinRes *= (1 - slot.m.getKineticResistance());
shieldThermRes *= (1 - slot.m.getThermalResistance()); 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.shield = shield;
this.shieldExplRes = shieldExplRes ? 1 - this.diminishingReturns(1 - shieldExplRes, 0.5, 0.75) : null; 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; this.shieldKinRes = shieldKinRes ? 1 - this.diminishingReturns(1 - shieldKinRes, 0.5, 0.75) : null;
@@ -1169,11 +1177,13 @@ export default class Ship {
// Armour from bulkheads // Armour from bulkheads
let bulkhead = this.bulkheads.m; let bulkhead = this.bulkheads.m;
let armour = this.baseArmour + (this.baseArmour * bulkhead.getHullBoost()); let armour = this.baseArmour + (this.baseArmour * bulkhead.getHullBoost());
let modulearmour = 0;
let moduleprotection = 1;
let hullExplRes = 1 - bulkhead.getExplosiveResistance(); let hullExplRes = 1 - bulkhead.getExplosiveResistance();
let hullKinRes = 1 - bulkhead.getKineticResistance(); let hullKinRes = 1 - bulkhead.getKineticResistance();
let hullThermRes = 1 - bulkhead.getThermalResistance(); let hullThermRes = 1 - bulkhead.getThermalResistance();
// Armour from HRPs // Armour from HRPs and module armour from MRPs
for (let slot of this.internal) { for (let slot of this.internal) {
if (slot.m && slot.m.grp == 'hr') { if (slot.m && slot.m.grp == 'hr') {
armour += slot.m.getHullReinforcement(); armour += slot.m.getHullReinforcement();
@@ -1184,9 +1194,16 @@ export default class Ship {
hullKinRes *= (1 - slot.m.getKineticResistance()); hullKinRes *= (1 - slot.m.getKineticResistance());
hullThermRes *= (1 - slot.m.getThermalResistance()); 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.armour = armour;
this.modulearmour = modulearmour;
this.moduleprotection = moduleprotection;
this.hullExplRes = 1 - this.diminishingReturns(1 - hullExplRes, 0.5, 0.75); this.hullExplRes = 1 - this.diminishingReturns(1 - hullExplRes, 0.5, 0.75);
this.hullKinRes = 1 - this.diminishingReturns(1 - hullKinRes, 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); this.hullThermRes = 1 - this.diminishingReturns(1 - hullThermRes, 0.5, 0.75);