mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Fix axis for effectice shield
This commit is contained in:
@@ -55,6 +55,7 @@ export default class Defence extends TranslatedComponent {
|
|||||||
*/
|
*/
|
||||||
_calcMetrics(ship, opponent, sys) {
|
_calcMetrics(ship, opponent, sys) {
|
||||||
const sysResistance = this._calcSysResistance(sys);
|
const sysResistance = this._calcSysResistance(sys);
|
||||||
|
const maxSysResistance = this._calcSysResistance(4);
|
||||||
|
|
||||||
// Obtain the opponent's sustained DPS for later damage calculations
|
// Obtain the opponent's sustained DPS for later damage calculations
|
||||||
// const opponentSDps = Calc.sustainedDps(opponent, range);
|
// const opponentSDps = Calc.sustainedDps(opponent, range);
|
||||||
@@ -109,28 +110,32 @@ export default class Defence extends TranslatedComponent {
|
|||||||
generator: 1,
|
generator: 1,
|
||||||
boosters: 1,
|
boosters: 1,
|
||||||
sys: 1 - sysResistance,
|
sys: 1 - sysResistance,
|
||||||
total: 1 - sysResistance
|
total: 1 - sysResistance,
|
||||||
|
max: 1 - maxSysResistance
|
||||||
};
|
};
|
||||||
|
|
||||||
shield.explosive = {
|
shield.explosive = {
|
||||||
generator: 1 - shieldGenerator.getExplosiveResistance(),
|
generator: 1 - shieldGenerator.getExplosiveResistance(),
|
||||||
boosters: boosterExplDmg,
|
boosters: boosterExplDmg,
|
||||||
sys: (1 - sysResistance),
|
sys: (1 - sysResistance),
|
||||||
total: (1 - shieldGenerator.getExplosiveResistance()) * boosterExplDmg * (1 - sysResistance)
|
total: (1 - shieldGenerator.getExplosiveResistance()) * boosterExplDmg * (1 - sysResistance),
|
||||||
|
max: (1 - shieldGenerator.getExplosiveResistance()) * boosterExplDmg * (1 - maxSysResistance)
|
||||||
};
|
};
|
||||||
|
|
||||||
shield.kinetic = {
|
shield.kinetic = {
|
||||||
generator: 1 - shieldGenerator.getKineticResistance(),
|
generator: 1 - shieldGenerator.getKineticResistance(),
|
||||||
boosters: boosterKinDmg,
|
boosters: boosterKinDmg,
|
||||||
sys: (1 - sysResistance),
|
sys: (1 - sysResistance),
|
||||||
total: (1 - shieldGenerator.getKineticResistance()) * boosterKinDmg * (1 - sysResistance)
|
total: (1 - shieldGenerator.getKineticResistance()) * boosterKinDmg * (1 - sysResistance),
|
||||||
|
max: (1 - shieldGenerator.getKineticResistance()) * boosterKinDmg * (1 - maxSysResistance)
|
||||||
};
|
};
|
||||||
|
|
||||||
shield.thermal = {
|
shield.thermal = {
|
||||||
generator: 1 - shieldGenerator.getThermalResistance(),
|
generator: 1 - shieldGenerator.getThermalResistance(),
|
||||||
boosters: boosterThermDmg,
|
boosters: boosterThermDmg,
|
||||||
sys: (1 - sysResistance),
|
sys: (1 - sysResistance),
|
||||||
total: (1 - shieldGenerator.getThermalResistance()) * boosterThermDmg * (1 - sysResistance)
|
total: (1 - shieldGenerator.getThermalResistance()) * boosterThermDmg * (1 - sysResistance),
|
||||||
|
max: (1 - shieldGenerator.getThermalResistance()) * boosterThermDmg * (1 - maxSysResistance)
|
||||||
};
|
};
|
||||||
|
|
||||||
shielddamage.absolutesdps = opponentSDps.absolute *= shield.absolute.total;
|
shielddamage.absolutesdps = opponentSDps.absolute *= shield.absolute.total;
|
||||||
@@ -239,6 +244,7 @@ export default class Defence extends TranslatedComponent {
|
|||||||
const shieldExplosiveTooltipDetails = [];
|
const shieldExplosiveTooltipDetails = [];
|
||||||
const shieldKineticTooltipDetails = [];
|
const shieldKineticTooltipDetails = [];
|
||||||
const shieldThermalTooltipDetails = [];
|
const shieldThermalTooltipDetails = [];
|
||||||
|
let maxEffectiveShield = 0;
|
||||||
if (shield.total) {
|
if (shield.total) {
|
||||||
if (Math.round(shield.generator) > 0) shieldSourcesData.push({ value: Math.round(shield.generator), label: translate('generator') });
|
if (Math.round(shield.generator) > 0) shieldSourcesData.push({ value: Math.round(shield.generator), label: translate('generator') });
|
||||||
if (Math.round(shield.boosters) > 0) shieldSourcesData.push({ value: Math.round(shield.boosters), label: translate('boosters') });
|
if (Math.round(shield.boosters) > 0) shieldSourcesData.push({ value: Math.round(shield.boosters), label: translate('boosters') });
|
||||||
@@ -277,6 +283,9 @@ export default class Defence extends TranslatedComponent {
|
|||||||
shieldDamageTakenData.push({ value: Math.round(shield.explosive.total * 100), label: translate('explosive') });
|
shieldDamageTakenData.push({ value: Math.round(shield.explosive.total * 100), label: translate('explosive') });
|
||||||
shieldDamageTakenData.push({ value: Math.round(shield.kinetic.total * 100), label: translate('kinetic') });
|
shieldDamageTakenData.push({ value: Math.round(shield.kinetic.total * 100), label: translate('kinetic') });
|
||||||
shieldDamageTakenData.push({ value: Math.round(shield.thermal.total * 100), label: translate('thermal') });
|
shieldDamageTakenData.push({ value: Math.round(shield.thermal.total * 100), label: translate('thermal') });
|
||||||
|
|
||||||
|
console.log(`max effective shields are ${shield.absolute.max}/${shield.explosive.max}/${shield.kinetic.max}/${shield.thermal.max}`);
|
||||||
|
maxEffectiveShield = Math.max(shield.total / shield.absolute.max, shield.total / shield.explosive.max, shield.total / shield.kinetic.max, shield.total / shield.thermal.max);
|
||||||
}
|
}
|
||||||
|
|
||||||
const armourSourcesData = [];
|
const armourSourcesData = [];
|
||||||
@@ -336,14 +345,14 @@ export default class Defence extends TranslatedComponent {
|
|||||||
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_SHIELD_SOURCES'))} onMouseOut={tooltip.bind(null, null)}>{translate('shield sources')}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_SHIELD_SOURCES'))} onMouseOut={tooltip.bind(null, null)}>{translate('shield sources')}</h2>
|
||||||
<PieChart data={shieldSourcesData} />
|
<PieChart data={shieldSourcesData} />
|
||||||
</div>
|
</div>
|
||||||
<div className='group quarter'>
|
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_EFFECTIVE_SHIELD'))} onMouseOut={tooltip.bind(null, null)}>{translate('effective shield')}(MJ)</h2>
|
|
||||||
<VerticalBarChart data={effectiveShieldData} />
|
|
||||||
</div>
|
|
||||||
<div className='group quarter'>
|
<div className='group quarter'>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_DAMAGE_TAKEN'))} onMouseOut={tooltip.bind(null, null)}>{translate('damage taken')}(%)</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_DAMAGE_TAKEN'))} onMouseOut={tooltip.bind(null, null)}>{translate('damage taken')}(%)</h2>
|
||||||
<VerticalBarChart data={shieldDamageTakenData} yMax={100} />
|
<VerticalBarChart data={shieldDamageTakenData} yMax={100} />
|
||||||
</div>
|
</div>
|
||||||
|
<div className='group quarter'>
|
||||||
|
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_EFFECTIVE_SHIELD'))} onMouseOut={tooltip.bind(null, null)}>{translate('effective shield')}(MJ)</h2>
|
||||||
|
<VerticalBarChart data={effectiveShieldData} yMax={maxEffectiveShield}/>
|
||||||
|
</div>
|
||||||
</span> : null }
|
</span> : null }
|
||||||
|
|
||||||
<div className='group quarter'>
|
<div className='group quarter'>
|
||||||
@@ -354,14 +363,14 @@ export default class Defence extends TranslatedComponent {
|
|||||||
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_ARMOUR_SOURCES'))} onMouseOut={tooltip.bind(null, null)}>{translate('armour sources')}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_ARMOUR_SOURCES'))} onMouseOut={tooltip.bind(null, null)}>{translate('armour sources')}</h2>
|
||||||
<PieChart data={armourSourcesData} />
|
<PieChart data={armourSourcesData} />
|
||||||
</div>
|
</div>
|
||||||
<div className='group quarter'>
|
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_EFFECTIVE_ARMOUR'))} onMouseOut={tooltip.bind(null, null)}>{translate('effective armour')}</h2>
|
|
||||||
<VerticalBarChart data={effectiveArmourData} />
|
|
||||||
</div>
|
|
||||||
<div className='group quarter'>
|
<div className='group quarter'>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_DAMAGE_TAKEN'))} onMouseOut={tooltip.bind(null, null)}>{translate('damage taken')}(%)</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_DAMAGE_TAKEN'))} onMouseOut={tooltip.bind(null, null)}>{translate('damage taken')}(%)</h2>
|
||||||
<VerticalBarChart data={armourDamageTakenData} yMax={100} />
|
<VerticalBarChart data={armourDamageTakenData} yMax={100} />
|
||||||
</div>
|
</div>
|
||||||
|
<div className='group quarter'>
|
||||||
|
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_EFFECTIVE_ARMOUR'))} onMouseOut={tooltip.bind(null, null)}>{translate('effective armour')}</h2>
|
||||||
|
<VerticalBarChart data={effectiveArmourData} />
|
||||||
|
</div>
|
||||||
</span>);
|
</span>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user