mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 15:15:34 +00:00
Make absolute damage visible
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#2.2.11
|
#2.2.11
|
||||||
* Add help system and initial help file
|
* Add help system and initial help file
|
||||||
|
* Make absolute damage visible
|
||||||
|
|
||||||
#2.2.10
|
#2.2.10
|
||||||
* Fix detailed export of module reinforcement packages
|
* Fix detailed export of module reinforcement packages
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Slot from './Slot';
|
import Slot from './Slot';
|
||||||
import Persist from '../stores/Persist';
|
import Persist from '../stores/Persist';
|
||||||
import { DamageKinetic, DamageThermal, DamageExplosive, MountFixed, MountGimballed, MountTurret, ListModifications, Modified } from './SvgIcons';
|
import { DamageAbsolute, DamageKinetic, DamageThermal, DamageExplosive, MountFixed, MountGimballed, MountTurret, ListModifications, Modified } from './SvgIcons';
|
||||||
import { Modifications } from 'coriolis-data/dist';
|
import { Modifications } from 'coriolis-data/dist';
|
||||||
import { stopCtxPropagation } from '../utils/UtilityFunctions';
|
import { stopCtxPropagation } from '../utils/UtilityFunctions';
|
||||||
|
|
||||||
@@ -62,6 +62,7 @@ export default class HardpointSlot extends Slot {
|
|||||||
{m.getDamageDist() && m.getDamageDist().K ? <span onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /></span> : ''}
|
{m.getDamageDist() && m.getDamageDist().K ? <span onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /></span> : ''}
|
||||||
{m.getDamageDist() && m.getDamageDist().T ? <span onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /></span> : ''}
|
{m.getDamageDist() && m.getDamageDist().T ? <span onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /></span> : ''}
|
||||||
{m.getDamageDist() && m.getDamageDist().E ? <span onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /></span> : ''}
|
{m.getDamageDist() && m.getDamageDist().E ? <span onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /></span> : ''}
|
||||||
|
{m.getDamageDist() && m.getDamageDist().A ? <span onMouseOver={termtip.bind(null, 'absolute')} onMouseOut={tooltip.bind(null, null)}><DamageAbsolute /></span> : ''}
|
||||||
{classRating} {translate(m.name || m.grp)}{ m.mods && Object.keys(m.mods).length > 0 ? <span className='r' onMouseOver={termtip.bind(null, modTT)} onMouseOut={tooltip.bind(null, null)}><Modified /></span> : null }
|
{classRating} {translate(m.name || m.grp)}{ m.mods && Object.keys(m.mods).length > 0 ? <span className='r' onMouseOver={termtip.bind(null, modTT)} onMouseOut={tooltip.bind(null, null)}><Modified /></span> : null }
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import TranslatedComponent from './TranslatedComponent';
|
import TranslatedComponent from './TranslatedComponent';
|
||||||
import { DamageKinetic, DamageThermal, DamageExplosive } from './SvgIcons';
|
import { DamageAbsolute, DamageKinetic, DamageThermal, DamageExplosive } from './SvgIcons';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Offence summary
|
* Offence summary
|
||||||
@@ -34,30 +34,33 @@ export default class OffenceSummary extends TranslatedComponent {
|
|||||||
<table className='summary' style={{ marginLeft: 'auto', marginRight: 'auto', lineHeight: '1em', backgroundColor: 'transparent' }}>
|
<table className='summary' style={{ marginLeft: 'auto', marginRight: 'auto', lineHeight: '1em', backgroundColor: 'transparent' }}>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan='4' className='summary'><h2>{translate('dps')}: {formats.f1(ship.totalDps)}</h2></td>
|
<td colSpan='5' className='summary'><h2>{translate('dps')}: {formats.f1(ship.totalDps)}</h2></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td className='le'>{translate('damage by')}</td>
|
<td className='le'>{translate('damage by')}</td>
|
||||||
|
<td className='ri' onMouseOver={termtip.bind(null, 'absolute')} onMouseOut={tooltip.bind(null, null)}><DamageAbsolute /> {formats.f1(ship.totalAbsDps)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /> {formats.f1(ship.totalExplDps)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /> {formats.f1(ship.totalExplDps)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /> {formats.f1(ship.totalKinDps)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /> {formats.f1(ship.totalKinDps)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /> {formats.f1(ship.totalThermDps)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /> {formats.f1(ship.totalThermDps)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan='4' className='summary'><h2>{translate('sdps')}: {formats.f1(ship.totalSDps)}</h2></td>
|
<td colSpan='5' className='summary'><h2>{translate('sdps')}: {formats.f1(ship.totalSDps)}</h2></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td className='le'>{translate('damage by')}</td>
|
<td className='le'>{translate('damage by')}</td>
|
||||||
|
<td className='ri' onMouseOver={termtip.bind(null, 'absolute')} onMouseOut={tooltip.bind(null, null)}><DamageAbsolute /> {formats.f1(ship.totalAbsSDps)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /> {formats.f1(ship.totalExplSDps)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /> {formats.f1(ship.totalExplSDps)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /> {formats.f1(ship.totalKinSDps)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /> {formats.f1(ship.totalKinSDps)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /> {formats.f1(ship.totalThermSDps)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /> {formats.f1(ship.totalThermSDps)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan='4' className='summary'><h2>{translate('dpe')}: {formats.f1(ship.totalDpe)}</h2></td>
|
<td colSpan='5' className='summary'><h2>{translate('dpe')}: {formats.f1(ship.totalDpe)}</h2></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td className='le'>{translate('damage by')}</td>
|
<td className='le'>{translate('damage by')}</td>
|
||||||
|
<td className='ri' onMouseOver={termtip.bind(null, 'absolute')} onMouseOut={tooltip.bind(null, null)}><DamageAbsolute /> {formats.f1(ship.totalAbsDpe)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /> {formats.f1(ship.totalExplDpe)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /> {formats.f1(ship.totalExplDpe)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /> {formats.f1(ship.totalKinDpe)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /> {formats.f1(ship.totalKinDpe)}</td>
|
||||||
<td className='ri' onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /> {formats.f1(ship.totalThermDpe)}</td>
|
<td className='ri' onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /> {formats.f1(ship.totalThermDpe)}</td>
|
||||||
|
|||||||
@@ -319,6 +319,24 @@ export class Warning extends SvgIcon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Absolute damage
|
||||||
|
*/
|
||||||
|
export class DamageAbsolute extends SvgIcon {
|
||||||
|
/**
|
||||||
|
* Overriden view box
|
||||||
|
* @return {String} view box
|
||||||
|
*/
|
||||||
|
viewBox() { return '0 0 200 200'; }
|
||||||
|
/**
|
||||||
|
* Generate the SVG
|
||||||
|
* @return {React.Component} SVG Contents
|
||||||
|
*/
|
||||||
|
svg() {
|
||||||
|
return <ellipse cx='100' cy='100' rx='90' ry='90' fillOpacity='0' />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Thermal damage
|
* Thermal damage
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -533,14 +533,17 @@ export default class Ship {
|
|||||||
this.totalCost = this.m.incCost ? this.m.discountedCost : 0;
|
this.totalCost = this.m.incCost ? this.m.discountedCost : 0;
|
||||||
this.unladenMass = this.hullMass;
|
this.unladenMass = this.hullMass;
|
||||||
this.totalDpe = 0;
|
this.totalDpe = 0;
|
||||||
|
this.totalAbsDpe = 0;
|
||||||
this.totalExplDpe = 0;
|
this.totalExplDpe = 0;
|
||||||
this.totalKinDpe = 0;
|
this.totalKinDpe = 0;
|
||||||
this.totalThermDpe = 0;
|
this.totalThermDpe = 0;
|
||||||
this.totalDps = 0;
|
this.totalDps = 0;
|
||||||
|
this.totalAbsDps = 0;
|
||||||
this.totalExplDps = 0;
|
this.totalExplDps = 0;
|
||||||
this.totalKinDps = 0;
|
this.totalKinDps = 0;
|
||||||
this.totalThermDps = 0;
|
this.totalThermDps = 0;
|
||||||
this.totalSDps = 0;
|
this.totalSDps = 0;
|
||||||
|
this.totalAbsSDps = 0;
|
||||||
this.totalExplSDps = 0;
|
this.totalExplSDps = 0;
|
||||||
this.totalKinSDps = 0;
|
this.totalKinSDps = 0;
|
||||||
this.totalThermSDps = 0;
|
this.totalThermSDps = 0;
|
||||||
@@ -958,14 +961,17 @@ export default class Ship {
|
|||||||
*/
|
*/
|
||||||
recalculateDps() {
|
recalculateDps() {
|
||||||
let totalDpe = 0;
|
let totalDpe = 0;
|
||||||
|
let totalAbsDpe = 0;
|
||||||
let totalExplDpe = 0;
|
let totalExplDpe = 0;
|
||||||
let totalKinDpe = 0;
|
let totalKinDpe = 0;
|
||||||
let totalThermDpe = 0;
|
let totalThermDpe = 0;
|
||||||
let totalDps = 0;
|
let totalDps = 0;
|
||||||
|
let totalAbsDps = 0;
|
||||||
let totalExplDps = 0;
|
let totalExplDps = 0;
|
||||||
let totalKinDps = 0;
|
let totalKinDps = 0;
|
||||||
let totalThermDps = 0;
|
let totalThermDps = 0;
|
||||||
let totalSDps = 0;
|
let totalSDps = 0;
|
||||||
|
let totalAbsSDps = 0;
|
||||||
let totalExplSDps = 0;
|
let totalExplSDps = 0;
|
||||||
let totalKinSDps = 0;
|
let totalKinSDps = 0;
|
||||||
let totalThermSDps = 0;
|
let totalThermSDps = 0;
|
||||||
@@ -981,6 +987,11 @@ export default class Ship {
|
|||||||
totalDps += dps;
|
totalDps += dps;
|
||||||
totalSDps += sdps;
|
totalSDps += sdps;
|
||||||
if (slot.m.getDamageDist()) {
|
if (slot.m.getDamageDist()) {
|
||||||
|
if (slot.m.getDamageDist().A) {
|
||||||
|
totalAbsDpe += dpe * slot.m.getDamageDist().A;
|
||||||
|
totalAbsDps += dps * slot.m.getDamageDist().A;
|
||||||
|
totalAbsSDps += sdps * slot.m.getDamageDist().A;
|
||||||
|
}
|
||||||
if (slot.m.getDamageDist().E) {
|
if (slot.m.getDamageDist().E) {
|
||||||
totalExplDpe += dpe * slot.m.getDamageDist().E;
|
totalExplDpe += dpe * slot.m.getDamageDist().E;
|
||||||
totalExplDps += dps * slot.m.getDamageDist().E;
|
totalExplDps += dps * slot.m.getDamageDist().E;
|
||||||
@@ -1001,14 +1012,17 @@ export default class Ship {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.totalDpe = totalDpe;
|
this.totalDpe = totalDpe;
|
||||||
|
this.totalAbsDpe = totalAbsDpe;
|
||||||
this.totalExplDpe = totalExplDpe;
|
this.totalExplDpe = totalExplDpe;
|
||||||
this.totalKinDpe = totalKinDpe;
|
this.totalKinDpe = totalKinDpe;
|
||||||
this.totalThermDpe = totalThermDpe;
|
this.totalThermDpe = totalThermDpe;
|
||||||
this.totalDps = totalDps;
|
this.totalDps = totalDps;
|
||||||
|
this.totalAbsDps = totalAbsDps;
|
||||||
this.totalExplDps = totalExplDps;
|
this.totalExplDps = totalExplDps;
|
||||||
this.totalKinDps = totalKinDps;
|
this.totalKinDps = totalKinDps;
|
||||||
this.totalThermDps = totalThermDps;
|
this.totalThermDps = totalThermDps;
|
||||||
this.totalSDps = totalSDps;
|
this.totalSDps = totalSDps;
|
||||||
|
this.totalAbsSDps = totalAbsSDps;
|
||||||
this.totalExplSDps = totalExplSDps;
|
this.totalExplSDps = totalExplSDps;
|
||||||
this.totalKinSDps = totalKinSDps;
|
this.totalKinSDps = totalKinSDps;
|
||||||
this.totalThermSDps = totalThermSDps;
|
this.totalThermSDps = totalThermSDps;
|
||||||
|
|||||||
Reference in New Issue
Block a user