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

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

Function: combinedRateOfFire()

combinedRateOfFire(weapon): number | undefined

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

The combined rate of fire a weapon's firing cycle implies — the journal's own RateOfFire, rebuilt from its parts.

A cycle fires burstRounds shots 1 / burstRateOfFire apart, then waits out the burstInterval before the next one. chargeTime is the delay before a shot lands, not part of the cadence Frontier reports as RateOfFire.

The cycle is rebuilt the way the game builds it — a float stored after every operation, serialized to the six decimal places a journal writes — so the answer is the figure the game reports rather than one a little beside it. A small gimballed multi-cannon fires every 0.12 s and Frontier states 8.333334, which exact arithmetic misses by a place. That is also why this is the rate a fitted module already carries: a weapon whose engineering moved the cycle resolves this exact figure into effectiveStats, and states it in the Modifiers block beside it.

Parameters

weapon

WeaponStats

The weapon's stats, post-engineering.

Returns

number | undefined

Shots per second, or undefined for a continuous-fire weapon (no burstInterval) or a cycle that does not resolve to a positive time.

Remarks

Use this for parts you have changed by hand: a recipe that gives a weapon a two-round burst changes the rate of fire without naming it, and weaponMetrics takes rateOfFire as given. A weapon read from a build needs no recomputation — its rate is already this figure.

Example

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

// A small burst laser: three shots at 15/s, then half a second's wait
combinedRateOfFire({ burstInterval: 0.5, burstRounds: 3, burstRateOfFire: 15 }); // -> 4.736842
⚠️ **GitHub.com Fallback** ⚠️