Weapons
A def's guns: how their damage meets each armour class, and a look of their own: rounds, flashes, bursts and beams.
A def fights with its weapons, each one a gun of its own class, damage, range and rate of fire. With extends, leave weapons out to keep the base's guns, or write your own list to replace them.
Damage
Damage is dmg × the armour matrix cell for the weapon's class against the target's armour, with mult overriding single cells. The counter web explains the classes; the matrix:
| Weapon | Light | Medium | Heavy | Structure | Ship | Submarine | Aircraft |
|---|---|---|---|---|---|---|---|
| ×1.50 | ×0.80 | ×0.40 | ×0.35 | — | — | — | |
| ×1.50 | ×1 | ×0.50 | ×0.50 | ×0.70 | — | — | |
| ×0.60 | ×1.30 | ×1 | ×0.80 | ×0.90 | — | ×0.70 | |
| ×0.60 | ×1.30 | ×1.10 | ×1 | ×0.90 | — | ×0.70 | |
| ×0.40 | ×1.10 | ×1.80 | ×0.70 | ×0.75 | — | — | |
| ×0.90 | ×0.60 | ×0.25 | ×0.30 | ×0.40 | — | ×1 | |
| — | — | — | — | — | — | ×1 | |
| ×1.20 | ×1 | ×0.75 | ×1.60 | ×1 | — | — | |
| ×1.20 | ×1 | ×0.75 | ×1.60 | ×1 | — | — | |
| ×1.20 | ×1 | ×0.60 | ×1.60 | ×1 | — | — | |
| ×1.50 | ×1.10 | ×0.45 | ×1.30 | ×0.50 | — | — | |
| ×1.50 | ×1 | ×0.50 | ×0.50 | ×0.70 | — | — | |
| ×0.40 | ×1.10 | ×1.80 | ×0.70 | ×0.75 | — | — | |
| ×1.20 | ×1 | ×0.75 | ×1.60 | ×1 | — | — | |
| ×1.50 | ×1 | ×0.50 | ×0.50 | ×0.80 | — | ×0.25 | |
| — | — | — | — | ×1.60 | — | — | |
| ×1 | ×1 | ×0.75 | ×0.75 | ×1 | ×1.90 | ×1 | |
| ×1 | ×1.10 | ×0.80 | ×0.80 | ×1 | ×1.90 | ×0.60 | |
| — | — | — | — | ×1.30 | ×1.20 | — | |
| ×1.20 | ×1 | ×1 | ×1.60 | ×1.20 | — | ×1 | |
| ×1 | ×1 | ×0.75 | ×0.75 | ×1 | — | ×1 | |
| ×1.20 | ×1 | ×0.75 | ×1.60 | — | — | — | |
| — | — | — | — | — | — | ×1 | |
| ×0.60 | ×1.10 | ×1.80 | ×0.80 | ×0.75 | — | — | |
| ×1.40 | ×1.40 | ×0.90 | ×0.70 | ×0.90 | — | — | |
| — | — | — | — | ×1.70 | — | — | |
| ×1.20 | ×1.20 | ×1 | ×1.60 | ×1.10 | — | — | |
| ×1.20 | ×1.20 | ×0.80 | ×0.80 | ×0.70 | — | — | |
| ×1 | ×0.90 | ×0.60 | ×1.60 | ×1 | — | — | |
| — | — | — | — | ×0.90 | ×1.80 | — | |
| ×1.50 | ×0.90 | ×0.50 | ×0.30 | ×0.70 | — | ×0.80 | |
| ×1.50 | ×0.90 | ×0.50 | ×0.30 | ×0.70 | — | ×0.80 | |
| ×1.50 | ×0.80 | ×0.40 | ×0.30 | ×0.60 | — | ×0.70 | |
| ×1.50 | ×0.90 | ×0.50 | ×0.30 | ×0.70 | — | ×0.80 | |
| ×0.60 | ×1.30 | ×1.10 | ×0.60 | ×1 | — | — | |
| ×0.60 | ×1.30 | ×1.20 | ×0.60 | ×1.10 | — | — | |
| — | — | — | — | — | — | ×1 | |
| — | — | — | — | — | — | ×1 | |
| ×1.20 | ×1 | ×0.25 | ×0.10 | — | — | — | |
| — | — | — | — | ×1 | ×1 | — |
A look of its own
A weapon may look like its own thing with a look: its own round (a prj.<name> sheet), flash and burst (fx.<name> sheets), or a beam — a laser or a Tesla bolt drawn from the muzzle to the target, which strikes at once.
A weapon whose sound names one of the mod's recordings fires with it; one without uses the game's sound for its class. A gun that turns on a building, or several guns on one hull, are drawn as turrets.
Reference
A weapon (defs[].weapons[])
| field | type | required | default | meaning |
|---|---|---|---|---|
| extensions | { capability: configuration } | Optional engine weapon configuration (format 3) | ||
| id | string | w1, w2… | a name for the weapon | |
| cls | mg | autocannon | cannon | at | he | rocket | navgun | ashm | torpedo | aa | yes | what it was built to kill; picks its row of the armour matrix | |
| dmg | number 0–100000 | yes | damage per hit | |
| reload | number 0.05–600 | yes | seconds between shots or bursts | |
| range | number 0.5–64 | yes | tiles | |
| minRange | number 0–64 | tiles it cannot fire inside | ||
| projectile | bullet | shell | missile | rocket | bomb | torpedo | flak | flame | by class | the round drawn | |
| speed | number 1–5000 | by projectile | round speed, world px/s | |
| targets | (ground | ship | sub | air)[] | by class | what it may fire at: ground, ship, sub, air | |
| mult | { armour: number } | overrides of the class row, by armour class | ||
| splash | number 0–500 | blast radius, world px | ||
| burst | integer 1–32 | shots per burst | ||
| burstDelay | number 0–5 | seconds between the shots of a burst | ||
| ammo | integer 1–9999 | rounds carried, a burst one: dry, a unit goes home for more on its own (an airbase for an aircraft, a naval yard for a hull, a war factory for the rest) and a building refills where it stands; absent never runs dry | ||
| vsWarhead | number 0–10 | 1 | against a warhead in flight, this share of what it does to an aircraft | |
| homing | boolean | the round tracks its target | ||
| interceptable | boolean | point defence may shoot it down | ||
| arc | boolean | a ballistic arc (artillery) | ||
| turret | boolean | true when the def has a turretSprite | fired from the rotating part | |
| recoil | number 0–10 | cosmetic barrel recoil stroke, art px; requires barrel regions on the turret art, changes no weapon statistic | ||
| vertical | boolean | launched straight up out of the hull, like a submarine's missile tubes: it fires at any bearing and the hull never turns for it; `muzzleOffset` then runs along the keel to the tubes | ||
| muzzleOffset | number 0–200 | pivot to muzzle, world px; a unit's art is drawn 1.5625×, so measure on the sheet and multiply | ||
| bores | integer 1–8 | 1 | barrels, fired one after another | |
| boreSpacing | number 0–60 | gap between adjacent barrels, world px | ||
| muzzlePoints | string | explicit muzzle positions, fired in list order: 1–8 `{ forward, lateral }` points in world px from the firing pivot (forward along the bore, lateral to its right; either may be negative); replaces `muzzleOffset`, `bores` and `boreSpacing` | ||
| spread | number 0–200 | inaccuracy at full range, world px | ||
| friendlyFire | boolean | the blast hurts your own side too | ||
| fan | number 0–1.5 | a `flame` jet: the half-angle it is sprayed across, radians | ||
| burn | number 0–1000 | a `flame` jet: damage a second the fire it leaves does, to both sides | ||
| burnLife | number 0–120 | a `flame` jet: seconds that fire keeps burning | ||
| sound | string | by class | the firing sound: mg, autocannon, cannon, missile, flak, arty, rocket, torpedo, bomb, flame, or the key of one of this mod's `sounds` | |
| look | look | how it looks, in place of its class: its own round, flash, burst where it lands, or a beam (see Weapon looks) |
A weapon's look (weapons[].look)
| field | type | required | default | meaning |
|---|---|---|---|---|
| sprite | string | the round: one of this mod's `prj.<name>` sheets — its frames play as it flies, or, baked `rotated`, it is turned to its heading | ||
| scale | number 0.1–8 | 1 | the round and its flash drawn at this multiple | |
| beam | { color, width, style, life } | the round is light: `{ color, width, style, life }` — a line from the muzzle to where it strikes, `laser` straight or `lightning` jagged, held `life` seconds; it strikes at once | ||
| muzzle | string | the class's flash | the muzzle flash: one of this mod's `fx.<name>` sheets, or `none` | |
| impact | string | the class's burst | the burst where it lands: an `fx.<name>` sheet of this mod, one of fx.expl.s, fx.expl.m, fx.expl.l, fx.spark, fx.flak, fx.smoke, fx.splash, fx.splash.l, fx.muzzle, fx.repair, fx.emp, fx.nuke, or `none` | |
| impactScale | number 0.1–8 | 1 | the burst drawn at this multiple | |
| impactLife | number 0.05–5 | 0.5 | seconds the burst plays over | |
| trail | smoke | none | smoke | a rocket's or a missile's smoke trail, or none |
Last edited