mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 14:33:22 +00:00
Added time to drain calculation and display
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
#2.2.13
|
||||
* Add 'time to drain' summary value. This is the time to drain the WEP capacitor if firing all enabled weapons
|
||||
* Do not include utility slot DPS/EPS/HPS in summary information
|
||||
|
||||
#2.2.12
|
||||
* Tidy up old references to coriolis.io
|
||||
* Add ability to add and remove special effects to weapon modifications
|
||||
|
||||
@@ -269,20 +269,19 @@
|
||||
"topSpeed": 187.01,
|
||||
"totalCost": 882362058,
|
||||
"totalDpe": 142.68,
|
||||
"totalDps": 103.8,
|
||||
"totalEps": 22.71,
|
||||
"totalHps": 677.29,
|
||||
"totalDps": 101.13,
|
||||
"totalEps": 18.71,
|
||||
"totalExplDpe": 0,
|
||||
"totalExplDps": 0,
|
||||
"totalExplSDps": 0,
|
||||
"totalAbsDpe": 3.57,
|
||||
"totalAbsDps": 18.78,
|
||||
"totalAbsSDps": 14.45,
|
||||
"totalHps": 33.62,
|
||||
"totalHps": 28.28,
|
||||
"totalKinDpe": 117.48,
|
||||
"totalKinDps": 24.94,
|
||||
"totalKinSDps": 18.76,
|
||||
"totalSDps": 91.84,
|
||||
"totalKinDps": 22.27,
|
||||
"totalKinSDps": 16.91,
|
||||
"totalSDps": 89.99,
|
||||
"totalThermDpe": 21.63,
|
||||
"totalThermDps": 60.08,
|
||||
"totalThermSDps": 58.64,
|
||||
@@ -320,6 +319,7 @@
|
||||
"shieldCells": 1840,
|
||||
"shieldExplRes": 0.5,
|
||||
"shieldKinRes": 0.4,
|
||||
"shieldThermRes": -0.2
|
||||
"shieldThermRes": -0.2,
|
||||
"timeToDrain": 7.04
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "coriolis_shipyard",
|
||||
"version": "2.2.12",
|
||||
"version": "2.2.13b",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EDCD/coriolis"
|
||||
|
||||
@@ -42,10 +42,11 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
||||
<th rowSpan={2} className={ cn({ 'bg-warning-disabled': !ship.canBoost() }) }>{translate('boost')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'damage per second')} onMouseLeave={hide} rowSpan={2}>{translate('DPS')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'energy per second')} onMouseLeave={hide} rowSpan={2}>{translate('EPS')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'time to drain WEP capacitor')} onMouseLeave={hide} rowSpan={2}>{translate('TTD')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'heat per second')} onMouseLeave={hide} rowSpan={2}>{translate('HPS')}</th>
|
||||
<th rowSpan={2}>{translate('hardness')}</th>
|
||||
<th rowSpan={2}>{translate('armour')}</th>
|
||||
<th rowSpan={2}>{translate('shields')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'hull hardness')} onMouseLeave={hide} rowSpan={2}>{translate('hrd')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'armour')} onMouseLeave={hide} rowSpan={2}>{translate('arm')}</th>
|
||||
<th onMouseEnter={termtip.bind(null, 'shields')} onMouseLeave={hide} rowSpan={2}>{translate('shld')}</th>
|
||||
<th colSpan={3}>{translate('mass')}</th>
|
||||
<th rowSpan={2}>{translate('cargo')}</th>
|
||||
<th rowSpan={2}>{translate('fuel')}</th>
|
||||
@@ -71,6 +72,7 @@ export default class ShipSummaryTable extends TranslatedComponent {
|
||||
<td>{ ship.canBoost() ? <span>{int(ship.topBoost)} {u['m/s']}</span> : <span className='warning'>0 <Warning/></span> }</td>
|
||||
<td>{f1(ship.totalDps)}</td>
|
||||
<td>{f1(ship.totalEps)}</td>
|
||||
<td>{ship.timeToDrain === Infinity ? '∞' : time(ship.timeToDrain)}</td>
|
||||
<td>{f1(ship.totalHps)}</td>
|
||||
<td>{int(ship.hardness)}</td>
|
||||
<td>{int(ship.armour)}</td>
|
||||
|
||||
@@ -215,6 +215,8 @@ Along the top of the screen are some of the key values for your build. This is
|
||||
|
||||
Here, along with most places in Coriolis, acronyms will have tooltips explaining what they mean. Hover over the acronym to obtain more detail, or look in the glossary at the end of this help.</p>
|
||||
|
||||
All values are the highest possible, assuming that you have maximum pips in the relevant capacitor (ENG for speed, WEP for time to drain, etc.).</p>
|
||||
|
||||
<h2>Modules</h2>
|
||||
The next set of panels laid out horizontally across the screen contain the modules you have put in your build. From left to right these are the core modules, the internal modules, the hardpoints and the utility mounts. These represent the available slots in your ship and cannot be altered. Each slot has a class, or size, and in general any module up to a given size can fit in a given slot (exceptions being bulkheads, life support and sensors in core modules and restricted internal slots, which can only take a subset of module depending on their restrictions). </p>
|
||||
|
||||
|
||||
@@ -426,6 +426,7 @@ export default class Ship {
|
||||
.recalculateDps()
|
||||
.recalculateEps()
|
||||
.recalculateHps()
|
||||
.recalculateTtd()
|
||||
.updateMovement();
|
||||
}
|
||||
|
||||
@@ -497,11 +498,15 @@ export default class Ship {
|
||||
this.recalculateDps();
|
||||
this.recalculateHps();
|
||||
this.recalculateEps();
|
||||
this.recalculateTtd();
|
||||
} else if (name === 'explres' || name === 'kinres' || name === 'thermres') {
|
||||
m.setModValue(name, value, sentfromui);
|
||||
// Could be for shields or armour
|
||||
this.recalculateArmour();
|
||||
this.recalculateShield();
|
||||
} else if (name === 'wepcap' || name === 'weprate') {
|
||||
m.setModValue(name, value, sentfromui);
|
||||
this.recalculateTtd();
|
||||
} else {
|
||||
// Generic
|
||||
m.setModValue(name, value, sentfromui);
|
||||
@@ -634,6 +639,7 @@ export default class Ship {
|
||||
.recalculateDps()
|
||||
.recalculateEps()
|
||||
.recalculateHps()
|
||||
.recalculateTtd()
|
||||
.updateMovement();
|
||||
}
|
||||
|
||||
@@ -815,6 +821,7 @@ export default class Ship {
|
||||
|
||||
if (slot.m.getEps()) {
|
||||
this.recalculateEps();
|
||||
this.recalculateTtd();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -851,6 +858,7 @@ export default class Ship {
|
||||
*/
|
||||
updateStats(slot, n, old, preventUpdate) {
|
||||
let powerGeneratedChange = slot == this.standard[0];
|
||||
let powerDistributorChange = slot == this.standard[4];
|
||||
let powerUsedChange = false;
|
||||
let dpsChanged = n && n.getDps() || old && old.getDps();
|
||||
let epsChanged = n && n.getEps() || old && old.getEps();
|
||||
@@ -919,6 +927,9 @@ export default class Ship {
|
||||
if (powerGeneratedChange) {
|
||||
this.updatePowerGenerated();
|
||||
}
|
||||
if (powerDistributorChange) {
|
||||
this.recalculateTtd();
|
||||
}
|
||||
if (powerUsedChange) {
|
||||
this.updatePowerUsed();
|
||||
}
|
||||
@@ -957,7 +968,34 @@ export default class Ship {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate damage per second for weapons
|
||||
* Calculate time to drain WEP capacitor
|
||||
* @return {this} The ship instance (for chaining operations)
|
||||
*/
|
||||
recalculateTtd() {
|
||||
let totalSEps = 0;
|
||||
|
||||
for (let slotNum in this.hardpoints) {
|
||||
const slot = this.hardpoints[slotNum];
|
||||
if (slot.m && slot.enabled && slot.type === 'WEP' && slot.m.getDps()) {
|
||||
totalSEps += slot.m.getClip() ? (slot.m.getClip() * slot.m.getEps() / slot.m.getRoF()) / ((slot.m.getClip() / slot.m.getRoF()) + slot.m.getReload()) : slot.m.getEps();
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the drain time
|
||||
const drainPerSecond = totalSEps - this.standard[4].m.getWeaponsRechargeRate();
|
||||
if (drainPerSecond <= 0) {
|
||||
// Can fire forever
|
||||
this.timeToDrain = Infinity;
|
||||
} else {
|
||||
const initialCharge = this.standard[4].m.getWeaponsCapacity();
|
||||
this.timeToDrain = initialCharge / drainPerSecond;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate damage per second and related items for weapons
|
||||
* @return {this} The ship instance (for chaining operations)
|
||||
*/
|
||||
recalculateDps() {
|
||||
@@ -979,7 +1017,7 @@ export default class Ship {
|
||||
|
||||
for (let slotNum in this.hardpoints) {
|
||||
const slot = this.hardpoints[slotNum];
|
||||
if (slot.m && slot.enabled && slot.m.getDps()) {
|
||||
if (slot.m && slot.enabled && slot.type === 'WEP' && slot.m.getDps()) {
|
||||
const dpe = slot.m.getEps() === 0 ? 0 : slot.m.getDps() / slot.m.getEps();
|
||||
const dps = slot.m.getDps();
|
||||
const sdps = slot.m.getClip() ? (slot.m.getClip() * slot.m.getDps() / slot.m.getRoF()) / ((slot.m.getClip() / slot.m.getRoF()) + slot.m.getReload()) : dps;
|
||||
@@ -1040,7 +1078,7 @@ export default class Ship {
|
||||
|
||||
for (let slotNum in this.hardpoints) {
|
||||
const slot = this.hardpoints[slotNum];
|
||||
if (slot.m && slot.enabled && slot.m.getHps()) {
|
||||
if (slot.m && slot.enabled && slot.type === 'WEP' && slot.m.getHps()) {
|
||||
totalHps += slot.m.getHps();
|
||||
}
|
||||
}
|
||||
@@ -1058,7 +1096,7 @@ export default class Ship {
|
||||
|
||||
for (let slotNum in this.hardpoints) {
|
||||
const slot = this.hardpoints[slotNum];
|
||||
if (slot.m && slot.enabled && slot.m.getEps()) {
|
||||
if (slot.m && slot.enabled && slot.m.getEps() && slot.type === 'WEP') {
|
||||
totalEps += slot.m.getEps();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user