mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-10 07:05:35 +00:00
Move to pure damage/distdraw/thermload numbers
This commit is contained in:
@@ -59,7 +59,7 @@ export default class HardpointSlot extends Slot {
|
|||||||
{ m.getDps() ? <div className={'l'}>{translate('DPS')}: {formats.round1(m.getDps())} { m.getClip() ? <span>({formats.round1((m.getClip() * m.getDps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload())) })</span> : null }</div> : null }
|
{ m.getDps() ? <div className={'l'}>{translate('DPS')}: {formats.round1(m.getDps())} { m.getClip() ? <span>({formats.round1((m.getClip() * m.getDps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload())) })</span> : null }</div> : null }
|
||||||
{ m.getEps() ? <div className={'l'}>{translate('EPS')}: {formats.round1(m.getEps())}{u.MW} { m.getClip() ? <span>({formats.round1((m.getClip() * m.getEps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload())) }{u.MW})</span> : null }</div> : null }
|
{ m.getEps() ? <div className={'l'}>{translate('EPS')}: {formats.round1(m.getEps())}{u.MW} { m.getClip() ? <span>({formats.round1((m.getClip() * m.getEps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload())) }{u.MW})</span> : null }</div> : null }
|
||||||
{ m.getHps() ? <div className={'l'}>{translate('HPS')}: {formats.round1(m.getHps())} { m.getClip() ? <span>({formats.round1((m.getClip() * m.getHps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload())) })</span> : null }</div> : null }
|
{ m.getHps() ? <div className={'l'}>{translate('HPS')}: {formats.round1(m.getHps())} { m.getClip() ? <span>({formats.round1((m.getClip() * m.getHps() / m.getRoF()) / ((m.getClip() / m.getRoF()) + m.getReload())) })</span> : null }</div> : null }
|
||||||
{ m.getDps() && m.getEps() ? <div className={'l'}>{translate('DPE')}: {formats.round1(m.getDps() / m.getEps())}</div> : null }
|
{ m.getDps() && m.getEps() ? <div className={'l'}>{translate('DPE')}: {formats.f1(m.getDps() / m.getEps())}</div> : null }
|
||||||
{ m.getRoF() ? <div className={'l'}>{translate('ROF')}: {formats.f1(m.getRoF())}{u.ps}</div> : null }
|
{ m.getRoF() ? <div className={'l'}>{translate('ROF')}: {formats.f1(m.getRoF())}{u.ps}</div> : null }
|
||||||
{ m.getRange() && !m.getDps() ? <div className={'l'}>{translate('Range')} : {formats.round(m.getRange() / 1000)}{u.km}</div> : null }
|
{ m.getRange() && !m.getDps() ? <div className={'l'}>{translate('Range')} : {formats.round(m.getRange() / 1000)}{u.km}</div> : null }
|
||||||
{ m.getShieldMul() ? <div className={'l'}>+{formats.rPct(m.getShieldMul())}</div> : null }
|
{ m.getShieldMul() ? <div className={'l'}>+{formats.rPct(m.getShieldMul())}</div> : null }
|
||||||
|
|||||||
@@ -129,39 +129,6 @@ export default class Module {
|
|||||||
return this._getModifiedValue('optmult');
|
return this._getModifiedValue('optmult');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the damage per second for this module, taking in to account modifications
|
|
||||||
* @return {Number} the damage per second of this module
|
|
||||||
*/
|
|
||||||
getDamagePerSecond() {
|
|
||||||
return this._getModifiedValue('dps');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the energy per second for this module, taking in to account modifications
|
|
||||||
* @return {Number} the energy per second of this module
|
|
||||||
*/
|
|
||||||
getEnergyPerSecond() {
|
|
||||||
return this._getModifiedValue('eps');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the heat per second for this module, taking in to account modifications
|
|
||||||
* @return {Number} the heat per second of this module
|
|
||||||
*/
|
|
||||||
getHeatPerSecond() {
|
|
||||||
// Modifier for hps is thermload
|
|
||||||
let result = 0;
|
|
||||||
if (this['hps']) {
|
|
||||||
result = this['hps'];
|
|
||||||
if (result) {
|
|
||||||
let mult = this.getModValue('thermload');
|
|
||||||
if (mult) { result = result * (1 + mult); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the maximum fuel per jump for this module, taking in to account modifications
|
* Get the maximum fuel per jump for this module, taking in to account modifications
|
||||||
* @return {Number} the maximum fuel per jump of this module
|
* @return {Number} the maximum fuel per jump of this module
|
||||||
@@ -406,46 +373,78 @@ export default class Module {
|
|||||||
return this._getModifiedValue('shieldmul');
|
return this._getModifiedValue('shieldmul');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the damage for this module, taking in to account modifications
|
||||||
|
* @return {Number} the damage of this module
|
||||||
|
*/
|
||||||
|
getDamage() {
|
||||||
|
return this._getModifiedValue('damage');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the distributor draw for this module, taking in to account modifications
|
||||||
|
* @return {Number} the distributor draw of this module
|
||||||
|
*/
|
||||||
|
getDistDraw() {
|
||||||
|
return this._getModifiedValue('distdraw');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the thermal load for this module, taking in to account modifications
|
||||||
|
* @return {Number} the thermal load of this module
|
||||||
|
*/
|
||||||
|
getThermalLoad() {
|
||||||
|
return this._getModifiedValue('thermload');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the rounds per shot for this module, taking in to account modifications
|
||||||
|
* @return {Number} the rounds per shot of this module
|
||||||
|
*/
|
||||||
|
getRoundsPerShot() {
|
||||||
|
return this._getModifiedValue('roundspershot');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the DPS for this module, taking in to account modifications
|
* Get the DPS for this module, taking in to account modifications
|
||||||
* @return {Number} the DPS of this module
|
* @return {Number} the DPS of this module
|
||||||
*/
|
*/
|
||||||
getDps() {
|
getDps() {
|
||||||
// Modifications are not made to DPS directly, but to damage and rate of fire
|
// DPS is a synthetic value
|
||||||
|
let damage = this.getDamage();
|
||||||
|
let rpshot = this.getRoundsPerShot() || 1;
|
||||||
|
let rof = this.getRoF();
|
||||||
|
|
||||||
// Obtain unmodified rate of fire
|
return damage * rpshot * rof;
|
||||||
let rof = this['rof'];
|
|
||||||
|
|
||||||
// Obtain unmodified damage
|
|
||||||
let damage = this['dps'] / rof;
|
|
||||||
|
|
||||||
// Obtain modified rate of fire
|
|
||||||
let modRof = this._getModifiedValue('rof');
|
|
||||||
|
|
||||||
// Obtain modified damage
|
|
||||||
let damageMult = this.getModValue('damage');
|
|
||||||
let modDamage = damageMult ? damage * (1 + damageMult) : damage;
|
|
||||||
|
|
||||||
return modDamage * modRof;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the heat generated per second for this module, taking in to account modifications
|
* Get the EPS for this module, taking in to account modifications
|
||||||
* @return {Number} the heat generated per second of this module
|
* @return {Number} the EPS of this module
|
||||||
*/
|
|
||||||
getHps() {
|
|
||||||
// TODO this is not correct; need to include other factors such as rate of fire, damage, etc.
|
|
||||||
return this._getModifiedValue('hps');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the energy used per second for this module, taking in to account modifications
|
|
||||||
* @return {Number} the energy used per second of this module
|
|
||||||
*/
|
*/
|
||||||
getEps() {
|
getEps() {
|
||||||
// TODO this is not correct; need to include other factors such as rate of fire, damage, etc.
|
// EPS is a synthetic value
|
||||||
return this._getModifiedValue('eps');
|
let distdraw = this.getDistDraw();
|
||||||
|
console.log('distdraw is ' + distdraw);
|
||||||
|
let rpshot = this.getRoundsPerShot() || 1;
|
||||||
|
console.log('rpshot is ' + rpshot);
|
||||||
|
let rof = this.getRoF();
|
||||||
|
console.log('rof is ' + rof);
|
||||||
|
|
||||||
|
return distdraw * rpshot * rof;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the HPS for this module, taking in to account modifications
|
||||||
|
* @return {Number} the HPS of this module
|
||||||
|
*/
|
||||||
|
getHps() {
|
||||||
|
// HPS is a synthetic value
|
||||||
|
let heat = this.getThermalLoad();
|
||||||
|
let rpshot = this.getRoundsPerShot() || 1;
|
||||||
|
let rof = this.getRoF();
|
||||||
|
|
||||||
|
return heat * rpshot * rof;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -704,14 +704,14 @@ export default class Ship {
|
|||||||
if (ModuleUtils.isShieldGenerator(slot.m.grp) || slot.m.grp == 'sb') {
|
if (ModuleUtils.isShieldGenerator(slot.m.grp) || slot.m.grp == 'sb') {
|
||||||
this.updateShield();
|
this.updateShield();
|
||||||
}
|
}
|
||||||
if (slot.m.dps) {
|
if (slot.m.getDps()) {
|
||||||
this.totalDps += slot.m.dps * (enabled ? 1 : -1);
|
this.totalDps += slot.m.getDps() * (enabled ? 1 : -1);
|
||||||
}
|
}
|
||||||
if (slot.m.eps) {
|
if (slot.m.getEps()) {
|
||||||
this.totalEps += slot.m.eps * (enabled ? 1 : -1);
|
this.totalEps += slot.m.getEps() * (enabled ? 1 : -1);
|
||||||
}
|
}
|
||||||
if (slot.m.hps) {
|
if (slot.m.getHps()) {
|
||||||
this.totalHps += slot.m.hps * (enabled ? 1 : -1);
|
this.totalHps += slot.m.getHps() * (enabled ? 1 : -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.updatePower();
|
this.updatePower();
|
||||||
@@ -782,14 +782,14 @@ export default class Ship {
|
|||||||
this.priorityBands[slot.priority][powerUsageType(slot, old)] -= old.getPowerUsage();
|
this.priorityBands[slot.priority][powerUsageType(slot, old)] -= old.getPowerUsage();
|
||||||
powerChange = true;
|
powerChange = true;
|
||||||
|
|
||||||
if (old.dps) {
|
if (old.getDps()) {
|
||||||
this.totalDps -= old.dps;
|
this.totalDps -= old.getDps();
|
||||||
}
|
}
|
||||||
if (old.eps) {
|
if (old.getEps()) {
|
||||||
this.totalEps -= old.eps;
|
this.totalEps -= old.getEps();
|
||||||
}
|
}
|
||||||
if (old.hps) {
|
if (old.getHps()) {
|
||||||
this.totalHps -= old.hps;
|
this.totalHps -= old.getHps();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.unladenMass -= old.getMass() || 0;
|
this.unladenMass -= old.getMass() || 0;
|
||||||
@@ -813,14 +813,14 @@ export default class Ship {
|
|||||||
this.priorityBands[slot.priority][powerUsageType(slot, n)] += n.getPowerUsage();
|
this.priorityBands[slot.priority][powerUsageType(slot, n)] += n.getPowerUsage();
|
||||||
powerChange = true;
|
powerChange = true;
|
||||||
|
|
||||||
if (n.dps) {
|
if (n.getDps()) {
|
||||||
this.totalDps += n.dps;
|
this.totalDps += n.getDps();
|
||||||
}
|
}
|
||||||
if (n.eps) {
|
if (n.getEps()) {
|
||||||
this.totalEps += n.eps;
|
this.totalEps += n.getEps();
|
||||||
}
|
}
|
||||||
if (n.hps) {
|
if (n.getHps()) {
|
||||||
this.totalHps += n.hps;
|
this.totalHps += n.getHps();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.unladenMass += n.getMass() || 0;
|
this.unladenMass += n.getMass() || 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user