Skip to main content
The Deno 2 Release Candidate is here
Learn more
method ItemHelper.prototype.fillMagazineWithRandomCartridge
import { ItemHelper } from "https://deno.land/x/sptaki@1.2.0/helpers/ItemHelper.d.ts";

Add child items (cartridges) to a magazine

Parameters

magazine: Item[]

Magazine to add child items to

magTemplate: ITemplateItem

Db template of magazine

staticAmmoDist: Record<string, IStaticAmmoDetails[]>

Cartridge distribution

optional
caliber: string

Caliber of cartridge to add to magazine

optional
minSizePercent: number

% the magazine must be filled to

optional
weapon: ITemplateItem

Weapon the magazine will be used for (if passed in uses Chamber as whitelist)