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

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

Function: splitDamage()

splitDamage(damage, distribution?): DamageSplit

Defined in: src/ships/weapons.ts:306

Split a per-second (or per-shot) damage figure by damage type.

Parameters

damage

number

The figure to split — DPS, sustained DPS, damage per shot, anything.

distribution?

DamageDistribution

The weapon's damage distribution. Absent treats the whole figure as absolute damage, which no resistance reduces.

Returns

DamageSplit

The share of damage in each type. antiXeno overlays conventional damage rather than partitioning it; the other returned amounts sum back to damage.

Example

import { splitDamage } from '@elite-dangerous-almanac/core/ships/weapons';

splitDamage(60, { kinetic: 1 / 3, thermal: 2 / 3 }); // -> { kinetic: 20, thermal: 40, ... }
⚠️ **GitHub.com Fallback** ⚠️