import React from 'react'; import cn from 'classnames'; import TranslatedComponent from './TranslatedComponent'; import { DamageKinetic, DamageThermal, DamageExplosive } from './SvgIcons'; /** * Defence summary */ export default class DefenceSummary extends TranslatedComponent { static PropTypes = { ship: React.PropTypes.object.isRequired }; /** * Constructor * @param {Object} props React Component properties */ constructor(props) { super(props); } /** * Render defence summary * @return {React.Component} contents */ render() { let ship = this.props.ship; let { language, tooltip, termtip } = this.context; let { formats, translate, units } = language; let hide = tooltip.bind(null, null); const shieldGenerator = ship.findShieldGenerator(); // Damage values are 1 - resistance values return (

{translate('defence summary')}

{ship.shield ? : null } {ship.shield ? : null } {ship.shield ? : null } { ship.shield && ship.shieldCells ? : null } {ship.modulearmour > 0 ? : null } {ship.moduleprotection > 0 ? : null }

{translate('shields')}: {formats.int(ship.shield)} {units.MJ}

{translate('recovery')} {formats.time(ship.calcShieldRecovery())} {translate('recharge')} {formats.time(ship.calcShieldRecharge())}
{translate('damage from')}   {formats.pct1(1 - ship.shieldExplRes)}   {formats.pct1(1 - ship.shieldKinRes)}   {formats.pct1(1 - ship.shieldThermRes)}

{translate('shield cells')}: {formats.int(ship.shieldCells)} {units.MJ}

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

{translate('damage from')}   {formats.pct1(1 - ship.hullExplRes)}   {formats.pct1(1 - ship.hullKinRes)}   {formats.pct1(1 - ship.hullThermRes)}

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

{translate('internal protection')} {formats.pct1(ship.moduleprotection)} {translate('external protection')} {formats.pct1(ship.moduleprotection / 2)}
); } }