-
Notifications
You must be signed in to change notification settings - Fork 0
ships.Class.BuildMetrics
@elite-dangerous-almanac/core / ships / BuildMetrics
Defined in: src/ships/build-metrics.ts:425
Every figure a fitted build can be asked for.
- Attach — of.
- Jump — frameShiftDrive, frameShiftDriveMassFactor, maxJumpRange, jumpRange, ladenJumpRange, fuelPerJump, totalRange, jumpRangeSummary, standardLoad, standardLoadResult.
- Mass and cost — buildMass, buildCost.
- Power and heat — powerBudget, heatMetrics, heatMetricsResult.
- Mobility — thrusters, mobilityMetrics, mobilityMetricsResult, mobilityCapacitorMetrics, mobilityCapacitorMetricsResult.
- Defence — armourMetrics, shieldMetrics, shieldMetricsResult, shieldCapacitorMetrics, shieldCapacitorMetricsResult, shieldRecovery, shieldRecoveryResult, cellBanks.
- Offence — weaponMetrics, weaponsCapacitorMetrics, distributorMetrics, distributorMetricsResult.
Every member is a method. Nothing here is a fact the fit already carries — each one computes from build state — so there are no properties to confuse with them.
armourMetrics():
ArmourMetrics
Defined in: src/ships/build-metrics.ts:1261
The build's armour: hull hit points, the bulkhead and reinforcement each contribute, and the effective resistances.
The ArmourMetrics, read off the fitted bulkhead.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const hull = metrics.armourMetrics();
hull.hitPoints; // -> total hull points
hull.resistances.explosive; // -> lightweight alloy is explosively weak
hull.effectiveHitPoints.thermal; // -> thermal damage the hull can soakbuildCost():
BuildCost
Defined in: src/ships/build-metrics.ts:812
Price the whole build from the catalogues: shop credits, Merc Coin and the engineering materials its modifications consume.
No modification is charged twice. A Mercenary article arrives at the grade it was sold at, so only the climb above that grade bills materials and further Merc Coin, and an experimental effect the article came with is free while one added on top is not. A fixed reward article — festive, Guardian, community-goal — identifies a recipe it was never rolled from, so it contributes no materials at all.
A frozen BuildCost. credits.modules, credits.total and
credits.rebuy are lower bounds while BuildCredits.unpriced is non-empty;
built-in hull fittings are free rather than unpriced.
This is the one place the build metrics read the material and Merc Coin cost catalogues; import getBlueprintCost and getExperimentalEffectCost directly to price one recipe without a build.
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const build = ShipLoadout.default('Anaconda');
BuildMetrics.of(build).buildCost().credits.hull; // -> 142456440
build.applyBlueprint('FrameShiftDrive', 'FSD_LongRange', { grade: 5 });
BuildMetrics.of(build)
.buildCost()
.materials.find((material) => material.symbol === 'Arsenic')?.count; // -> 5import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { getPreEngineeredVariants } from '@elite-dangerous-almanac/core/ships/pre-engineered';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const variant = getPreEngineeredVariants('Hpt_Railgun_Fixed_Medium')
.find((candidate) => candidate.acquisition === 'mercenary')!;
const build = ShipLoadout.default('Python')
.setPreEngineeredVariant('MediumHardpoint1', variant);
BuildMetrics.of(build).buildCost().mercCoins; // -> 950buildMass(
options?):BuildMass
Defined in: src/ships/build-metrics.ts:753
Weigh the whole build: the hull, the fitted modules, and the load on top of them.
JumpOptions = {}
JumpOptions. fuel defaults to a full main tank and
cargo to 0, matching jumpRange and mobilityMetrics. Pass
standardLoad to weigh one of the standard loads.
A frozen BuildMass, every figure in tonnes.
The mass companion to buildCost, answering the same question in tonnes
that that one answers in credits. Every module's mass is post-engineering, so a
Lightweight roll is already in modules.
The reserve tank is not counted. The main tank is the fuel the drive and the
flight model see, and it is what jumpRange and mobilityMetrics
weigh; the game's statistics panel additionally counts the reserve in the current
mass it displays, so add
fuelCapacity.reserve to
reproduce that reading.
If fuel or cargo is not finite and non-negative.
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const build = ShipLoadout.default('Anaconda');
const mass = BuildMetrics.of(build).buildMass();
mass.hull; // -> 400
mass.modules; // -> 664
mass.total; // -> 1096, a full main tank and an empty hold
BuildMetrics.of(build).buildMass({ cargo: build.cargoCapacity }).total; // -> 1210cellBanks():
CellBankSummary
Defined in: src/ships/build-metrics.ts:1234
Every fitted shield cell bank and the usable rearmed reinforcement pool.
Every fitted bank remains in banks, where powered says whether it is switched
on and its priority group is fed with hardpoints deployed. The totals include only
those powered banks, so a build whose plant is switched off or outdrawn reports
every bank unpowered and zero totals.
A frozen CellBankSummary; no banks is an empty list and zero totals.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
metrics.cellBanks().totalRestorable; // -> MJ across every powered fitted celldistributorMetrics(
options?):DistributorMetrics|null
Defined in: src/ships/build-metrics.ts:1388
All three power-distributor capacitors at selected pip allocations.
DistributorOptions = {}
SYS, ENG and WEP pips in [0, 4], each defaulting
independently to 4. The allocations need not sum to six, which permits
independent comparisons of the three maxima.
DistributorMetrics | null
Capacity, rated four-pip recharge and actual pip-scaled recharge for
SYS, ENG and WEP, or null when the distributor is not fitted, switched off,
shed by the retracted power budget, or its six capacitor stats cannot be
resolved. Use distributorMetricsResult to distinguish those four. That
retracted state represents the distributor itself; firing endurance in
weaponsCapacitorMetrics separately applies the deployed state.
If any pip allocation is outside [0, 4] or not finite.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const distributor = metrics.distributorMetrics({
systemsPips: 2,
enginesPips: 2,
weaponsPips: 2,
});
distributor?.engines.rechargeRate; // MJ/sdistributorMetricsResult(
options?):CalculationResult<DistributorMetrics>
Defined in: src/ships/build-metrics.ts:1412
The build's distributor with a diagnostic when it is unavailable.
DistributorOptions = {}
SYS, ENG and WEP pips in [0, 4], each defaulting to 4.
CalculationResult<DistributorMetrics>
A complete DistributorMetrics value, otherwise null plus the
fitted distributor's state: missing when none is fitted, disabled when it is
switched off, shed when the retracted power budget does not feed it, and
unresolved when its record does not state all six capacitor figures.
If any pip allocation is outside [0, 4] or not finite.
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const build = ShipLoadout.default('Anaconda').setModuleEnabled('PowerDistributor', false);
const result = BuildMetrics.of(build).distributorMetricsResult();
result.complete; // -> false
result.issues[0]?.reason; // -> 'disabled'frameShiftDrive():
FrameShiftDriveParams
Defined in: src/ships/build-metrics.ts:476
The resolved frame-shift-drive constants for this build — post-engineering,
with any Guardian FSD Booster folded into jumpBoost.
The drive's constants.
If no frame shift drive is fitted, or the fitted drive's record is missing any of its required jump constants.
frameShiftDriveMassFactor(
options?):number
Defined in: src/ships/build-metrics.ts:541
The fitted frame shift drive's dimensionless mass factor at a chosen load.
JumpOptions = {}
JumpOptions. fuel defaults to a full main tank and
cargo to 0.
number
optMass / loadedMass: 1 at the drive's optimised mass, below 1
above it and above 1 below it.
This is the mass term used by the jump equation, not the three-point performance curve used by thrusters and shield generators. Main-tank fuel contributes to the loaded mass; the Guardian FSD Booster's additive range does not contribute to the factor.
If the build has no usable frame shift drive.
If fuel or cargo is not finite and non-negative, or loaded mass is zero.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
metrics.frameShiftDriveMassFactor({ fuel: 8, cargo: 32 }); // dimensionlessfuelPerJump(
distance,options?):number
Defined in: src/ships/build-metrics.ts:602
The fuel a single jump of a given distance costs, in tonnes.
number
The jump distance, in light-years.
JumpOptions = {}
JumpOptions. fuel defaults to a full main tank,
cargo to 0.
number
Fuel used, in tonnes (capped at the drive's max fuel per jump).
If the build has no usable frame shift drive.
If fuel or cargo is not finite and non-negative.
heatMetrics():
HeatMetrics|null
Defined in: src/ships/build-metrics.ts:922
The build's heat: what it idles at, what it runs at flying and jumping, and whether firing everything cooks it.
Every figure is post-engineering. The heat a build makes follows what the plant actually feeds, so a module switched off — or one in a priority group the plant cannot keep lit — contributes nothing.
HeatMetrics | null
The HeatMetrics, or null when the build has no powered power
plant whose heat efficiency it can read. Use heatMetricsResult to
distinguish the unavailable conditions.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const heat = metrics.heatMetrics();
heat?.idle.gauge; // -> 0.23, i.e. the gauge reads 23%
heat?.firingSustained.overheats; // -> false: the guns run cool enough to hold
heat?.firingDrained.secondsToOverheat; // -> how long an alpha strike has on an empty WEPheatMetricsResult():
CalculationResult<HeatMetrics>
Defined in: src/ships/build-metrics.ts:942
The build's heat with a diagnostic when its power plant is unavailable.
CalculationResult<HeatMetrics>
A complete HeatMetrics value, otherwise null plus the fitted
power plant's state: missing when none is fitted, disabled when it is
switched off, and unresolved when its record does not state a heat efficiency.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const result = metrics.heatMetricsResult();
if (result.complete) result.value.idle.gauge; // 0 to 1
else result.issues[0].reason; // unavailable-state discriminatorjumpRange(
options?):number
Defined in: src/ships/build-metrics.ts:573
The range of a single jump for a chosen fuel and cargo load, in light-years.
JumpOptions = {}
JumpOptions. fuel defaults to a full main tank,
cargo to 0.
number
The jump's range, in light-years.
If the build has no usable frame shift drive.
If fuel or cargo is not finite and non-negative.
jumpRangeSummary():
JumpRangeSummary
Defined in: src/ships/build-metrics.ts:706
Every jump figure at once — best, unladen, laden, and each load's total.
The JumpRangeSummary. Single-jump figures and each total's
range are in light-years. For a partial load, call jumpRange for one
jump or totalRange for every jump with the fuel and cargo you
actually have.
If the build has no usable frame shift drive.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const jumps = metrics.jumpRangeSummary();
jumps.max; // -> 89.41 (one jump's fuel, empty hold)
jumps.laden; // -> the range with the hold full
jumps.totalMax.jumps; // the best jump expressed as a totalladenJumpRange():
number
Defined in: src/ships/build-metrics.ts:588
Single-jump range on a full tank with a full cargo hold, in light-years.
number
The jump's range, in light-years.
If the build has no usable frame shift drive.
loadout():
ShipLoadout
Defined in: src/ships/build-metrics.ts:464
The build this view reads.
The same ShipLoadout that was passed to of — the aggregate figures, the slots and the editors are all on it.
maxJumpRange():
number
Defined in: src/ships/build-metrics.ts:559
Best single-jump range, in light-years — no cargo, and exactly one jump's fuel aboard (the lightest the ship jumps). This is the figure the game and EDSY label "maximum jump range".
number
The best single jump, in light-years, or 0 for a capture that states a
main tank of 0.
If the build has no usable frame shift drive.
mobilityCapacitorMetrics(
options?):MobilityCapacitorMetrics|null
Defined in: src/ships/build-metrics.ts:1028
The build's speed and rotation rates at a chosen load and ENG-pip allocation.
Boost is not here: it does not move with the allocation, so it stays on mobilityMetrics beside the loaded mass and the two curve multipliers these figures share.
MobilityCapacitorOptions. Fuel defaults to a full main
tank, cargo to 0, and enginesPips to 4 — which reproduces
mobilityMetrics exactly.
MobilityCapacitorMetrics | null
The MobilityCapacitorMetrics, or null when no fully described
thrusters are powered with hardpoints retracted. Use
mobilityCapacitorMetricsResult to distinguish the unavailable conditions.
If fuel or cargo is not finite and non-negative, or
enginesPips is outside [0, 4].
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const metrics = BuildMetrics.of(ShipLoadout.default('SideWinder'));
metrics.mobilityCapacitorMetrics({ enginesPips: 0 })?.enginesPips; // -> 0mobilityCapacitorMetricsResult(
options?):CalculationResult<MobilityCapacitorMetrics>
Defined in: src/ships/build-metrics.ts:1054
The build's ENG capacitor with a diagnostic when its thrusters or retracted power supply is unavailable.
CalculationResult<MobilityCapacitorMetrics>
A complete MobilityCapacitorMetrics value, otherwise null plus
the input or fitted-module state that prevented the calculation — the same
diagnostics mobilityMetricsResult reports, since the two read one build.
If fuel or cargo is not finite and non-negative, or
enginesPips is outside [0, 4].
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const grounded = ShipLoadout.default('SideWinder').setModuleEnabled('MainEngines', false);
const result = BuildMetrics.of(grounded).mobilityCapacitorMetricsResult();
result.issues[0]?.reason; // -> 'disabled'mobilityMetrics(
options?):MobilityMetrics|null
Defined in: src/ships/build-metrics.ts:978
The build's speed, boost and rotation rates at a chosen load and full ENG.
JumpOptions = {}
Fuel defaults to a full main tank and cargo to 0.
MobilityMetrics | null
Loaded MobilityMetrics, or null when no fully described
thrusters are powered with hardpoints retracted. Use
mobilityMetricsResult to distinguish the unavailable conditions.
Main-tank fuel contributes to the flight model's loaded mass. Reserve-tank fuel does not: although the statistics panel includes it in the displayed current mass, ten observed builds reproduce their angular rates only when the reserve is excluded from the thruster mass curve.
These are the four-ENG-pip figures. A lower allocation is mobilityCapacitorMetrics, which owns the pip story the way weaponsCapacitorMetrics owns WEP's.
If fuel or cargo is not finite and non-negative.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
metrics.mobilityMetrics({ cargo: 32, fuel: 8 })?.speed; // -> m/s at four ENG pipsmobilityMetricsResult(
options?):CalculationResult<MobilityMetrics>
Defined in: src/ships/build-metrics.ts:1000
The build's mobility with a diagnostic when its thrusters or retracted power supply is unavailable.
JumpOptions = {}
Fuel defaults to a full main tank and cargo to 0.
CalculationResult<MobilityMetrics>
A complete MobilityMetrics value, otherwise null plus the input
or fitted-module state that prevented the calculation.
If fuel or cargo is not finite and non-negative.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const result = metrics.mobilityMetricsResult();
if (result.complete) result.value.speed; // metres per second
else result.issues[0].reason; // unavailable-state discriminatorpowerBudget():
PowerBudget
Defined in: src/ships/build-metrics.ts:889
The build's power budget: what the plant makes, what the modules draw with hardpoints retracted and deployed, and which priority groups stay lit.
Draws are post-engineering, modules switched off in the journal are skipped, and weapons (plus the utility fittings that are not always powered) count only towards the deployed total.
The PowerBudget. consumers includes modules with positive
draw; passive and zero-draw fittings are absent.
If a power capacity or module draw is negative or not finite.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const power = metrics.powerBudget();
power.available; // -> 20.4 MW generated
power.deployed; // -> 19.02 MW drawn, hardpoints out
power.withinBudget; // -> true
power.bands[4]?.poweredDeployed; // -> is priority group 5 still lit?shieldCapacitorMetrics(
options?):ShieldCapacitorMetrics|null
Defined in: src/ships/build-metrics.ts:1141
The build's SYS capacitor: what the pips hold and recharge, the resistance they add, and what the shields are worth with them folded in.
The effective resistances and hit points here are the ones the game's own panel shows while the allocation stands; shieldMetrics is the bare shield they are built from. Both come from one pass over the build, so a screen showing them side by side need not compute the shield twice.
ShieldCapacitorOptions. systemsPips (0–4) defaults to
4; at 0 the effective figures equal shieldMetrics.
ShieldCapacitorMetrics | null
The ShieldCapacitorMetrics, or null when the build has no
shield generator powered with hardpoints retracted, or a fitted distributor does
not state its SYS figures. Use shieldCapacitorMetricsResult to distinguish
the unavailable conditions. With no distributor fitted, capacity and recharge are
zero — the modelled truth for a build that has no SYS capacitor at all.
If systemsPips is outside [0, 4] or not finite.
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const metrics = BuildMetrics.of(ShipLoadout.default('SideWinder'));
const sys = metrics.shieldCapacitorMetrics({ systemsPips: 4 });
sys?.systemsResistance; // -> 0.6
// Effective hit points behind those pips, against the shield's weakest type.
(sys?.effectiveHitPoints.thermal ?? 0) > (metrics.shieldMetrics()?.strength ?? 0); // -> trueshieldCapacitorMetricsResult(
options?):CalculationResult<ShieldCapacitorMetrics>
Defined in: src/ships/build-metrics.ts:1166
The build's SYS capacitor with a diagnostic when its generator, retracted power supply or distributor record is unavailable.
ShieldCapacitorOptions. systemsPips defaults to 4.
CalculationResult<ShieldCapacitorMetrics>
A complete ShieldCapacitorMetrics value, otherwise null plus
the input or fitted-module state that prevented the calculation: the shield
diagnostics shieldMetricsResult reports, plus
powerDistributor/unresolved for a fitted distributor whose record does not
state its SYS capacity or recharge.
If systemsPips is outside [0, 4] or not finite.
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const unshielded = ShipLoadout.default('SideWinder').removeModule('Slot01_Size2');
const result = BuildMetrics.of(unshielded).shieldCapacitorMetricsResult();
result.issues[0]?.reason; // -> 'missing'shieldMetrics():
ShieldMetrics|null
Defined in: src/ships/build-metrics.ts:1088
The build's shields: strength in megajoules, where it comes from, and the effective resistances.
Shield strength scales with the hull's mass, not the build's, so fitting more modules never weakens it. Boosters, Guardian shield reinforcement and any engineering are all folded in; switched-off or shed boosters and reinforcement are ignored, while a switched-off or shed generator makes the metric unavailable.
These are the pip-free figures, which is what an outfitting screen shows. What the SYS capacitor makes of them is shieldCapacitorMetrics, which owns the pip story the way weaponsCapacitorMetrics owns WEP's.
ShieldMetrics | null
The ShieldMetrics, or null when the build has no shield
generator powered with hardpoints retracted. Use
shieldMetricsResult to distinguish the unavailable conditions.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const shields = metrics.shieldMetrics();
shields?.strength; // -> MJ
shields?.resistances.thermal; // -> negative on a stock generator
metrics.shieldCapacitorMetrics()?.effectiveResistances.thermal; // -> with 4 pips to SYSshieldMetricsResult():
CalculationResult<ShieldMetrics>
Defined in: src/ships/build-metrics.ts:1108
The build's shields with a diagnostic when its hull, generator or retracted power supply is unavailable.
CalculationResult<ShieldMetrics>
A complete ShieldMetrics value, otherwise null plus the input
or fitted-module state that prevented the calculation.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const result = metrics.shieldMetricsResult();
if (result.complete) result.value.strength; // megajoules
else result.issues[0].reason; // unavailable-state discriminatorshieldRecovery(
options?):ShieldRecovery|null
Defined in: src/ships/build-metrics.ts:1190
Time for this build's shield to rise after collapse and then regenerate to full.
ShieldRecoveryOptions. SYS pips in [0, 4], defaulting
to 4 — not the 0 shieldMetrics defaults to.
ShieldRecovery | null
Recovery rates and seconds, or null when no shield generator is powered
with hardpoints retracted. Use
shieldRecoveryResult to distinguish the unavailable conditions.
Insufficient zero-pip recharge produces Infinity.
If systemsPips is outside [0, 4] or not finite.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
metrics.shieldRecovery({ systemsPips: 4 })?.recoveryTime; // -> seconds from collapse to 50%shieldRecoveryResult(
options?):CalculationResult<ShieldRecovery>
Defined in: src/ships/build-metrics.ts:1213
The build's shield recovery with a diagnostic when its hull, generator or retracted power supply is unavailable.
ShieldRecoveryOptions. SYS pips in [0, 4], defaulting
to 4.
CalculationResult<ShieldRecovery>
A complete ShieldRecovery value, otherwise null plus the input
or fitted-module state that prevented the calculation.
If systemsPips is outside [0, 4] or not finite.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const result = metrics.shieldRecoveryResult();
if (result.complete) result.value.recoveryTime; // seconds
else result.issues[0].reason; // unavailable-state discriminatorstandardLoad(
load):StandardLoadInputs|null
Defined in: src/ships/build-metrics.ts:659
One of the package's standard load conditions, or null when the fitted drive
cannot support it.
'maximum' for one jump's fuel and no cargo, 'unladen' for a
full main tank and no cargo, or 'laden' for a full main tank and full hold.
StandardLoadInputs | null
The fuel and cargo carried and the StandardLoadInputs.mass, or
null. Only 'maximum' can answer null: it validates the whole fitted drive,
jump booster included, so a non-null one can be passed straight to
jumpRange. Use standardLoadResult to learn why it is unavailable.
If load is not a recognised standard load.
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const metrics = BuildMetrics.of(ShipLoadout.default('Anaconda'));
metrics.standardLoad('laden')?.mass; // -> 1210, tonnes with a full tank and holdstandardLoadResult(
load):CalculationResult<StandardLoadInputs>
Defined in: src/ships/build-metrics.ts:682
Resolve one of the package's standard load conditions for jump and mobility views.
'maximum' for one jump's fuel and no cargo, 'unladen' for a
full main tank and no cargo, or 'laden' for a full main tank and full hold.
CalculationResult<StandardLoadInputs>
The fuel and cargo carried, and the StandardLoadInputs.mass the
ship weighs carrying them, all in tonnes. Only 'maximum' can come back
incomplete: it validates the whole fitted drive, jump booster included, so a
complete one can be passed straight to jumpRange.
If load is not a recognised standard load.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const load = metrics.standardLoadResult('maximum');
if (load.complete) metrics.mobilityCapacitorMetrics({ ...load.value, enginesPips: 2 });thrusters():
ThrusterParams|null
Defined in: src/ships/build-metrics.ts:514
The fitted thrusters' post-engineering mass curve, or null when the build has
none — the thruster counterpart of frameShiftDrive.
ThrusterParams | null
A ThrusterParams carries the three masses the
curve is defined over and the multiplier at each, plus the separate speedCurve
and rotationCurve an enhanced-performance thruster refines them with. Pass it
straight to
thrusterMassCurveMultiplier for the
multiplier at a mass of your own, or read optMass and maxMass against
loadedMass for where this build sits
on the curve.
This is the fitted article's curve, so a switched-off or shed thruster still has
one; mobilityMetricsResult is what judges whether the build can use it.
It answers null rather than throwing — unlike frameShiftDrive, which the
jump equation cannot do without — when no thrusters are fitted or the fitted
record carries no complete curve.
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const metrics = BuildMetrics.of(ShipLoadout.default('Anaconda'));
metrics.thrusters()?.optMass; // -> 1440, tonnes
metrics.thrusters()?.maxMass; // -> 2160, past which the ship does not move at alltotalRange(
options?):TotalRangeDetails
Defined in: src/ships/build-metrics.ts:630
Total range and jump count for a chosen fuel and cargo load.
JumpOptions = {}
JumpOptions. fuel defaults to a full main tank,
cargo to 0.
Summed range in light-years and the jumps made before the tank is empty.
If the build has no usable frame shift drive.
If fuel or cargo is not finite and non-negative, or the fuel load would require more than 100,000 jumps.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
metrics.totalRange().jumps; // jumps available from one full main tank
metrics.totalRange({ fuel: 8, cargo: 32 }).range; // range for that partial loadweaponMetrics():
BuildWeaponMetrics
Defined in: src/ships/build-metrics.ts:1292
The build's firepower: DPS, sustained DPS, weapons-capacitor draw, heat and power draw for every fitted weapon, plus the totals.
Every figure is post-engineering. A weapon switched off in the journal is still listed — with its own metrics — but left out of the totals.
The BuildWeaponMetrics.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
const guns = metrics.weaponMetrics();
guns.total.damagePerSecond; // -> burst DPS across the hardpoints
guns.total.sustainedDamagePerSecond; // -> with reloads folded in
guns.total.energyPerSecond; // -> MW asked of the WEP capacitor
guns.total.powerDraw; // -> MW asked of the power plant when deployed
guns.weapons[0]?.metrics.damageByType.thermal;
guns.weapons[0]?.maximumRange; // post-engineering metres, when known
guns.weapons[0]?.armourPiercing; // post-engineering rating, when known
guns.weapons[0]?.ammunition?.total; // -> rounds aboard when fully rearmedweaponsCapacitorMetrics(
options?):WeaponsCapacitorMetrics
Defined in: src/ships/build-metrics.ts:1346
WEP-capacitor recharge and endurance while every powered weapon fires.
WeaponsOptions = {}
WEP pips in [0, 4], defaulting to 4.
Actual recharge, sustained draw, net drain and seconds from full to
empty. The deployed power budget is applied to the distributor and weapons, so a
module the plant sheds contributes nothing. With no powered distributor, capacity
and recharge are zero. A load that draws no more than recharge reports
Infinity for timeToDrain.
If weaponsPips is outside [0, 4] or not finite.
import type { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
declare const metrics: BuildMetrics;
metrics.weaponsCapacitorMetrics({ weaponsPips: 2 }).timeToDrain; // seconds
staticof(build):BuildMetrics
Defined in: src/ships/build-metrics.ts:453
Attach a metrics view to a build.
The build to read. The view holds it rather than copying it, so later edits are visible to every subsequent call.
BuildMetrics
The view.
If build is not a ShipLoadout.
import { BuildMetrics } from '@elite-dangerous-almanac/core/ships/build-metrics';
import { ShipLoadout } from '@elite-dangerous-almanac/core/ships/ship-loadout';
const build = ShipLoadout.default('Anaconda');
const metrics = BuildMetrics.of(build);
metrics.buildMass().modules; // -> 664
build.removeModule('Slot03_Size6'); // unfit the 40 t shield generator
metrics.buildMass().modules; // -> 624, the same view reading the edited buildGuides
astro
Classes (1)
ProceduralSystem
Properties
Accessors
Methods
Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
- absoluteBoxelToBoxelCode
- boxelCodeToAbsoluteBoxel
- boxelCodeToLetters
- boxelEdgeLy
- boxelInternalSize
- canonicalizeSectorName
- canonicalizeSystemName
- decodeModSystemAddress
- decodeSystemAddress
- encodeModSystemAddress
- encodeSystemAddress
- findHandAuthoredRegionAt
- formatSystemName
- getCodexRegion
- getCodexRegionByName
- getHandAuthoredRegionOrigin
- getNebulaByName
- isPermitLockedRegionName
- isPermitLockedSystemName
- isProceduralSystemName
- lettersToBoxelCode
- massCodeToSizeClass
- nearestNebulae
- nebulaeWithin
- parseSystemName
- permitLockedRegionForSystemName
- permitLockedSystemForAddress
- permitLockedSystemForName
- permitLockForSystemName
- resolveNamingRegionOrigin
- sectorGridPositionFromGalacticPosition
- sectorGridPositionFromName
- sectorNameFromGalacticPosition
- sectorNameFromGridPosition
- sizeClassToMassCode
- toSystemAddress
- tryToSystemAddress
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
- getBlueprintName
- getCalculationIssueMessage
- getEngineeringGroupName
- getExperimentalEffectDescription
- getExperimentalEffectName
- getLoadoutEditErrorMessage
- getLoadoutIssueMessage
- getLoadoutSlotName
- getMaterialName
- getMicroResourceName
- getModuleName
- getOutfittingFamilyName
- getPreEngineeredVariantName
- getShipManufacturer
- getShipName
- getSlefDiagnosticMessage
- getSlotRestrictionLabel
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
ships
Classes (3)
BuildMetrics
Methods
- armourMetrics()
- buildCost()
- buildMass()
- cellBanks()
- distributorMetrics()
- distributorMetricsResult()
- frameShiftDrive()
- frameShiftDriveMassFactor()
- fuelPerJump()
- heatMetrics()
- heatMetricsResult()
- jumpRange()
- jumpRangeSummary()
- ladenJumpRange()
- loadout()
- maxJumpRange()
- mobilityCapacitorMetrics()
- mobilityCapacitorMetricsResult()
- mobilityMetrics()
- mobilityMetricsResult()
- powerBudget()
- shieldCapacitorMetrics()
- shieldCapacitorMetricsResult()
- shieldMetrics()
- shieldMetricsResult()
- shieldRecovery()
- shieldRecoveryResult()
- standardLoad()
- standardLoadResult()
- thrusters()
- totalRange()
- weaponMetrics()
- weaponsCapacitorMetrics()
- of()
LoadoutEditError
Constructors
Properties
Methods
ShipLoadout
Accessors
- cargoCapacity
- fuelCapacity
- hullValue
- importOutcomes
- modulesValue
- rebuy
- shipIdent
- shipName
- shipSymbol
- sourcePurchase
- unladenMass
Methods
- applyBlueprint()
- availableBlueprints()
- availableExperimentalEffects()
- clearEngineering()
- completeEngineeringGrade()
- fittedModuleAt()
- fittedModules()
- modulesForSlot()
- removeModule()
- repairFixedMount()
- setExperimentalEffect()
- setModule()
- setModuleEnabled()
- setModulePriority()
- setPreEngineeredVariant()
- slots()
- toLoadoutEvent()
- toSlef()
- toSlefString()
- validation()
- default()
- empty()
- fromLoadout()
- fromSlef()
Interfaces (125)
- AmmunitionCapacity
- AmmunitionStats
- ApplyBlueprintOptions
- ArmourInput
- ArmourMetrics
- AvailableBlueprint
- Blueprint
- BlueprintFeature
- BlueprintGrade
- BlueprintModuleEngineering
- BuildCost
- BuildCredits
- BuildMass
- BuildSlotBase
- BuildWeaponMetrics
- BulkheadParams
- CalculationIssue
- CellBankInput
- CellBankMetrics
- CellBankSummary
- CoreBuildSlot
- CoreSlots
- DamageComponents
- DamageDistribution
- DamageResistanceParams
- DamageSplit
- DamageTypeValues
- DistributorCapacitorMetrics
- DistributorInput
- DistributorMetrics
- DistributorOptions
- DistributorPips
- EngineeringMaterial
- EngineeringModifier
- EngineeringNormalizationUnchanged
- EngineeringNormalizationUnsupported
- EngineeringNormalized
- EngineeringOptionGroup
- ExperimentalContribution
- ExperimentalEffect
- ExperimentalEffectUnchanged
- ExperimentalEffectUnsupported
- ExperimentalEffectUpdated
- FittedModule
- FittedWeaponMetrics
- FrameShiftDriveJumpStats
- FrameShiftDriveParams
- FuelCapacity
- GunsightPoint
- HardpointBuildSlot
- HardpointSlotSpec
- HeatInput
- HeatMetrics
- HeatState
- HeatWeapon
- HullReinforcementParams
- JumpOptions
- JumpRangeSummary
- LoadoutCalculationModule
- LoadoutEvent
- LoadoutExportOptions
- LoadoutIssue
- LoadoutMass
- LoadoutModule
- LoadoutValidation
- LoadoutValidationInput
- MassCurveStats
- MobilityCapacitorInput
- MobilityCapacitorMetrics
- MobilityCapacitorOptions
- MobilityInput
- MobilityMetrics
- ModuleLimitEntry
- ModuleLimitIncrease
- ModuleLimitUsage
- ModuleReinforcementParams
- OptionalBuildSlot
- OptionalSlotSpec
- OutfittingModule
- OutfittingModuleIdentity
- OutfittingModuleStats
- ParsedSlot
- PowerBand
- PowerBudget
- PowerConsumer
- PowerConsumerResult
- PowerDistributorStats
- PowerGenerationStats
- PreEngineeredModifier
- PreEngineeredVariant
- ProjectileRangeBoundaries
- ShieldBoosterParams
- ShieldCapacitorInput
- ShieldCapacitorMetrics
- ShieldCapacitorOptions
- ShieldGeneratorParams
- ShieldInput
- ShieldMetrics
- ShieldRecovery
- ShieldRecoveryInput
- ShieldRecoveryOptions
- ShieldRegenerationStats
- Ship
- ShipSlots
- SimpleBuildSlot
- SlefDiagnostic
- SlefEntry
- SlefExportOptions
- SlefHeader
- SlefInspection
- SlefStringifyOptions
- SourceModuleValue
- SourcePurchaseRecord
- StandardLoadInputs
- ThrusterCurveParams
- ThrusterParams
- TotalRangeDetails
- ValidationModule
- WeaponDamageStats
- WeaponMetrics
- WeaponsCapacitorInput
- WeaponsCapacitorMetrics
- WeaponsOptions
- WeaponStats
- WeaponTotals
Type Aliases (44)
- BlueprintGrades
- BuildSlot
- CalculationIssueReason
- CalculationResult
- CoreSlotType
- DamageResistances
- DamageType
- EngineeringGroupId
- EngineeringNormalizationCode
- EngineeringNormalizationResult
- ExperimentalEffectMutationCode
- ExperimentalEffectMutationResult
- FixedMountRepairResult
- GunsightOffset
- HardpointRestriction
- ImmovableReason
- LoadoutEditErrorCode
- LoadoutImportOutcome
- LoadoutIssueCode
- LoadoutIssueParam
- LoadoutIssueParams
- LoadoutSlot
- ModifierMethod
- ModuleCategory
- ModuleEngineering
- ModuleExclusionGroup
- ModuleFitConstraint
- ModuleGuidance
- ModuleLimitGroup
- ModuleMount
- ModuleRating
- ModuleSlot
- OptionalRestriction
- OutfittingFamilyId
- PreEngineeredAcquisition
- ShipGunsight
- ShipGunsightCatalogue
- Slef
- SlefConstraint
- SlefDiagnosticCode
- SlotKind
- SlotRestriction
- StandardLoad
- ThrusterLoad
Variables (10)
Functions (85)
- ammunitionCapacity
- armourMetrics
- armourPiercingFactor
- calculateCargoCapacity
- calculateFuelCapacity
- calculateModuleLimits
- calculateUnladenMass
- cellBankSummary
- combinedRateOfFire
- computeModifiers
- damageFalloff
- damagePerSecond
- distributorMetrics
- effectiveHitPoints
- effectiveWeaponThermalLoad
- energyPerSecond
- enumerateSlots
- equilibriumHeatLevel
- frameShiftDriveMassFactor
- fuelPerJump
- getBlueprint
- getBlueprintGrade
- getBlueprintsForModule
- getBulkheadsForShip
- getEngineeringGroup
- getExperimentalEffect
- getExperimentalsForBlueprint
- getExperimentalsForModule
- getLoadoutModifier
- getModuleBySymbol
- getModulesByName
- getPreEngineeredJournalModifiers
- getPreEngineeredModifiers
- getPreEngineeredStats
- getPreEngineeredVariants
- getShipByName
- getShipBySymbol
- getShipGunsight
- getShipSlots
- getSourceModuleValue
- hasFrameShiftDriveJumpStats
- hasMassCurveStats
- hasPowerDistributorStats
- hasPowerGenerationStats
- hasShieldRegenerationStats
- hasWeaponDamageStats
- heatLevelAtTime
- heatMetrics
- heatPerSecond
- identifyPreEngineeredVariant
- inspectSlef
- isPreEngineered
- mapDamageTypes
- mobilityCapacitorMetrics
- mobilityMetrics
- parseSlef
- parseSlotName
- powerBudget
- projectGunsight
- resolveBlueprintForModule
- secondsToHeatLevel
- shieldCapacitorMetrics
- shieldMassCurveMultiplier
- shieldMetrics
- shieldRecovery
- shieldStrength
- singleJumpRange
- sourcePurchaseFromLoadout
- splitDamage
- stackArmourResistance
- stackShieldResistance
- stringifySlef
- sumMaterials
- sumSourceModuleValues
- sumWeaponMetrics
- sustainedDamagePerSecond
- sustainedFireFactor
- systemsResistance
- thrusterMassCurveMultiplier
- toSlef
- totalRange
- unresolvedModifiers
- validateLoadout
- weaponMetrics
- weaponsCapacitorMetrics