@adatechnology/game-weapons 0.4.5 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,6 +100,91 @@ The generic archetypes:
100
100
 
101
101
  `DEFAULT_LOADOUT` lists a starter kit of 19 ids. Pass `calibers` / `weapons` / `explosives` to `createArsenal` to add or override entries by id.
102
102
 
103
+ ## Ammo table: construction and penetration
104
+
105
+ `AMMO` (`src/data/ammo.json`, 50 loads) says, per calibre and kind of round (`fmj`, `hp`, `ap`, `buck`, `slug`, `birdshot`, `rimfire`, `arrow`, `bolt`,
106
+ `incendiary`, `tracer`; id `<caliber>:<kind>`), what the projectile is made of (`core`, `jacket`, `tracer`, `incendiary`), its mass and speed when they differ from
107
+ the calibre's (an armour-piercing core is lighter and faster) and how many millimetres of **steel** (RHA-equivalent), **concrete**, **brick** and
108
+ **wood** (dry hardwood) it goes through at close range and normal incidence. Every calibre ships with the load of its own `kind`. The numbers are
109
+ documented in the `_notes` of the file: one anchor is a manufacturer figure (7.62x51 M993 AP: 18 mm RHA at 100 m, Nammo) and the rest are estimates
110
+ from published orders of magnitude, muzzle energy and construction, each marked `basis: 'estimated'`; refine any entry with `ArsenalOptions.ammo` / `patch.ammo`.
111
+
112
+ - `arsenal.loadOf(caliber, kind?)` returns `{ def, kind, grams, speed, energy, penetration }`; `weapon.setAmmoKind('ap')` (or `create(id, { ammoKind })`) loads another
113
+ kind, the next `Shot` carries `ammo`, `mass`, `energy`, `penetration`, `incendiary` and `tracer` of that load, and `snapshot()` keeps it.
114
+ - The shot's `penetration` is what a damage model reads: `shotToHit(shot, point)` / `shotExtras(shot, distance)` of `@adatechnology/game-contracts` scale it by the energy
115
+ left at the distance and put it in `Hit.penetration`, which `game-destruction` compares with the thickness of the part (it reads no calibre names).
116
+ - Add, change or remove loads without touching the code: `createArsenal({ ammo: [...], patch: { ammo: { '7_62x51:fmj': { penetration: { steel: 7 } } } }, remove: { ammo: [...] } })`.
117
+ `checkArsenal` reports a load of an unknown calibre, a missing penetration, or a calibre whose own kind has no entry.
118
+
119
+ | Load | kind | g | m/s | J | core / jacket | steel mm | concrete mm | brick mm | wood mm | basis |
120
+ |---|---|---|---|---|---|---|---|---|---|---|
121
+ | .22 LR lead round nose | rimfire | 2.6 | 350 | 159 | lead / none | 1.4 | 12 | 25 | 60 | estimated |
122
+ | .380 ACP FMJ | fmj | 6.2 | 295 | 270 | lead / gilding_metal | 2.2 | 20 | 40 | 80 | estimated |
123
+ | 9x18 Makarov FMJ | fmj | 6.1 | 315 | 303 | lead / steel | 2.6 | 22 | 45 | 85 | estimated |
124
+ | 9x19 FMJ 124 gr | fmj | 7.5 | 365 | 500 | lead / gilding_metal | 3 | 25 | 50 | 80 | estimated |
125
+ | 9x19 JHP | hp | 7.5 | 365 | 500 | lead / gilding_metal | 2 | 15 | 35 | 55 | estimated |
126
+ | .40 S&W FMJ | fmj | 11.7 | 310 | 562 | lead / gilding_metal | 3 | 28 | 55 | 85 | estimated |
127
+ | .45 ACP FMJ 230 gr | fmj | 14.9 | 254 | 481 | lead / gilding_metal | 2.8 | 28 | 55 | 85 | estimated |
128
+ | .45 ACP JHP | hp | 14.9 | 254 | 481 | lead / gilding_metal | 1.8 | 18 | 40 | 60 | estimated |
129
+ | 5.7x28 SS190 | fmj | 2 | 715 | 511 | lead_steel / gilding_metal | 4 | 25 | 50 | 100 | estimated |
130
+ | .38 Special lead round nose | fmj | 10.2 | 247 | 311 | lead / none | 2 | 20 | 40 | 70 | estimated |
131
+ | .357 Magnum JHP | hp | 10.2 | 396 | 800 | lead / gilding_metal | 3 | 25 | 45 | 90 | estimated |
132
+ | .44 Magnum FMJ | fmj | 15.6 | 440 | 1510 | lead / gilding_metal | 4 | 40 | 70 | 150 | estimated |
133
+ | .50 AE FMJ | fmj | 19.4 | 470 | 2143 | lead / gilding_metal | 4 | 38 | 65 | 130 | estimated |
134
+ | 12 ga 00 buck (one pellet) | buck | 3.5 | 414 | 300 | lead / none | 0.8 | 10 | 25 | 60 | estimated |
135
+ | 12 ga rifled slug | slug | 28 | 463 | 3001 | lead / none | 4 | 60 | 100 | 250 | estimated |
136
+ | 12 ga birdshot (one pellet) | birdshot | 0.2 | 400 | 16 | lead / none | 0.2 | 3 | 8 | 20 | estimated |
137
+ | 20 ga buck (one pellet) | buck | 1.3 | 400 | 104 | lead / none | 0.6 | 8 | 20 | 50 | estimated |
138
+ | 5.56x45 M855 (steel tip, lead core) | fmj | 4 | 935 | 1748 | lead_steel / gilding_metal | 4.5 | 90 | 180 | 280 | estimated |
139
+ | 5.45x39 7N6 (steel core) | fmj | 3.4 | 900 | 1377 | steel / steel | 5.5 | 90 | 180 | 280 | estimated |
140
+ | 7.62x39 M43 (steel core) | fmj | 8 | 725 | 2102 | steel / steel | 6.5 | 110 | 220 | 300 | estimated |
141
+ | .30-30 Winchester flat nose | fmj | 9.7 | 670 | 2177 | lead / gilding_metal | 3 | 80 | 160 | 250 | estimated |
142
+ | 7.62x51 M80 ball | fmj | 9.7 | 850 | 3504 | lead / gilding_metal | 5 | 120 | 250 | 330 | estimated |
143
+ | 7.62x54R LPS (steel core) | fmj | 9.6 | 865 | 3591 | steel / steel | 6.5 | 130 | 260 | 330 | estimated |
144
+ | .30-06 M1 ball | fmj | 9.7 | 880 | 3756 | lead / gilding_metal | 5.5 | 130 | 260 | 340 | estimated |
145
+ | .300 Win Mag FMJ | fmj | 11.7 | 900 | 4738 | lead / gilding_metal | 6.5 | 150 | 290 | 360 | estimated |
146
+ | .338 Lapua Magnum FMJ | fmj | 16.2 | 903 | 6605 | lead / gilding_metal | 8 | 190 | 360 | 450 | estimated |
147
+ | .408 CheyTac solid | fmj | 27.2 | 900 | 11016 | copper / none | 12 | 250 | 450 | 550 | estimated |
148
+ | Arrow (steel broadhead) | arrow | 25 | 90 | 101 | steel / none | 0.5 | 5 | 15 | 100 | estimated |
149
+ | Crossbow bolt | bolt | 20 | 122 | 149 | steel / none | 0.8 | 8 | 20 | 120 | estimated |
150
+ | 4.6x30 DM11 | fmj | 2 | 735 | 540 | steel / gilding_metal | 3.5 | 25 | 50 | 100 | estimated |
151
+ | .32 ACP FMJ | fmj | 4.6 | 276 | 175 | lead / gilding_metal | 1.8 | 15 | 30 | 60 | estimated |
152
+ | 9x19 tracer | tracer | 7.5 | 365 | 500 | lead / gilding_metal | 2.8 | 22 | 45 | 75 | estimated |
153
+ | 5.56x45 M995 AP (tungsten carbide) | ap | 3.6 | 1013 | 1847 | tungsten_carbide / gilding_metal | 10 | 110 | 210 | 300 | estimated |
154
+ | 5.56x45 M856 tracer | tracer | 3.95 | 914 | 1650 | lead / gilding_metal | 3.5 | 80 | 160 | 260 | estimated |
155
+ | 5.45x39 7T3M tracer | tracer | 3.4 | 900 | 1377 | lead / steel | 4 | 80 | 160 | 260 | estimated |
156
+ | 7.62x39 BZ API | incendiary | 7.7 | 720 | 1996 | hardened_steel / steel | 8 | 110 | 220 | 300 | estimated |
157
+ | 7.62x39 T-45 tracer | tracer | 8 | 725 | 2102 | lead / steel | 4.5 | 100 | 200 | 280 | estimated |
158
+ | 7.62x51 M993 AP (tungsten carbide) | ap | 8.2 | 930 | 3546 | tungsten_carbide / gilding_metal | 18 | 160 | 300 | 360 | published |
159
+ | 7.62x51 M62 tracer | tracer | 9.7 | 850 | 3504 | lead / gilding_metal | 4 | 110 | 230 | 320 | estimated |
160
+ | 7.62x54R 7N37 AP | ap | 9.6 | 865 | 3591 | hardened_steel / steel | 11 | 140 | 270 | 340 | estimated |
161
+ | 7.62x54R B-32 API | incendiary | 10 | 830 | 3445 | hardened_steel / steel | 10 | 130 | 260 | 330 | estimated |
162
+ | 7.62x54R T-46 tracer | tracer | 9.6 | 865 | 3591 | lead / steel | 4.5 | 110 | 220 | 300 | estimated |
163
+ | .30-06 M2 AP (hardened steel) | ap | 10.8 | 860 | 3994 | hardened_steel / gilding_metal | 10 | 140 | 270 | 340 | estimated |
164
+ | .30-06 M25 tracer | tracer | 9.7 | 880 | 3756 | lead / gilding_metal | 4 | 110 | 230 | 320 | estimated |
165
+ | .338 Lapua AP (tungsten) | ap | 16.2 | 903 | 6605 | tungsten_carbide / gilding_metal | 16 | 200 | 380 | 470 | estimated |
166
+ | .50 BMG M33 ball | fmj | 42 | 925 | 17968 | lead_steel / gilding_metal | 14 | 330 | 560 | 600 | estimated |
167
+ | .50 BMG M2 AP (hardened steel) | ap | 42 | 925 | 17968 | hardened_steel / gilding_metal | 22 | 350 | 580 | 600 | estimated |
168
+ | .50 BMG M8 API | incendiary | 42 | 925 | 17968 | hardened_steel / gilding_metal | 18 | 340 | 570 | 600 | estimated |
169
+ | .50 BMG M17 tracer | tracer | 42 | 925 | 17968 | lead / gilding_metal | 9 | 300 | 520 | 580 | estimated |
170
+ | 12 ga incendiary shell (one pellet, magnesium) | incendiary | 3.5 | 414 | 300 | none / none | 0.1 | 3 | 8 | 15 | estimated |
171
+
172
+ ## Ignition: what a round does to a fuel tank
173
+
174
+ A normal bullet that goes through a fuel tank, a jerrycan or a gas bottle makes a **leak** and does not set it alight by itself. `rules.ignition` gives each round the
175
+ chances that it supplies a flame, built from its construction in the ammo table, and they travel in `Shot.ignition` and `Hit.ignition` (`{ spark, flame }`, plus the
176
+ flags `incendiary` and `tracer`); the damage model rolls them against the container (see "Ignition of a leak" in `game-destruction`).
177
+
178
+ - **Spark** (only against steel): the chance of the `core` and the chance of the `jacket` are independent, `spark = 1 - (1 - core) x (1 - jacket)`.
179
+ Defaults, `rules.ignition.core`: lead 0.005, lead_steel (steel tip or insert) 0.04, steel 0.12, hardened_steel 0.25, tungsten_carbide 0.25, copper 0.01, none 0;
180
+ `rules.ignition.jacket`: gilding_metal 0.005, copper 0.005, brass 0.01, steel 0.08, none 0. So a lead round in a copper jacket (7.62x51 M80) gives about 1 percent, a
181
+ steel core in a steel jacket (7.62x39 M43, 5.45x39 7N6) about 19 percent and an armour-piercing core (M993, M2 AP) about 25 percent: all of that before the fill of the tank
182
+ weighs on it (a full tank keeps 12 percent of it).
183
+ - **Flame** (any wall): `rules.ignition.flame.incendiary` 0.7 and `.tracer` 0.2. An incendiary composition or a burning tracer base lights the vapour without a spark.
184
+ - `ammoIgnition(ammoDef, rules.ignition)` computes the pair for any load; `createArsenal({ rules: { ignition: { core: { steel: 0.3 }, flame: { tracer: 0 } } } })` changes any number.
185
+ - No public per-cartridge table of the ignition of a fuel tank exists: the numbers are the kit's model (owner decision, 2026-10-24), with the order of magnitude of the
186
+ fuel-tank vulnerability literature (ball ammunition rarely lights a tank, armour-piercing incendiary does), meant to be tuned per game.
187
+
103
188
  ## Explosives, launchers and flamethrowers
104
189
 
105
190
  A trigger pull on a launcher returns a `throw` use (the rocket: `explosive`, `trigger: 'impact'`, `armDistance`, speed in `velocity`) and, when the launcher has one, a
@@ -109,6 +194,10 @@ goes off on the first hit, like the molotov, which leaves fire of 4 m for 9 s) o
109
194
  returns `armed`, `impact`, `dud` and `detonate` events; `trigger('wire' | 'remote' | ...)` sets off what waits. `blastEffect(detonation, point)` says if a point is in
110
195
  the lethal or the injury zone (with the cone of a directional charge and the stun of a flashbang) and `backblastEffect(use, point)` the danger behind a tube.
111
196
  The world explosives (`propane_p13`, `fuel_barrel`, `car_fuel_tank`, `fuel_pump`, `fuel_station_tank`) carry `chain`, the delays of the chain reaction `game-destruction` uses.
197
+ A world explosive that is a pressure vessel carries two more optional blocks, as data a host plays (the P13 cylinder has both, from the Laboratório de Explosões `SC.p13`):
198
+ `leak: { fluid, liters, pressurized, igniteDelay, hissSeconds? }` is what it holds (24 l of gas = 13 kg of liquid propane at 0.54 kg/l) and the seconds from the first leak
199
+ (a bullet through the shell, or the valve opened) to the jet catching fire as a torch (`igniteDelay` 0.8 s; the blast still comes from `chain`: shot 1.4 s). `shell: { launchSpeed, trailSeconds }`
200
+ is what is left of it after the blast: the torn shell flies up at 13 m/s trailing fire for 1.8 s. Change them like any other value: `patch.explosives.propane_p13.leak.igniteDelay`.
112
201
 
113
202
  ### Cooking a grenade, safety fuses, the flashbang and trip wires
114
203
 
@@ -174,14 +263,14 @@ it goes back off when another tool is taken. The laser measures its distance at
174
263
  ## API
175
264
 
176
265
  - `createArsenal(options?)` returns an `Arsenal`: `calibers`, `weapons`, `explosives` (maps), `rules`, `create(id, { seed?, reserve?, condition?, ammoQuality? })` (unknown id throws), `attachments`, `canFit(weapon, attachment, options?)`, `restore(snapshot, options?)`,
177
- `muzzleEnergy(caliberId, barrel?)`, `energy(weaponId)`, `name(id)` (weapon, explosive, fire mode, category, fault, condition or calibre, translated), `list(category?)`.
266
+ `ammo` (map), `loadOf(caliberId, kind?)`, `muzzleEnergy(caliberId, barrel?)`, `energy(weaponId)`, `name(id)` (weapon, explosive, fire mode, category, fault, condition or calibre, translated), `list(category?)`.
178
267
  Options: `calibers`, `weapons`, `explosives`, `patch`, `remove`, `include`, `rules`, `strings`, `seed`, `locale`.
179
268
  - `WeaponState`: `def`, `caliber`, `ammo`, `capacity`, `reserve`, `mode`, `reloading`, `locked`, `phase`, `fault`, `clearing`, `safety`, `heat`, `heatLevel`, `condition`,
180
269
  `ammoQuality`, `spread`, `trigger(origin, direction, dt, held?, source?)`, `release(origin?, direction?)`, `draw()`, `reload(kind?)`, `cycleMode()`, `setSafety(on)`, `clearFault()`,
181
- `setCondition(id)`, `setAmmoQuality(id)`, `setFuseLength(metres)`, `cooking`, `attachments`, `mass`, `aimSeconds`, `suppressed`, `stock`, `canFit`, `fit`, `remove`, `toggle`, `setStock`, `setStance`, `snapshot`, `update(dt)`, `refill()`, `drain()`. `release(origin?, direction?)` returns the throw of a cooked grenade (null for anything else).
182
- - `Shot`: `origin`, `direction`, `energy` (J), `caliber` (mm), `caliberId`, `speed`, `energyAt(distance)` (energy × speed factor², drag per 100 m), `pellet`, `weapon`, `source`.
270
+ `setCondition(id)`, `setAmmoQuality(id)`, `setAmmoKind(kind)`, `ammoKind`, `setFuseLength(metres)`, `cooking`, `attachments`, `mass`, `aimSeconds`, `suppressed`, `stock`, `canFit`, `fit`, `remove`, `toggle`, `setStock`, `setStance`, `snapshot`, `update(dt)`, `refill()`, `drain()`. `release(origin?, direction?)` returns the throw of a cooked grenade (null for anything else).
271
+ - `Shot`: `origin`, `direction`, `energy` (J), `caliber` (mm), `caliberId`, `speed`, `mass`, `energyAt(distance)` (energy × speed factor², drag per 100 m), `pellet`, `weapon`, `source`, `ammo`, `penetration`, `incendiary`, `tracer`.
183
272
  - `Use`: `melee`, `flame`, `heat`, `throw`, `tool`, `extinguish`, `hand`. `TriggerResult`: `shots`, `uses`, `status` (`ok`, `empty`, `reloading`, `cooldown`, `no_fuel`, `safe`, `drawing`, `fault`, `misfire`, `clearing`, `busy`), `recoil`, `noise`, `rounds`, `roundTimes`, `fault?`, `suppressed?`.
184
- - `muzzleEnergy(caliber, barrel?)`, `CALIBERS`, `WEAPONS`, `EXPLOSIVES`, `ARCHETYPE_IDS`, `DEFAULT_LOADOUT`, `DEFAULT_RULES`, `RELOAD_STAGES`, `checkArsenal`, `locales`, `resolveStrings`.
273
+ - `muzzleEnergy(caliber, barrel?)`, `AMMO`, `ammoId`, `resolveLoad`, `CALIBERS`, `WEAPONS`, `EXPLOSIVES`, `ARCHETYPE_IDS`, `DEFAULT_LOADOUT`, `DEFAULT_RULES`, `RELOAD_STAGES`, `checkArsenal`, `locales`, `resolveStrings`.
185
274
 
186
275
  Locales: `en` and `pt-BR` (`locale` option; unknown falls back to `en`). Calibre labels are technical names and are not translated.
187
276
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Vec3, Use, ExplosionChain, DeepPartial, Shot } from '@adatechnology/game-contracts';
1
+ import { Vec3, Use, ExplosionChain, DeepPartial, Shot, HitIgnition } from '@adatechnology/game-contracts';
2
2
  export { DeepPartial, Shot, Use, Vec3 } from '@adatechnology/game-contracts';
3
3
 
4
4
  type AttachmentId = string;
@@ -118,6 +118,7 @@ interface WeaponSnapshot {
118
118
  readonly mode: FireMode;
119
119
  readonly condition: string;
120
120
  readonly ammoQuality: string;
121
+ readonly ammoKind?: string;
121
122
  readonly underbarrel?: WeaponSnapshot;
122
123
  }
123
124
 
@@ -257,6 +258,28 @@ interface ExplosiveTripwire {
257
258
  /** Metres above the charge (default 0.15: shin height). */
258
259
  readonly height?: number;
259
260
  }
261
+ /**
262
+ * What a world explosive holds and how it behaves once the shell is punctured or its valve is opened (a pressure vessel: the P13 cylinder). `game-destruction` reads `fluid`,
263
+ * `liters` and `pressurized` from `PartSpec.contains`; the host plays the timings (Laboratório de Explosões, `SC.p13` L894-911).
264
+ */
265
+ interface ExplosiveLeak {
266
+ /** What escapes (`gas`: flammable, it lights from a spark, a flame or a blast). */
267
+ readonly fluid: string;
268
+ /** Litres of it at the start (13 kg of liquid propane at 0.54 kg per litre is about 24 l). */
269
+ readonly liters: number;
270
+ readonly pressurized: boolean;
271
+ /** Seconds from the first leak to the jet catching fire as a torch when nothing lit it before (the lab: the white jet runs 0.8 s, then it lights). */
272
+ readonly igniteDelay: number;
273
+ /** Seconds the white jet hisses and shoves the vessel before it lights (the lab's 0 to 0.8 s). */
274
+ readonly hissSeconds?: number;
275
+ }
276
+ /** What is left of the vessel after the blast: the torn shell flies off trailing fire (the lab: `vy` 13 m/s, a fire trail for about 1.8 s). */
277
+ interface ExplosiveShell {
278
+ /** Metres per second, upwards. */
279
+ readonly launchSpeed: number;
280
+ /** Seconds the flying shell trails fire. */
281
+ readonly trailSeconds: number;
282
+ }
260
283
  interface ExplosiveDef {
261
284
  readonly id: ExplosiveId;
262
285
  readonly name?: string;
@@ -293,6 +316,10 @@ interface ExplosiveDef {
293
316
  };
294
317
  readonly triggers?: readonly ExplosiveTrigger[];
295
318
  readonly chain?: ExplosiveChain;
319
+ /** A world explosive that is a pressure vessel (the P13 cylinder): the gas it holds and when a leak catches fire. Absent: a bullet only primes it. */
320
+ readonly leak?: ExplosiveLeak;
321
+ /** What is left of the vessel after the blast (see `ExplosiveShell`). */
322
+ readonly shell?: ExplosiveShell;
296
323
  /** The trip wire of an explosive with the `wire` trigger; without it the one in `rules.explosives.tripwire` is used. */
297
324
  readonly tripwire?: ExplosiveTripwire;
298
325
  /** Kilograms. */
@@ -354,6 +381,13 @@ interface WeaponRules {
354
381
  readonly faultSpan: number;
355
382
  readonly perShot: Readonly<Record<CaseType, number>>;
356
383
  readonly perRocket: number;
384
+ /** What the player sees of the heat: wisps of smoke only while the barrel is above `smokeFrom` and for `smokeSeconds` after the last shot; the red glow from `glowFrom` over `glowSpan` points. */
385
+ readonly visual: {
386
+ readonly smokeFrom: number;
387
+ readonly smokeSeconds: number;
388
+ readonly glowFrom: number;
389
+ readonly glowSpan: number;
390
+ };
357
391
  };
358
392
  /** Each shot in the last `window` seconds raises the noise radius by `step`, up to `cap`. */
359
393
  readonly noiseBurst: {
@@ -396,6 +430,25 @@ interface WeaponRules {
396
430
  readonly seconds: number;
397
431
  readonly collapsed: readonly StatModifier[];
398
432
  };
433
+ /**
434
+ * What a round does to flammable fluid it leaks into (a fuel tank, a jerrycan, a gas bottle): it goes into `Shot.ignition` and `Hit.ignition`, and
435
+ * the damage model rolls it against the container (see `IgnitionRules` of `@adatechnology/game-contracts` for the target side: how full it is, the
436
+ * wall, a fire nearby). A plain bullet that goes through only makes a leak.
437
+ */
438
+ readonly ignition: {
439
+ /**
440
+ * Chance, 0 to 1, that the hard part of the round throws a spark that lights the vapour when it goes through STEEL (nothing sparks against a
441
+ * part that is not metal). Built from construction: the chance of the core and the chance of the jacket are independent, so
442
+ * spark = 1 - (1 - core) x (1 - jacket).
443
+ */
444
+ readonly core: Readonly<Record<AmmoCore, number>>;
445
+ readonly jacket: Readonly<Record<AmmoJacket, number>>;
446
+ /** Chance, 0 to 1, that the flame of the round lights the fluid (any wall): an incendiary composition, a tracer pyrotechnic. */
447
+ readonly flame: {
448
+ readonly incendiary: number;
449
+ readonly tracer: number;
450
+ };
451
+ };
399
452
  readonly draw: number;
400
453
  readonly clear: number;
401
454
  readonly startSafe: boolean;
@@ -526,7 +579,7 @@ interface CaliberDef {
526
579
  /** Speed lost per 100 m as a fraction (default 0.1 rifle, 0.2 pistol, 0.45 buckshot). */
527
580
  dragPer100m?: number;
528
581
  /** Armour-piercing or hollow-point flavour (a damage model may use it). */
529
- kind?: 'fmj' | 'hp' | 'ap' | 'buck' | 'slug' | 'birdshot' | 'rimfire' | 'arrow' | 'bolt';
582
+ kind?: AmmoKind;
530
583
  tags?: string[];
531
584
  /** Audible distance of a shot in this calibre, metres. A weapon may override it (suppressor). */
532
585
  noise?: number;
@@ -535,6 +588,61 @@ interface CaliberDef {
535
588
  cartridge?: CartridgeDims;
536
589
  /** Where the numbers come from (team deliveries, the SDK itself, a published reference, or derived from a sibling). */
537
590
  sources?: readonly DataSource[];
591
+ /**
592
+ * The propellant type of this calibre, which determines the muzzle smoke profile.
593
+ * - `'smokeless'`: modern powder (pistols, rifles, SMGs, shotguns, machine guns) — thin faint puff.
594
+ * - `'black_powder'`: black-powder loads — thick grey-white cloud that lingers.
595
+ * - `'none'`: no propellant combustion (arrows, crossbow bolts, melee) — no smoke.
596
+ * Defaults to `'smokeless'` when omitted.
597
+ */
598
+ propellant?: 'smokeless' | 'black_powder' | 'none';
599
+ }
600
+ /** The load a calibre ships with is its `kind`; other loads of it are entries of the ammo table (`AmmoDef`). */
601
+ type AmmoKind = 'fmj' | 'hp' | 'ap' | 'buck' | 'slug' | 'birdshot' | 'rimfire' | 'arrow' | 'bolt' | 'incendiary' | 'tracer';
602
+ /** What the core of a projectile is made of. Hard cores strike sparks on metal; lead almost never does. */
603
+ type AmmoCore = 'lead' | 'lead_steel' | 'steel' | 'hardened_steel' | 'tungsten_carbide' | 'copper' | 'none';
604
+ /** What the outside of a projectile is made of. */
605
+ type AmmoJacket = 'gilding_metal' | 'copper' | 'brass' | 'steel' | 'none';
606
+ /** Millimetres a projectile goes through at close range (muzzle to about 100 m), at normal incidence: steel is RHA-equivalent, wood is dry hardwood. */
607
+ type AmmoPenetration = {
608
+ readonly steel: number;
609
+ readonly concrete: number;
610
+ readonly brick: number;
611
+ readonly wood: number;
612
+ };
613
+ /**
614
+ * One load of a calibre: its construction and how far it goes through steel, concrete, brick and wood. `bulletGrams` and `muzzleSpeed` replace the
615
+ * calibre's own when present (an armour-piercing round is lighter and faster). The id is `<caliber>:<kind>`.
616
+ */
617
+ interface AmmoDef {
618
+ readonly id: string;
619
+ readonly caliber: CaliberId;
620
+ readonly kind: AmmoKind;
621
+ /** Display name, e.g. `7.62x51 M993 AP`. Not translated (it is a technical name). */
622
+ readonly label: string;
623
+ readonly bulletGrams?: number;
624
+ readonly muzzleSpeed?: number;
625
+ readonly core: AmmoCore;
626
+ readonly jacket: AmmoJacket;
627
+ /** A burning pyrotechnic in the base (it can light fuel). */
628
+ readonly tracer?: boolean;
629
+ /** An incendiary composition in the nose (it lights fuel whatever it hits). */
630
+ readonly incendiary?: boolean;
631
+ readonly penetration: AmmoPenetration;
632
+ /** `published` = a figure quoted in `sources`; `estimated` = derived (see the notes of `ammo.json`). */
633
+ readonly basis: 'published' | 'estimated';
634
+ readonly sources: readonly string[];
635
+ }
636
+ /** A load resolved against its calibre: what one round weighs, how fast it leaves and how much energy it carries. */
637
+ interface AmmoLoad {
638
+ readonly def: AmmoDef;
639
+ readonly kind: AmmoKind;
640
+ readonly grams: number;
641
+ /** Muzzle speed from the reference barrel, m/s. */
642
+ readonly speed: number;
643
+ /** Muzzle energy in joules: 0.5 x mass x speed squared. */
644
+ readonly energy: number;
645
+ readonly penetration: AmmoPenetration;
538
646
  }
539
647
  type CaseType = 'pistol' | 'rifle' | 'shell' | 'big' | 'tiny';
540
648
  type RimType = 'rimfire' | 'rimmed' | 'rimless' | 'shell';
@@ -723,6 +831,8 @@ interface WeaponDef {
723
831
  /** What the stock does (fold, retract); absent: a fixed stock or none. */
724
832
  stock?: StockDef;
725
833
  sources?: readonly DataSource[];
834
+ /** Override the muzzle smoke profile id for this weapon (defaults to the calibre's propellant profile). */
835
+ muzzleSmoke?: string;
726
836
  }
727
837
  interface TriggerResult {
728
838
  /** Shots fired this call (firearms). */
@@ -794,6 +904,8 @@ interface WeaponState {
794
904
  readonly heatLevel: number;
795
905
  readonly condition: string;
796
906
  readonly ammoQuality: string;
907
+ /** The load in the weapon, by `AmmoKind` (the calibre's own `kind` until `setAmmoKind`). */
908
+ readonly ammoKind: AmmoKind | undefined;
797
909
  /** Current spread in degrees (base + bloom). */
798
910
  readonly spread: number;
799
911
  /**
@@ -818,6 +930,8 @@ interface WeaponState {
818
930
  setCondition(id: string): void;
819
931
  /** Quality of the rounds, by `rules.ammoQualities` id. */
820
932
  setAmmoQuality(id: string): void;
933
+ /** Loads another kind of round of the calibre (`arsenal.ammo` has an entry `<caliber>:<kind>`); throws when there is none. */
934
+ setAmmoKind(kind: AmmoKind): void;
821
935
  /** Metres of safety fuse for explosives that burn one (dynamite): replaces the explosive's `fuseLength`; `undefined` goes back to it. */
822
936
  setFuseLength(metres: number | undefined): void;
823
937
  /** Start putting the weapon in hand; the trigger answers `drawing` until it is ready. */
@@ -871,17 +985,21 @@ interface ArsenalOptions {
871
985
  calibers?: CaliberDef[];
872
986
  weapons?: WeaponDef[];
873
987
  explosives?: ExplosiveDef[];
988
+ /** Extra or overriding loads of the ammo table, by id (`<caliber>:<kind>`). */
989
+ ammo?: AmmoDef[];
874
990
  /** Changes to shipped or added entries, by id, applied after the lists above are merged. */
875
991
  patch?: {
876
992
  weapons?: Record<WeaponId, WeaponPatch>;
877
993
  calibers?: Record<CaliberId, Partial<CaliberDef>>;
878
994
  explosives?: Record<ExplosiveId, Partial<ExplosiveDef>>;
995
+ ammo?: Record<string, DeepPartial<AmmoDef>>;
879
996
  attachments?: Record<AttachmentId, DeepPartial<AttachmentDef>>;
880
997
  };
881
998
  /** Entries to leave out, by id. */
882
999
  remove?: {
883
1000
  weapons?: WeaponId[];
884
1001
  calibers?: CaliberId[];
1002
+ ammo?: string[];
885
1003
  explosives?: ExplosiveId[];
886
1004
  attachments?: AttachmentId[];
887
1005
  };
@@ -902,6 +1020,8 @@ interface Arsenal {
902
1020
  readonly calibers: ReadonlyMap<CaliberId, CaliberDef>;
903
1021
  readonly weapons: ReadonlyMap<WeaponId, WeaponDef>;
904
1022
  readonly explosives: ReadonlyMap<ExplosiveId, ExplosiveDef>;
1023
+ /** The ammo table by id (`<caliber>:<kind>`). */
1024
+ readonly ammo: ReadonlyMap<string, AmmoDef>;
905
1025
  readonly attachments: ReadonlyMap<AttachmentId, AttachmentDef>;
906
1026
  readonly rules: WeaponRules;
907
1027
  /** Whether an accessory goes on a weapon with the given parts on it (a weapon as it ships when `fitted` is left out), and where. */
@@ -919,7 +1039,10 @@ interface Arsenal {
919
1039
  reserve?: number;
920
1040
  condition?: string;
921
1041
  ammoQuality?: string;
1042
+ ammoKind?: AmmoKind;
922
1043
  }): WeaponState;
1044
+ /** A load of a calibre (its own `kind` when `kind` is left out) with mass, speed, energy and penetration; throws when the table has none. */
1045
+ loadOf(caliber: CaliberId, kind?: AmmoKind): AmmoLoad;
923
1046
  /** Muzzle energy of a calibre (optionally with a barrel factor). */
924
1047
  muzzleEnergy(caliber: CaliberId, barrel?: number): number;
925
1048
  /** The explosive a `throw` or `place` use carries, ready to fly (`step`) or wait for its trigger; undefined when the use carries none. */
@@ -934,16 +1057,33 @@ interface Arsenal {
934
1057
  /** Deterministic mulberry32 generator; returns floats in [0, 1). */
935
1058
  declare const createRng: (seed: number) => (() => number);
936
1059
 
1060
+ /**
1061
+ * The ammo table: per calibre and kind of round, the construction (core, jacket, tracer, incendiary) and how far it goes through steel, concrete,
1062
+ * brick and wood. The notes of `data/ammo.json` say where the numbers come from (one is published, the rest are estimates to be refined).
1063
+ */
1064
+ declare const AMMO: AmmoDef[];
1065
+ /** Id of a load in the table. */
1066
+ declare const ammoId: (caliber: string, kind: string) => string;
1067
+ /** Resolves a load of `caliber` (its own kind when `kind` is left out) against the table, or null when the table has none. */
1068
+ declare const resolveLoad: (caliber: CaliberDef, ammo: ReadonlyMap<string, AmmoDef>, kind?: AmmoKind) => AmmoLoad | null;
1069
+ /**
1070
+ * Chances that a round lights flammable fluid, from its construction and `rules.ignition`: the spark of the hard core and jacket on steel (they are
1071
+ * independent, 1 - (1 - core) x (1 - jacket)) and the flame of an incendiary or tracer. A lead round with a copper jacket gives about 1 percent.
1072
+ */
1073
+ declare const ammoIgnition: (def: AmmoDef, rules: WeaponRules["ignition"]) => HitIgnition;
1074
+
937
1075
  interface ArsenalParts {
938
1076
  readonly weapons: ReadonlyMap<WeaponId, WeaponDef>;
939
1077
  readonly calibers: ReadonlyMap<CaliberId, CaliberDef>;
940
1078
  readonly explosives: ReadonlyMap<ExplosiveId, ExplosiveDef>;
941
1079
  readonly attachments?: ReadonlyMap<AttachmentId, AttachmentDef>;
1080
+ /** When given, every ammo entry must name a calibre of the arsenal, and every calibre's own kind must have its entry. */
1081
+ readonly ammo?: ReadonlyMap<string, AmmoDef>;
942
1082
  /** When given, the default condition and ammunition quality must be ones the rules define. */
943
1083
  readonly rules?: Pick<WeaponRules, 'conditions' | 'defaultCondition' | 'ammoQualities' | 'defaultAmmoQuality'>;
944
1084
  }
945
1085
  /** Every problem found in an arsenal, so a game sees them all at once instead of one per run. Empty when it is consistent. */
946
- declare const checkArsenal: ({ weapons, calibers, explosives, attachments, rules }: ArsenalParts) => string[];
1086
+ declare const checkArsenal: ({ weapons, calibers, explosives, attachments, ammo, rules }: ArsenalParts) => string[];
947
1087
 
948
1088
  /** How the weapon is held and what it is in: what the conditional effects (`aiming`, `hip`, `supported`, `subsonic`, `collapsed`) ask. */
949
1089
  interface LoadoutContext {
@@ -997,6 +1137,8 @@ declare const DEFAULT_LOADOUT: WeaponId[];
997
1137
  */
998
1138
  declare const createArsenal: (options?: ArsenalOptions) => Arsenal;
999
1139
 
1140
+ /** The heat the Galeria 3D do Arsenal recorded (hotter per round: a magazine was enough to glow); kept so the recorded runs stay reproducible. */
1141
+ declare const GALLERY_HEAT: WeaponRules['heat'];
1000
1142
  /** The rules the kit ships with; a game overrides any of them through `ArsenalOptions.rules`. */
1001
1143
  declare const DEFAULT_RULES: WeaponRules;
1002
1144
 
@@ -1039,4 +1181,65 @@ type StageTable = Readonly<Record<ReloadKind, readonly ReloadStage[]>>;
1039
1181
  /** Where each step of a reload falls, as a fraction of its duration, from the key frames of the gallery animations. The runtime scales them to the duration of the weapon. */
1040
1182
  declare const RELOAD_STAGES: Readonly<Record<ReloadFamily, StageTable>>;
1041
1183
 
1042
- export { ARCHETYPE_IDS, ATTACHMENTS, type AmmoQualityDef, type Arsenal, type ArsenalOptions, type AttachmentDef, type AttachmentId, type AttachmentInstall, type AttachmentKind, type BlastEffect, CALIBERS, type CaliberDef, type CaliberId, type CanFit, type CanFitContext, type CartridgeDims, type CaseType, type ConditionDef, DEFAULT_LOADOUT, DEFAULT_RULES, type DataSource, type Detonation, EXPLOSIVES, type EffectCondition, ExplosiveBody, type ExplosiveBodyInit, type ExplosiveChain, type ExplosiveDef, type ExplosiveEvent, type ExplosiveId, type ExplosiveTrigger, type ExplosiveTripwire, type FaultContext, type FaultId, type FireMode, type FirearmAction, type FitOptions, type FitRefusal, type FitResult, type FittedAttachment, type IsCompatible, type Loadout, type LoadoutContext, type MountDef, type MountKind, RELOAD_STAGES, type ReloadFamily, type ReloadKind, type ReloadRequest, type ReloadStage, type ReloadStageId, type RimType, type StatModifier, type StockDef, type StockState, type SurfaceProbe, type TriggerResult, type TripwireSegment, WEAPONS, type WeaponAction, type WeaponCategory, type WeaponDef, type WeaponDimensions, type WeaponEvent, type WeaponId, type WeaponPatch, type WeaponPhase, type WeaponRules, type WeaponSnapshot, type WeaponStance, type WeaponStat, type WeaponState, type WeaponTimings, type WeaponsLocale, type WeaponsStrings, backblastEffect, blastEffect, canFit, canInstallWith, checkArsenal, createArsenal, createExplosiveBody, createRng, locales, muzzleEnergy, nominalFuse, resolveLoadout, resolveStrings, sampleFuse, tripwireSegment };
1184
+ /**
1185
+ * Muzzle smoke profiles and resolver for @adatechnology/game-weapons.
1186
+ *
1187
+ * Each profile controls the puff count, radius, opacity, lifetime, drift (forward speed),
1188
+ * rise speed, growth factor, and flash scale of the muzzle flash effect emitted on each shot.
1189
+ * The resolver picks the right profile from the calibre's propellant type, the weapon's own
1190
+ * override, and whether a suppressor is fitted.
1191
+ */
1192
+
1193
+ /** The visual profile of the muzzle smoke for one shot. */
1194
+ interface MuzzleSmokeProfile {
1195
+ /** Number of smoke puffs spawned. */
1196
+ readonly puffs: number;
1197
+ /** Radius of each puff at spawn (multiplied by the flash-size factor). */
1198
+ readonly radius: number;
1199
+ /** Starting opacity of each puff (0 = invisible, 1 = fully opaque). */
1200
+ readonly opacity: number;
1201
+ /** Life of each puff in seconds. */
1202
+ readonly life: number;
1203
+ /** Forward drift speed of the cloud (m/s, along the barrel). */
1204
+ readonly drift: number;
1205
+ /** Upward rise speed of the cloud (m/s, world-space). */
1206
+ readonly rise: number;
1207
+ /** Growth factor per second applied to each puff. */
1208
+ readonly growth: number;
1209
+ /** Flash scale multiplier (0 = no flash/light, 1 = full). */
1210
+ readonly flash: number;
1211
+ /** Random extra forward speed per puff (m/s); the recipe defaults to 0.1. */
1212
+ readonly driftSpread?: number;
1213
+ /** Random extra rise speed per puff (m/s); the recipe defaults to 0.04. */
1214
+ readonly riseSpread?: number;
1215
+ /** Total sideways speed range per puff (m/s); the recipe defaults to 0.06. */
1216
+ readonly sideSpread?: number;
1217
+ /** Random extra life per puff in seconds; the recipe defaults to 0.3 times `life`. */
1218
+ readonly lifeSpread?: number;
1219
+ }
1220
+ /** Profile id — corresponds to a top-level key of `muzzle-smoke.json`. */
1221
+ type MuzzleSmokeProfileId = 'smokeless' | 'black_powder' | 'suppressed' | 'none' | 'gallery';
1222
+ /** All built-in muzzle smoke profiles, indexed by id. */
1223
+ declare const MUZZLE_SMOKE: Readonly<Record<MuzzleSmokeProfileId, MuzzleSmokeProfile>>;
1224
+ interface MuzzleSmokeParams {
1225
+ /** The calibre of the shot being fired. */
1226
+ caliber?: CaliberDef | null | undefined;
1227
+ /** The weapon def (may carry a `muzzleSmoke` override). */
1228
+ weapon?: WeaponDef | undefined;
1229
+ /** Whether a suppressor is fitted for this shot. */
1230
+ suppressed?: boolean | undefined;
1231
+ }
1232
+ /**
1233
+ * Returns the muzzle smoke profile for a given shot context.
1234
+ *
1235
+ * Priority (highest first):
1236
+ * 1. `suppressed` → always returns the `suppressed` profile.
1237
+ * 2. `weapon.muzzleSmoke` → explicit weapon-level override (profile id).
1238
+ * 3. `caliber.propellant` → derived from the calibre's propellant type.
1239
+ * 4. Default: `smokeless`.
1240
+ *
1241
+ * The `gallery` profile (the Arsenal gallery's original look) is only reachable through `weapon.muzzleSmoke: 'gallery'`.
1242
+ */
1243
+ declare function muzzleSmokeOf({ caliber, weapon, suppressed }: MuzzleSmokeParams): MuzzleSmokeProfile;
1244
+
1245
+ export { AMMO, ARCHETYPE_IDS, ATTACHMENTS, type AmmoCore, type AmmoDef, type AmmoJacket, type AmmoKind, type AmmoLoad, type AmmoPenetration, type AmmoQualityDef, type Arsenal, type ArsenalOptions, type AttachmentDef, type AttachmentId, type AttachmentInstall, type AttachmentKind, type BlastEffect, CALIBERS, type CaliberDef, type CaliberId, type CanFit, type CanFitContext, type CartridgeDims, type CaseType, type ConditionDef, DEFAULT_LOADOUT, DEFAULT_RULES, type DataSource, type Detonation, EXPLOSIVES, type EffectCondition, ExplosiveBody, type ExplosiveBodyInit, type ExplosiveChain, type ExplosiveDef, type ExplosiveEvent, type ExplosiveId, type ExplosiveLeak, type ExplosiveShell, type ExplosiveTrigger, type ExplosiveTripwire, type FaultContext, type FaultId, type FireMode, type FirearmAction, type FitOptions, type FitRefusal, type FitResult, type FittedAttachment, GALLERY_HEAT, type IsCompatible, type Loadout, type LoadoutContext, MUZZLE_SMOKE, type MountDef, type MountKind, type MuzzleSmokeParams, type MuzzleSmokeProfile, type MuzzleSmokeProfileId, RELOAD_STAGES, type ReloadFamily, type ReloadKind, type ReloadRequest, type ReloadStage, type ReloadStageId, type RimType, type StatModifier, type StockDef, type StockState, type SurfaceProbe, type TriggerResult, type TripwireSegment, WEAPONS, type WeaponAction, type WeaponCategory, type WeaponDef, type WeaponDimensions, type WeaponEvent, type WeaponId, type WeaponPatch, type WeaponPhase, type WeaponRules, type WeaponSnapshot, type WeaponStance, type WeaponStat, type WeaponState, type WeaponTimings, type WeaponsLocale, type WeaponsStrings, ammoId, ammoIgnition, backblastEffect, blastEffect, canFit, canInstallWith, checkArsenal, createArsenal, createExplosiveBody, createRng, locales, muzzleEnergy, muzzleSmokeOf, nominalFuse, resolveLoad, resolveLoadout, resolveStrings, sampleFuse, tripwireSegment };