mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 06:43:24 +00:00
Use opponent's pip info
This commit is contained in:
@@ -18,7 +18,8 @@ export default class Defence extends TranslatedComponent {
|
|||||||
ship: React.PropTypes.object.isRequired,
|
ship: React.PropTypes.object.isRequired,
|
||||||
opponent: React.PropTypes.object.isRequired,
|
opponent: React.PropTypes.object.isRequired,
|
||||||
engagementrange: React.PropTypes.number.isRequired,
|
engagementrange: React.PropTypes.number.isRequired,
|
||||||
sys: React.PropTypes.number.isRequired
|
sys: React.PropTypes.number.isRequired,
|
||||||
|
opponentWep: React.PropTypes.number.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -28,7 +29,7 @@ export default class Defence extends TranslatedComponent {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
const { shield, armour, shielddamage, armourdamage } = Calc.defenceMetrics(props.ship, props.opponent, props.sys, props.engagementrange);
|
const { shield, armour, shielddamage, armourdamage } = Calc.defenceMetrics(props.ship, props.opponent, props.sys, props.opponentWep, props.engagementrange);
|
||||||
this.state = { shield, armour, shielddamage, armourdamage };
|
this.state = { shield, armour, shielddamage, armourdamage };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ export default class Defence extends TranslatedComponent {
|
|||||||
*/
|
*/
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.marker != nextProps.marker || this.props.sys != nextProps.sys) {
|
if (this.props.marker != nextProps.marker || this.props.sys != nextProps.sys) {
|
||||||
const { shield, armour, shielddamage, armourdamage } = Calc.defenceMetrics(nextProps.ship, nextProps.opponent, nextProps.sys, nextProps.engagementrange);
|
const { shield, armour, shielddamage, armourdamage } = Calc.defenceMetrics(nextProps.ship, nextProps.opponent, nextProps.sys, nextProps.opponentWep, nextProps.engagementrange);
|
||||||
this.setState({ shield, armour, shielddamage, armourdamage });
|
this.setState({ shield, armour, shielddamage, armourdamage });
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -50,7 +51,7 @@ export default class Defence extends TranslatedComponent {
|
|||||||
* @return {React.Component} contents
|
* @return {React.Component} contents
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
const { ship, sys } = this.props;
|
const { ship, sys, opponentWep } = this.props;
|
||||||
const { language, tooltip, termtip } = this.context;
|
const { language, tooltip, termtip } = this.context;
|
||||||
const { formats, translate, units } = language;
|
const { formats, translate, units } = language;
|
||||||
const { shield, armour, shielddamage, armourdamage } = this.state;
|
const { shield, armour, shielddamage, armourdamage } = this.state;
|
||||||
@@ -155,7 +156,7 @@ export default class Defence extends TranslatedComponent {
|
|||||||
<h2>{translate('shield metrics')}</h2>
|
<h2>{translate('shield metrics')}</h2>
|
||||||
<br/>
|
<br/>
|
||||||
<h2 onMouseOver={termtip.bind(null, <div>{shieldTooltipDetails}</div>)} onMouseOut={tooltip.bind(null, null)} className='summary'>{translate('raw shield strength')}<br/>{formats.int(shield.total)}{units.MJ}</h2>
|
<h2 onMouseOver={termtip.bind(null, <div>{shieldTooltipDetails}</div>)} onMouseOut={tooltip.bind(null, null)} className='summary'>{translate('raw shield strength')}<br/>{formats.int(shield.total)}{units.MJ}</h2>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('TT_TIME_TO_LOSE_SHIELDS'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_TIME_TO_LOSE_SHIELDS')}<br/>{shielddamage.totalsdps == 0 ? translate('ever') : formats.time(Calc.timeToDeplete(shield.total, shielddamage.totalsdps, shielddamage.totalseps, pd.getWeaponsCapacity(), pd.getWeaponsRechargeRate()))}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('TT_TIME_TO_LOSE_SHIELDS'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_TIME_TO_LOSE_SHIELDS')}<br/>{shielddamage.totalsdps == 0 ? translate('ever') : formats.time(Calc.timeToDeplete(shield.total, shielddamage.totalsdps, shielddamage.totalseps, pd.getWeaponsCapacity(), pd.getWeaponsRechargeRate() * opponentWep / 4))}</h2>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_SG_RECOVER'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_TIME_TO_RECOVER_SHIELDS')}<br/>{shield.recover === Math.Inf ? translate('never') : formats.time(shield.recover)}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_SG_RECOVER'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_TIME_TO_RECOVER_SHIELDS')}<br/>{shield.recover === Math.Inf ? translate('never') : formats.time(shield.recover)}</h2>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_SG_RECHARGE'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_TIME_TO_RECHARGE_SHIELDS')}<br/>{shield.recharge === Math.Inf ? translate('never') : formats.time(shield.recharge)}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('PHRASE_SG_RECHARGE'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_TIME_TO_RECHARGE_SHIELDS')}<br/>{shield.recharge === Math.Inf ? translate('never') : formats.time(shield.recharge)}</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -176,7 +177,7 @@ export default class Defence extends TranslatedComponent {
|
|||||||
<div className='group quarter'>
|
<div className='group quarter'>
|
||||||
<h2>{translate('armour metrics')}</h2>
|
<h2>{translate('armour metrics')}</h2>
|
||||||
<h2 onMouseOver={termtip.bind(null, <div>{armourTooltipDetails}</div>)} onMouseOut={tooltip.bind(null, null)} className='summary'>{translate('raw armour strength')}<br/>{formats.int(armour.total)}</h2>
|
<h2 onMouseOver={termtip.bind(null, <div>{armourTooltipDetails}</div>)} onMouseOut={tooltip.bind(null, null)} className='summary'>{translate('raw armour strength')}<br/>{formats.int(armour.total)}</h2>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('TT_TIME_TO_LOSE_ARMOUR'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_TIME_TO_LOSE_ARMOUR')}<br/>{armourdamage.totalsdps == 0 ? translate('ever') : formats.time(Calc.timeToDeplete(armour.total, armourdamage.totalsdps, armourdamage.totalseps, pd.getWeaponsCapacity(), pd.getWeaponsRechargeRate()))}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('TT_TIME_TO_LOSE_ARMOUR'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_TIME_TO_LOSE_ARMOUR')}<br/>{armourdamage.totalsdps == 0 ? translate('ever') : formats.time(Calc.timeToDeplete(armour.total, armourdamage.totalsdps, armourdamage.totalseps, pd.getWeaponsCapacity(), pd.getWeaponsRechargeRate() * opponentWep / 4))}</h2>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('TT_MODULE_ARMOUR'))} onMouseOut={tooltip.bind(null, null)}>{translate('raw module armour')}<br/>{formats.int(armour.modulearmour)}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('TT_MODULE_ARMOUR'))} onMouseOut={tooltip.bind(null, null)}>{translate('raw module armour')}<br/>{formats.int(armour.modulearmour)}</h2>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('TT_MODULE_PROTECTION_EXTERNAL'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_MODULE_PROTECTION_EXTERNAL')}<br/>{formats.pct1(armour.moduleprotection / 2)}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('TT_MODULE_PROTECTION_EXTERNAL'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_MODULE_PROTECTION_EXTERNAL')}<br/>{formats.pct1(armour.moduleprotection / 2)}</h2>
|
||||||
<h2 onMouseOver={termtip.bind(null, translate('TT_MODULE_PROTECTION_INTERNAL'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_MODULE_PROTECTION_INTERNAL')}<br/>{formats.pct1(armour.moduleprotection)}</h2>
|
<h2 onMouseOver={termtip.bind(null, translate('TT_MODULE_PROTECTION_INTERNAL'))} onMouseOut={tooltip.bind(null, null)}>{translate('PHRASE_MODULE_PROTECTION_INTERNAL')}<br/>{formats.pct1(armour.moduleprotection)}</h2>
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ export default class Offence extends TranslatedComponent {
|
|||||||
ship: React.PropTypes.object.isRequired,
|
ship: React.PropTypes.object.isRequired,
|
||||||
opponent: React.PropTypes.object.isRequired,
|
opponent: React.PropTypes.object.isRequired,
|
||||||
engagementrange: React.PropTypes.number.isRequired,
|
engagementrange: React.PropTypes.number.isRequired,
|
||||||
wep: React.PropTypes.number.isRequired
|
wep: React.PropTypes.number.isRequired,
|
||||||
|
opponentSys: React.PropTypes.number.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -67,7 +68,7 @@ export default class Offence extends TranslatedComponent {
|
|||||||
|
|
||||||
this._sort = this._sort.bind(this);
|
this._sort = this._sort.bind(this);
|
||||||
|
|
||||||
const damage = Calc.offenceMetrics(props.ship, props.opponent, props.eng, props.engagementrange);
|
const damage = Calc.offenceMetrics(props.ship, props.opponent, props.wep, props.opponentSys, props.engagementrange);
|
||||||
this.state = {
|
this.state = {
|
||||||
predicate: 'n',
|
predicate: 'n',
|
||||||
desc: true,
|
desc: true,
|
||||||
@@ -82,7 +83,7 @@ export default class Offence extends TranslatedComponent {
|
|||||||
*/
|
*/
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.marker != nextProps.marker || this.props.eng != nextProps.eng) {
|
if (this.props.marker != nextProps.marker || this.props.eng != nextProps.eng) {
|
||||||
const damage = Calc.offenceMetrics(nextProps.ship, nextProps.opponent, nextProps.wep, nextProps.engagementrange);
|
const damage = Calc.offenceMetrics(nextProps.ship, nextProps.opponent, nextProps.wep, nextProps.opponentSys, nextProps.engagementrange);
|
||||||
this.setState({ damage });
|
this.setState({ damage });
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ export default class OutfittingSubpages extends TranslatedComponent {
|
|||||||
boost: React.PropTypes.bool.isRequired,
|
boost: React.PropTypes.bool.isRequired,
|
||||||
engagementRange: React.PropTypes.number.isRequired,
|
engagementRange: React.PropTypes.number.isRequired,
|
||||||
opponent: React.PropTypes.object.isRequired,
|
opponent: React.PropTypes.object.isRequired,
|
||||||
opponentBuild: React.PropTypes.string
|
opponentBuild: React.PropTypes.string,
|
||||||
|
opponentSys: React.PropTypes.number.isRequired,
|
||||||
|
opponentEng: React.PropTypes.number.isRequired,
|
||||||
|
opponentWep: React.PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,7 +83,7 @@ export default class OutfittingSubpages extends TranslatedComponent {
|
|||||||
* @return {React.Component} Tab contents
|
* @return {React.Component} Tab contents
|
||||||
*/
|
*/
|
||||||
_profilesTab() {
|
_profilesTab() {
|
||||||
const { ship, opponent, cargo, fuel, eng, boost, engagementRange } = this.props;
|
const { ship, opponent, cargo, fuel, eng, boost, engagementRange, opponentSys } = this.props;
|
||||||
const { translate } = this.context.language;
|
const { translate } = this.context.language;
|
||||||
let realBoost = boost && ship.canBoost();
|
let realBoost = boost && ship.canBoost();
|
||||||
Persist.setOutfittingTab('profiles');
|
Persist.setOutfittingTab('profiles');
|
||||||
@@ -88,7 +91,7 @@ export default class OutfittingSubpages extends TranslatedComponent {
|
|||||||
const engineProfileMarker = `${ship.toString()}:${cargo}:${fuel}:${eng}:${realBoost}`;
|
const engineProfileMarker = `${ship.toString()}:${cargo}:${fuel}:${eng}:${realBoost}`;
|
||||||
const fsdProfileMarker = `${ship.toString()}:${cargo}:${fuel}`;
|
const fsdProfileMarker = `${ship.toString()}:${cargo}:${fuel}`;
|
||||||
const movementMarker = `${ship.topSpeed}:${ship.pitch}:${ship.roll}:${ship.yaw}:${ship.canBoost()}`;
|
const movementMarker = `${ship.topSpeed}:${ship.pitch}:${ship.roll}:${ship.yaw}:${ship.canBoost()}`;
|
||||||
const damageMarker = `${ship.toString()}:${opponent.toString()}:${engagementRange}`;
|
const damageMarker = `${ship.toString()}:${opponent.toString()}:${engagementRange}:${opponentSys}`;
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<div className='group third'>
|
<div className='group third'>
|
||||||
@@ -123,13 +126,13 @@ export default class OutfittingSubpages extends TranslatedComponent {
|
|||||||
* @return {React.Component} Tab contents
|
* @return {React.Component} Tab contents
|
||||||
*/
|
*/
|
||||||
_offenceTab() {
|
_offenceTab() {
|
||||||
const { ship, sys, eng, wep, cargo, fuel, boost, engagementRange, opponent, opponentBuild } = this.props;
|
const { ship, sys, eng, wep, cargo, fuel, boost, engagementRange, opponent, opponentBuild, opponentSys } = this.props;
|
||||||
Persist.setOutfittingTab('offence');
|
Persist.setOutfittingTab('offence');
|
||||||
|
|
||||||
const marker = `${ship.toString()}:${opponent.toString()}:${opponentBuild}:${engagementRange}`;
|
const marker = `${ship.toString()}${opponent.toString()}${opponentBuild}${engagementRange}${opponentSys}`;
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<Offence marker={marker} ship={ship} opponent={opponent} wep={wep} engagementrange={engagementRange}/>
|
<Offence marker={marker} ship={ship} opponent={opponent} wep={wep} opponentSys={opponentSys} engagementrange={engagementRange}/>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,13 +141,13 @@ export default class OutfittingSubpages extends TranslatedComponent {
|
|||||||
* @return {React.Component} Tab contents
|
* @return {React.Component} Tab contents
|
||||||
*/
|
*/
|
||||||
_defenceTab() {
|
_defenceTab() {
|
||||||
const { ship, sys, eng, wep, cargo, fuel, boost, engagementRange, opponent, opponentBuild } = this.props;
|
const { ship, sys, eng, wep, cargo, fuel, boost, engagementRange, opponent, opponentBuild, opponentWep } = this.props;
|
||||||
Persist.setOutfittingTab('defence');
|
Persist.setOutfittingTab('defence');
|
||||||
|
|
||||||
const marker = `${ship.toString()}:${opponent.toString()}:${opponentBuild}:${engagementRange}`;
|
const marker = `${ship.toString()}${opponent.toString()}{opponentBuild}${engagementRange}${opponentWep}`;
|
||||||
|
|
||||||
return <div>
|
return <div>
|
||||||
<Defence marker={marker} ship={ship} opponent={opponent} sys={sys} engagementrange={engagementRange}/>
|
<Defence marker={marker} ship={ship} opponent={opponent} sys={sys} opponentWep={opponentWep} engagementrange={engagementRange}/>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export default class ShipPicker extends TranslatedComponent {
|
|||||||
this._closeMenu();
|
this._closeMenu();
|
||||||
|
|
||||||
// Ensure that the ship has changed
|
// Ensure that the ship has changed
|
||||||
if (ship !== this.props.ship || this.build !== this.props.build) {
|
if (ship !== this.props.ship || build !== this.props.build) {
|
||||||
this.props.onChange(ship, build);
|
this.props.onChange(ship, build);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -299,16 +299,22 @@ export default class OutfittingPage extends Page {
|
|||||||
Persist.saveBuild(shipId, newBuildName, code);
|
Persist.saveBuild(shipId, newBuildName, code);
|
||||||
this._updateRoute(shipId, newBuildName, code);
|
this._updateRoute(shipId, newBuildName, code);
|
||||||
|
|
||||||
let opponent, opponentBuild;
|
let opponent, opponentBuild, opponentSys, opponentEng, opponentWep;
|
||||||
if (shipId === this.state.opponent.id && buildName === this.state.opponentBuild) {
|
if (shipId === this.state.opponent.id && buildName === this.state.opponentBuild) {
|
||||||
// This is a save of our current opponent build; update it
|
// This is a save of our current opponent build; update it
|
||||||
opponentBuild = newBuildName;
|
opponentBuild = newBuildName;
|
||||||
opponent = new Ship(shipId, Ships[shipId].properties, Ships[shipId].slots).buildFrom(code);
|
opponent = new Ship(shipId, Ships[shipId].properties, Ships[shipId].slots).buildFrom(code);
|
||||||
|
opponentSys = this.state.sys;
|
||||||
|
opponentEng = this.state.eng;
|
||||||
|
opponentWep = this.state.wep;
|
||||||
} else {
|
} else {
|
||||||
opponentBuild = this.state.opponentBuild;
|
opponentBuild = this.state.opponentBuild;
|
||||||
opponent = this.state.opponent;
|
opponent = this.state.opponent;
|
||||||
|
opponentSys = this.state.opponentSys;
|
||||||
|
opponentEng = this.state.opponentEng;
|
||||||
|
opponentWep = this.state.opponentWep;
|
||||||
}
|
}
|
||||||
this.setState({ buildName: newBuildName, code, savedCode: code, opponent, opponentBuild, title: this._getTitle(newBuildName) });
|
this.setState({ buildName: newBuildName, code, savedCode: code, opponent, opponentBuild, opponentSys, opponentEng, opponentWep, title: this._getTitle(newBuildName) });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -507,7 +513,7 @@ export default class OutfittingPage extends Page {
|
|||||||
let state = this.state,
|
let state = this.state,
|
||||||
{ language, termtip, tooltip, sizeRatio, onWindowResize } = this.context,
|
{ language, termtip, tooltip, sizeRatio, onWindowResize } = this.context,
|
||||||
{ translate, units, formats } = language,
|
{ translate, units, formats } = language,
|
||||||
{ ship, code, savedCode, buildName, newBuildName, sys, eng, wep, boost, fuel, cargo, opponent, opponentBuild, engagementRange } = state,
|
{ ship, code, savedCode, buildName, newBuildName, sys, eng, wep, boost, fuel, cargo, opponent, opponentBuild, opponentSys, opponentEng, opponentWep, engagementRange } = state,
|
||||||
hide = tooltip.bind(null, null),
|
hide = tooltip.bind(null, null),
|
||||||
menu = this.props.currentMenu,
|
menu = this.props.currentMenu,
|
||||||
shipUpdated = this._shipUpdated,
|
shipUpdated = this._shipUpdated,
|
||||||
@@ -616,6 +622,9 @@ export default class OutfittingPage extends Page {
|
|||||||
engagementRange={engagementRange}
|
engagementRange={engagementRange}
|
||||||
opponent={opponent}
|
opponent={opponent}
|
||||||
opponentBuild={opponentBuild}
|
opponentBuild={opponentBuild}
|
||||||
|
opponentSys={opponentSys}
|
||||||
|
opponentEng={opponentEng}
|
||||||
|
opponentWep={opponentWep}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -533,10 +533,11 @@ export function armourMetrics(ship) {
|
|||||||
* @param {Object} ship The ship
|
* @param {Object} ship The ship
|
||||||
* @param {Object} opponent The opponent ship
|
* @param {Object} opponent The opponent ship
|
||||||
* @param {int} sys The pips to SYS
|
* @param {int} sys The pips to SYS
|
||||||
|
* @param {int} opponentWep The pips to pponent's WEP
|
||||||
* @param {int} engagementrange The range between the ship and opponent
|
* @param {int} engagementrange The range between the ship and opponent
|
||||||
* @returns {Object} Defence metrics
|
* @returns {Object} Defence metrics
|
||||||
*/
|
*/
|
||||||
export function defenceMetrics(ship, opponent, sys, engagementrange) {
|
export function defenceMetrics(ship, opponent, sys, opponentWep, engagementrange) {
|
||||||
// Obtain the shield metrics
|
// Obtain the shield metrics
|
||||||
const shield = this.shieldMetrics(ship, sys);
|
const shield = this.shieldMetrics(ship, sys);
|
||||||
|
|
||||||
@@ -572,15 +573,16 @@ export function defenceMetrics(ship, opponent, sys, engagementrange) {
|
|||||||
* @param {Object} ship The ship
|
* @param {Object} ship The ship
|
||||||
* @param {Object} opponent The opponent ship
|
* @param {Object} opponent The opponent ship
|
||||||
* @param {int} wep The pips to WEP
|
* @param {int} wep The pips to WEP
|
||||||
|
* @param {int} opponentSys The pips to opponent's SYS
|
||||||
* @param {int} engagementrange The range between the ship and opponent
|
* @param {int} engagementrange The range between the ship and opponent
|
||||||
* @returns {array} Offence metrics
|
* @returns {array} Offence metrics
|
||||||
*/
|
*/
|
||||||
export function offenceMetrics(ship, opponent, wep, engagementrange) {
|
export function offenceMetrics(ship, opponent, wep, opponentSys, engagementrange) {
|
||||||
// Per-weapon and total damage
|
// Per-weapon and total damage
|
||||||
const damage = [];
|
const damage = [];
|
||||||
|
|
||||||
// Obtain the opponent's shield and armour metrics
|
// Obtain the opponent's shield and armour metrics
|
||||||
const opponentShields = this.shieldMetrics(opponent, 4);
|
const opponentShields = this.shieldMetrics(opponent, opponentSys);
|
||||||
const opponentArmour = this.armourMetrics(opponent);
|
const opponentArmour = this.armourMetrics(opponent);
|
||||||
|
|
||||||
// Per-weapon and total damage to shields
|
// Per-weapon and total damage to shields
|
||||||
@@ -612,18 +614,6 @@ export function offenceMetrics(ship, opponent, wep, engagementrange) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
|
|
||||||
const shielddamage = opponentShields.generator ? {
|
|
||||||
absolute: {
|
|
||||||
weapon1: 10,
|
|
||||||
weapon2: 10,
|
|
||||||
weapon3: 10,
|
|
||||||
weapon4: 10,
|
|
||||||
total: 40
|
|
||||||
}
|
|
||||||
} : {};
|
|
||||||
|
|
||||||
return damage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -632,7 +622,7 @@ export function offenceMetrics(ship, opponent, wep, engagementrange) {
|
|||||||
* @returns {integer} the resistance for the given pips
|
* @returns {integer} the resistance for the given pips
|
||||||
*/
|
*/
|
||||||
export function sysResistance(sys) {
|
export function sysResistance(sys) {
|
||||||
return Math.pow(sys,0.85) * 0.6 / Math.pow(4,0.85);
|
return Math.pow(sys, 0.85) * 0.6 / Math.pow(4, 0.85);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user