ships.Function.getPreEngineeredStats - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / ships / getPreEngineeredStats
getPreEngineeredStats(
variant):OutfittingModule|null
Defined in: src/ships/pre-engineered-stats.ts:436
A pre-engineered variant resolved into a module record you can fit.
Returns the base module's catalogue record with every stat the variant modifies — and
that the catalogue carries — replaced by its engineered value. symbol, name,
class, rating and cost are the base module's throughout: a pre-engineered
variant is the same article with different numbers, not a different module. A final
variant also carries engineeringLocked: true, so fitting the resolved article keeps
that restriction.
Exact damage components scale with an engineered damage value so their proportions
and the anti-xeno overlay remain coherent with the resolved scalar.
A caller-supplied variant with no stat block resolves to a copy of the base record with only its baked experimental effect applied.
rateOfFire follows a moved firing cycle even though no recipe names it: an article
whose burst interval, burst size or within-burst rate moves — by its own stat block or
by the experimental effect baked into it — resolves the rate those parts produce, and
it is the same figure getPreEngineeredJournalModifiers states for the article.
A pre-engineered variant.
OutfittingModule | null
The resolved module record, or null when the variant's symbol is not in the
module catalogues. It is always a record of your own — never the shared catalogue
singleton — so you may adjust it before fitting it; its nested values are still the
catalogue's frozen ones, so replace them rather than write into them.
import { getModuleBySymbol } from '@elite-dangerous-almanac/core/ships/modules';
import { getPreEngineeredVariants } from '@elite-dangerous-almanac/core/ships/pre-engineered';
import { getPreEngineeredStats } from '@elite-dangerous-almanac/core/ships/pre-engineered-stats';
const shard = getPreEngineeredVariants('Hpt_Guardian_ShardCannon_Fixed_Medium')[0]!;
const stock = getModuleBySymbol(shard.symbol)!;
const fitted = getPreEngineeredStats(shard)!;
stock.mass; // -> 4
fitted.mass; // -> 6 (the variant carries Mass +50%)