ships.Function.armourPiercingFactor - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / ships / armourPiercingFactor
armourPiercingFactor(
armourPiercing,hardness):number
Defined in: src/ships/weapons.ts:478
How much of a weapon's damage a hull's hardness lets through.
number
The weapon's piercing rating.
number
The target hull's finite, non-negative Ship.hardness.
Pass 0 when the hardness is unknown, which disables hardness scaling.
number
A factor in [0, 1]: 1 when the weapon out-pierces the hull, otherwise
armourPiercing / hardness. A zero piercing rating returns 0 when hardness is
positive; zero hardness always returns 1 because it disables hardness scaling.
Applies to hull damage only — shields do not care.
If either argument is not a finite non-negative number.
import { armourPiercingFactor } from '@elite-dangerous-almanac/core/ships/weapons';
armourPiercingFactor(22, 65); // -> 0.338… a small multi-cannon against an Anaconda
armourPiercingFactor(100, 65); // -> 1 a rail gun goes straight through