ships.Function.sustainedFireFactor - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@elite-dangerous-almanac/core / ships / sustainedFireFactor

Function: sustainedFireFactor()

sustainedFireFactor(weapon): number

Defined in: src/ships/weapons.ts:366

The factor that turns a weapon's while-firing figures into sustained ones — the share of the time it spends shooting rather than reloading.

Parameters

weapon

WeaponStats

The weapon's stats.

Returns

number

A factor in (0, 1]: 1 for anything that never stops to reload, less for a weapon whose clip runs dry. A fractional clip is held to whole rounds, rounding up — which only a hand-built or journal-stated figure can be, since an engineered clip is rounded to a whole burst where the roll is computed (./engineering). On a burst weapon the two rules can differ by a round: a reload cycle follows Coriolis's own getClip end to end, so taking half of EDSY's rule into it would agree with neither.

Remarks

A clip's worth of fire takes (clip − burst) / rateOfFire seconds plus the time to finish the last burst, then the reload; the sustained rate is the clip divided by that whole cycle.

Example

import { sustainedFireFactor } from '@elite-dangerous-almanac/core/ships/weapons';

// A small multi-cannon: 100 rounds at 7.69/s, then a 4 s reload
sustainedFireFactor({ rateOfFire: 7.692308, clipSize: 100, reloadTime: 4 }); // -> 0.77…
⚠️ **GitHub.com Fallback** ⚠️