Add weapon mods to damage dealt

This commit is contained in:
Cmdr McDonald
2017-01-27 09:46:32 +00:00
parent 7c8eee4707
commit f5ecccec48
2 changed files with 12 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
#2.2.12 #2.2.12
* Tidy up old references to coriolis.io * Tidy up old references to coriolis.io
* Add ability to add and remove special effects to weapon modifications * Add ability to add and remove special effects to weapon modifications
* Add weapon engineering information to Damage Dealt section
#2.2.11 #2.2.11
* Add help system and initial help file * Add help system and initial help file

View File

@@ -103,6 +103,8 @@ export default class DamageDealt extends TranslatedComponent {
* @return {boolean} Returns the per-weapon damage * @return {boolean} Returns the per-weapon damage
*/ */
_calcWeapons(ship, against, range) { _calcWeapons(ship, against, range) {
const translate = this.context.language.translate;
// Tidy up the range so that it's to 4 decimal places // Tidy up the range so that it's to 4 decimal places
range = Math.round(10000 * range) / 10000; range = Math.round(10000 * range) / 10000;
@@ -137,6 +139,13 @@ export default class DamageDealt extends TranslatedComponent {
} }
} }
const classRating = `${m.class}${m.rating}${m.missile ? '/' + m.missile : ''}`; const classRating = `${m.class}${m.rating}${m.missile ? '/' + m.missile : ''}`;
let engineering;
if (m.blueprint && m.blueprint.name) {
engineering = translate(m.blueprint.name) + ' ' + translate('grade') + ' ' + m.blueprint.grade;
if (m.blueprint.special && m.blueprint.special.id) {
engineering += ', ' + translate(m.blueprint.special.name);
}
}
const effectivenessShields = dropoff; const effectivenessShields = dropoff;
const effectiveDpsShields = m.getDps() * effectivenessShields; const effectiveDpsShields = m.getDps() * effectivenessShields;
const effectiveSDpsShields = (m.getClip() ? (m.getClip() * m.getDps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload()) * effectivenessShields : effectiveDpsShields); const effectiveSDpsShields = (m.getClip() ? (m.getClip() * m.getDps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload()) * effectivenessShields : effectiveDpsShields);
@@ -154,6 +163,7 @@ export default class DamageDealt extends TranslatedComponent {
mount: m.mount, mount: m.mount,
name: m.name || m.grp, name: m.name || m.grp,
classRating, classRating,
engineering,
effectiveDpsShields, effectiveDpsShields,
effectiveSDpsShields, effectiveSDpsShields,
effectivenessShields, effectivenessShields,
@@ -249,6 +259,7 @@ console.log('total effective dps shields is ' + totals.effectiveDpsShields);
{weapon.mount == 'G' ? <span onMouseOver={termtip.bind(null, 'gimballed')} onMouseOut={tooltip.bind(null, null)}><MountGimballed /></span> : null} {weapon.mount == 'G' ? <span onMouseOver={termtip.bind(null, 'gimballed')} onMouseOut={tooltip.bind(null, null)}><MountGimballed /></span> : null}
{weapon.mount == 'T' ? <span onMouseOver={termtip.bind(null, 'turreted')} onMouseOut={tooltip.bind(null, null)}><MountTurret /></span> : null} {weapon.mount == 'T' ? <span onMouseOver={termtip.bind(null, 'turreted')} onMouseOut={tooltip.bind(null, null)}><MountTurret /></span> : null}
{weapon.classRating} {translate(weapon.name)} {weapon.classRating} {translate(weapon.name)}
{weapon.engineering ? ' (' + weapon.engineering + ')' : null }
</td> </td>
<td className='ri'>{formats.round1(weapon.effectiveDpsShields)}</td> <td className='ri'>{formats.round1(weapon.effectiveDpsShields)}</td>
<td className='ri'>{formats.round1(weapon.effectiveSDpsShields)}</td> <td className='ri'>{formats.round1(weapon.effectiveSDpsShields)}</td>