ships.Function.weaponsCapacitorMetrics - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / ships / weaponsCapacitorMetrics
weaponsCapacitorMetrics(
input):WeaponsCapacitorMetrics
Defined in: src/ships/weapons-capacitor.ts:82
Calculate WEP recharge and time to drain while a weapon load fires continuously.
Distributor capacity, its rated four-pip recharge, sustained weapon draw and the WEP-pip allocation to model.
Actual recharge, net drain and seconds until empty. timeToDrain is
Infinity when the weapons draw no more than the actual recharge rate. A positive
draw with zero capacity drains immediately (0 seconds).
If a capacity, recharge or draw is negative or non-finite, or
weaponsPips is outside [0, 4].
import { weaponsCapacitorMetrics } from '@elite-dangerous-almanac/core/ships/weapons-capacitor';
weaponsCapacitorMetrics({
weaponsCapacity: 20,
weaponsRecharge: 5,
sustainedEnergyPerSecond: 7,
weaponsPips: 2,
}).timeToDrain; // -> 4.285…