ships.Function.splitDamage - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / ships / splitDamage
splitDamage(
damage,distribution?):DamageSplit
Defined in: src/ships/weapons.ts:306
Split a per-second (or per-shot) damage figure by damage type.
number
The figure to split — DPS, sustained DPS, damage per shot, anything.
The weapon's damage distribution. Absent treats the whole figure as absolute damage, which no resistance reduces.
The share of damage in each type. antiXeno overlays conventional damage
rather than partitioning it; the other returned amounts sum back to damage.
import { splitDamage } from '@elite-dangerous-almanac/core/ships/weapons';
splitDamage(60, { kinetic: 1 / 3, thermal: 2 / 3 }); // -> { kinetic: 20, thermal: 40, ... }