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

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

Function: computeModifiers()

computeModifiers(base, grade, quality?, experimental?): EngineeringModifier[]

Defined in: src/ships/engineering.ts:216

Compute the primitive stat modifiers a blueprint (and optional experimental effect) produces on a set of base stats.

Parameters

base

Readonly<Record<string, number>>

The module's base stat values, keyed by journal Modifier Label (only the labels present here can be modified — a contribution to an absent stat is skipped). Two labels are also read without being modified: Range resolves Long Range's falloff flag, and BurstSize rounds an engineered clip to whole bursts, so a partial base gets a plain round-up on a weapon that fires in bursts.

grade

BlueprintGrade | readonly BlueprintFeature[]

A complete blueprint grade (from getBlueprintGrade). A raw feature list is also accepted for callers synthesising modifiers without a catalogue record.

quality?

number = 1

The engineering system's shared quality roll, 01. Defaults to 1 (best roll). Legacy-engineered modules advanced each attribute independently and cannot be reconstructed from their single reported quality; import their journal-stated modifiers instead.

experimental?

ExperimentalEffect | readonly ExperimentalContribution[]

A complete experimental effect (from getExperimentalEffect), if any. A raw contribution list is also accepted for callers synthesising effects without a catalogue record.

Returns

EngineeringModifier[]

One EngineeringModifier per modified catalogue label. Numeric stats carry the computed Value and OriginalValue; a granted capability carries ValueStr. Recipe-only labels such as BurstInterval are deliberately preserved; journal serialization derives the labels Frontier exposes from these results.

Throws

If quality is not a finite number in [0, 1].

⚠️ **GitHub.com Fallback** ⚠️