DotNet.Ships.Class.Shields - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

EliteDangerousAlmanac / Ships / Shields

Class: Shields

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Shields.cs:175

Shield strength in megajoules, and the resistances that decide what that strength is worth against each damage type.

Remarks

A generator's strength multiplier is read off a curve against the ship's hull mass: the bare hull, and not the loaded ship, so fitting more modules never weakens the shields. Past the generator's maximum mass it raises no shield at all.

Resistances stack separately, with their own diminishing returns, in Resistances. Everything here is pip-free. The SYS capacitor's own resistance, and the effective figures it buys, are in ShieldCapacitor.

Reference implementation: EDCD/Coriolis, src/app/shipyard/Calculations.js. The algorithm is ported as fact rather than as code. See ATTRIBUTIONS.md for credit and licence terms.

Methods

MassCurveMultiplier()

static MassCurveMultiplier(hullMass, generator): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Shields.cs:195

A shield generator's strength multiplier at a given hull mass.

Parameters

hullMass

double

The hull's mass, in tonnes, and not the loaded ship's.

generator

ShieldGeneratorParams

The generator's curve, post-engineering.

Returns

double

The multiplier to apply to the hull's base shield strength. It is zero past the generator's maximum mass, because a generator cannot raise a shield around a hull heavier than it is rated for, and zero for a generator whose record is missing part of its curve.

Remarks

This is the same curve Mobility.ThrusterMassCurveMultiplier reads a thruster's performance off, and the two agree on every input they both accept.

Exceptions

ArgumentNullException

generator is null.

ArgumentOutOfRangeException

The hull mass is not a finite number of zero or more, or the generator carries all six curve values and they are not a physical curve. A curve that is merely absent still answers zero: a record missing a value is data that is missing, not data that is wrong.

Metrics()

static Metrics(input): ShieldMetrics

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Shields.cs:246

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

Parameters

input

ShieldInput

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

Returns

ShieldMetrics

The build's shield metrics. With no generator fitted there is no shield for a resistance to apply to: every strength figure is zero, any reinforcement passed is dropped, and the resistances and the effective hit points are zero for every damage type.

Remarks

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

Exceptions

ArgumentNullException

input is null.

ArgumentOutOfRangeException

With a generator fitted, the hull mass is not a finite number of zero or more, or the generator carries a complete but non-physical curve. A generator whose record is only missing part of its curve is not a failure: the hull mass is never read, and every strength figure is zero.

Strength()

static Strength(hullMass, baseShieldStrength, generator, boostMultiplier?): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Shields.cs:212

A build's shield strength, in megajoules.

Parameters

hullMass

double

The hull's mass, in tonnes.

baseShieldStrength

double

The hull's base shield strength, in megajoules.

generator

ShieldGeneratorParams

The fitted generator, post-engineering.

boostMultiplier

double = 1

The boosters' combined multiplier, which is one with none fitted.

Returns

double

The shield's megajoules, before any Guardian reinforcement addition. It is zero wherever MassCurveMultiplier is.

Exceptions

ArgumentNullException

generator is null.

ArgumentOutOfRangeException

The hull mass is not a finite number of zero or more, or the generator carries a complete but non-physical curve.

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