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

EliteDangerousAlmanac / Ships / Resistances

Class: Resistances

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Resistances.cs:86

How a build's shield and hull resistances stack, including the diminishing returns the game applies once they get high.

Remarks

A resistance is the fraction of incoming damage removed, and its complement is the damage multiplier, which is what stacking actually multiplies. Sources stack multiplicatively on that multiplier, so two twenty percent resisters leave sixty-four percent of the damage rather than sixty. The game then bends the result so that stacking cannot run away.

On shields, once the boosters push the multiplier below seventy percent of what the generator alone gives, the remaining gain is halved. On a hull, once the stack drops the multiplier below the best single source, capped at seventy percent, the range is squeezed the same way; and where the squeeze would raise the multiplier, the plain product stands.

This type holds no data: fractions go in and fractions come out. The reference implementation is EDCD coriolis, and the algorithm is ported as fact rather than as code; see ATTRIBUTIONS.md for credit and licence terms.

Methods

EffectiveHitPoints()

static EffectiveHitPoints(total, resistances): DamageTypeValues

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Resistances.cs:118

How much raw damage of each type a pool of hit points can soak.

Parameters

total

double

The pool, in whatever unit it is measured: hull points for armour, megajoules for shields.

resistances

DamageTypeValues

The effective resistances the pool sits behind, already stacked.

Returns

DamageTypeValues

The effective hit points per damage type, in the same unit as the pool, and infinity at or above a full resistance: nothing of that type gets through.

Remarks

A negative resistance is a weakness and reports fewer effective hit points than the pool holds, which is the point: lightweight alloy soaks less kinetic damage than its hull points suggest.

Exceptions

ArgumentNullException

resistances is null.

MapDamageTypes()

static MapDamageTypes(value): DamageTypeValues

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Resistances.cs:92

Builds one figure per damage type.

Parameters

value

Func<DamageType, double>

Called with each damage type in turn, and answers that type's figure.

Returns

DamageTypeValues

The four figures in one record.

Exceptions

ArgumentNullException

value is null.

StackArmourResistance()

static StackArmourResistance(bulkhead, reinforcements?): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Resistances.cs:151

A hull stack's effective resistance to one damage type.

Parameters

bulkhead

double

The fitted armour's resistance to this damage type, as a fraction. Lightweight alloy is a kinetic weakness rather than a resistance.

reinforcements

IReadOnlyList<double>? = null

Each fitted hull reinforcement package's resistance to the same type.

Returns

double

The effective resistance, as a fraction.

StackShieldResistance()

static StackShieldResistance(generator, boosters?): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Resistances.cs:139

A shield stack's effective resistance to one damage type.

Parameters

generator

double

The shield generator's resistance to this damage type, as a fraction. A negative figure is a weakness.

boosters

IReadOnlyList<double>? = null

Each powered shield booster's resistance to the same type.

Returns

double

The effective resistance, as a fraction: the share of incoming damage of that type the shields remove.

SystemsResistance()

static SystemsResistance(pips): double

Defined in: dotnet/src/EliteDangerousAlmanac/Ships/Resistances.cs:172

The extra shield resistance that pips to the systems capacitor buy, on top of the generator and the boosters.

Parameters

pips

double

Pips to the systems capacitor, from zero through four. A fractional allocation is allowed, because the game's own curve is continuous.

Returns

double

The resistance the pips add, as a fraction, rising to sixty percent at four pips.

Remarks

It applies to every damage type, absolute included, and multiplies with the shield's own resistance rather than adding to it.

Exceptions

ArgumentOutOfRangeException

pips is not a finite number from zero through four.

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