Skip to content

ships.blueprint costs.Function.getBlueprintCost

github-actions[bot] edited this page Aug 27, 2026 · 75 revisions

@elite-dangerous-almanac/core / ships/blueprint-costs / getBlueprintCost

Function: getBlueprintCost()

getBlueprintCost(blueprintSymbol, grade, currentGrade?): BlueprintCost | null

Defined in: src/ships/blueprint-costs.ts:212

Compute the total cost of engineering a module up to a grade — every grade the module still has to climb, each rolled the number of times it takes to complete, summed into one shopping list and one Merc Coin total.

Grade N takes N rolls to fill its progress bar (grade 1 → 1 roll, grade 2 → 2 rolls, … grade 5 → 5 rolls), and each roll costs that grade's recipe once, so the climb is weighted rather than a plain sum — for the materials and the Merc Coin alike.

By default it prices the whole climb from unengineered; pass currentGrade to price only what remains. Each grade g in currentGrade + 1 … grade contributes g · (grade g's cost). To price a single grade's complete progression, set currentGrade to grade − 1; use getBlueprintGradeCost for one roll.

A Mercenary article is bought at grade 1 and its recipe defines grades 2–5, so pass 1 to price what an engineer can still add. The four ordinary-menu recipes that also bill Merc Coin — FuelScoop_Efficiency and the three *Laser_ThermalPlasmaConversion — define grades 1–5 on a stock module and climb from 0 like any other recipe.

This is blueprint cost only. An experimental effect is a separate application, and it costs materials alone; combine its getExperimentalEffectCost result with materials here using sumMaterials, and mercCoins needs no such folding.

The game writes three colliding ids for two different recipes, but each pair costs the same at every grade. Either spelling therefore prices correctly without a fitted module; cross-catalogue tests pin that invariant.

Parameters

blueprintSymbol

string

The blueprint id, e.g. "FSD_LongRange", matched case-insensitively after trimming surrounding whitespace.

grade

number

The target grade, 15.

currentGrade?

number = 0

The completed grade, 05; defaults to 0 for an unengineered module. Only grades above it are charged; currentGrade >= grade costs nothing ({ materials: [], mercCoins: 0 }).

Returns

BlueprintCost | null

The summed materials and Merc Coin total, or null if no ordinary craft cost is catalogued for the blueprint and target grade. A blueprint that starts above grade 1 charges only the grades it defines. mercCoins is 0 where the recipe charges no currency, so null remains the one answer meaning "not catalogued".

Throws

If grade is not an integer from 1 through 5, or currentGrade is not an integer from 0 through 5.

Throws

If blueprintSymbol is present and not a string. A nullish blueprintSymbol is a miss, answered the way an unrecognised one is.

Example

import { getBlueprintCost } from '@elite-dangerous-almanac/core/ships/blueprint-costs';

getBlueprintCost('FSD_LongRange', 5);    // grades 1–5
getBlueprintCost('FSD_LongRange', 5, 3); // grades 4 and 5 only
getBlueprintCost('FSD_LongRange', 5, 4); // grade 5 progression only

getBlueprintCost('FSD_LongRange', 5)?.mercCoins; // -> 0
getBlueprintCost('RailGun_LongShot', 5, 1)?.mercCoins; // -> 415
getBlueprintCost('FuelScoop_Efficiency', 5)?.mercCoins; // -> 350

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (16)
Type Aliases (3)
Variables (11)
Functions (37)
Subpath modules (3)
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)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally