mwg API
    Preparing search index...

    Interface RangeBand

    A damage/effect multiplier keyed to range band - the "melee bonus, falls off at range" or "point-blank penalty on a ranged weapon" family of modifiers many games attach to an attack once its distance is known. mwg supplies no default bands or multipliers, only the lookup: bands are checked in order, the first whose max is at or above distance applies, and a distance past every band's max falls back to beyond.

    import { rangeMultiplier, areaFalloffMultiplier, type RangeBand } from '@datamoc/mw_games/roguelike';

    const bands: RangeBand[] = [{ max: 2, multiplier: 1.5 }, { max: 6, multiplier: 1 }];
    rangeMultiplier(1, bands); // 1.5 - point-blank bonus
    rangeMultiplier(10, bands, 0.5); // 0.5 - past every band, falls back to `beyond`

    areaFalloffMultiplier(0, [1, 0.5]); // 1 - first target hit, full damage
    areaFalloffMultiplier(1, [1, 0.5]); // 0.5 - second target
    interface RangeBand {
        max: number;
        multiplier: number;
    }
    Index
    max: number

    the greatest distance this band covers

    multiplier: number