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

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

Function: 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.

Parameters

mass

number

Total ship mass excluding fuel, in tonnes (unladen mass plus cargo).

fuel

number

Fuel available to spend, in tonnes — normally the main tank's capacity.

fsd

FrameShiftDriveParams

The drive constants.

Returns

TotalRangeDetails

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.

Remarks

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.

Throws

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.

Example

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
⚠️ **GitHub.com Fallback** ⚠️