ships.Function.totalRange - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / ships / totalRange
totalRange(
mass,fuel,fsd):TotalRangeDetails
Defined in: src/ships/jump-range.ts:256
The total multi-jump range and jump count on one tank.
number
Total ship mass excluding fuel, in tonnes (unladen mass plus cargo).
number
Fuel available to spend, in tonnes — normally the main tank's capacity.
The drive constants.
The summed range in light-years and the number of jumps evaluated. Zero
fuel or a drive with zero maxFuel returns { range: 0, jumps: 0 }; a final partial
fuel load still counts as one jump.
Each jump burns up to maxFuel; the sum runs until the tank is empty. mass
(hull + modules + cargo) stays fixed, while the decreasing remaining fuel is
included by singleJumpRange, so the ship becomes lighter after each jump.
At most 100,000 jumps are evaluated; larger workloads throw instead of returning a
silently truncated result.
If a quantity is negative or non-finite, a required drive constant is not positive, or the tank would require more than 100,000 jumps.
import { totalRange } from '@elite-dangerous-almanac/core/ships/jump-range';
totalRange(500, 12, {
optMass: 1050, maxFuel: 5, fuelMul: 0.012, fuelPower: 2.45,
}).jumps; // -> 3