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

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

Function: shieldMetrics()

shieldMetrics(input): ShieldMetrics

Defined in: src/ships/shields.ts:361

A build's bare shields: strength, where it comes from, and the resistances the generator and boosters stack up between them.

These are the pip-free figures, the ones an outfitting screen shows. The SYS capacitor is a separate story with its own entry point, shieldCapacitorMetrics, which takes what this returns and folds a pip allocation into it.

Parameters

input

ShieldInput

The hull's mass and base shield strength, the fitted generator, and any powered boosters and Guardian reinforcement.

Returns

ShieldMetrics

The ShieldMetrics. With no generator fitted there is no shield for a resistance to apply to: every strength figure is 0 — any reinforcement passed is dropped, since a Guardian package has no shield to reinforce — and resistances and effectiveHitPoints are 0 for every damage type. massCurveMultiplier is 0 and boostMultiplier is 1, whatever boosters are fitted, since there is no generator strength to multiply.

Throws

With a generator fitted, if hullMass is not a finite number of zero or more, or the generator carries a complete but non-physical curve — the contract shieldMassCurveMultiplier documents, reported as shieldMetrics. A generator whose record is simply missing part of its curve is not a failure: hullMass is never read, and massCurveMultiplier and every strength figure are 0.

Example

import { shieldMetrics } from '@elite-dangerous-almanac/core/ships/shields';
import type { ShieldGeneratorParams } from '@elite-dangerous-almanac/core/ships/shields';

declare const gen: ShieldGeneratorParams;

const shields = shieldMetrics({
  hullMass: 400,
  baseShieldStrength: 350,
  generator: gen,
  boosters: [{ shieldBoost: 0.2, kineticResistance: 0 }],
});
shields.strength;                 // -> MJ
shields.resistances.kinetic;      // -> effective kinetic resistance
shields.effectiveHitPoints.kinetic; // -> kinetic damage the shield can soak
⚠️ **GitHub.com Fallback** ⚠️