ships.Function.damageFalloff - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / ships / damageFalloff
damageFalloff(
weapon,metres):number
Defined in: src/ships/weapons.ts:449
How much of a weapon's damage still lands at a given range.
The weapon's stats.
number
The range to the target, in metres.
number
A factor in [0, 1]: 1 inside the falloff range, tapering linearly to
0 at maximum range and staying there beyond it. A weapon with no falloff data
reports 1 up to its maximum range. Projectile boundary parameters are deliberately
ignored: this function calculates attenuation, not projectile reach.
import { damageFalloff } from '@elite-dangerous-almanac/core/ships/weapons';
const mc = { maximumRange: 4000, falloffRange: 2000 };
damageFalloff(mc, 1500); // -> 1
damageFalloff(mc, 3000); // -> 0.5
damageFalloff(mc, 5000); // -> 0