Weapons
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:
| 무기 | 경장갑 | 중형 장갑 | 중장갑 | 건물 | 함선 | 잠수함 | 항공기 |
|---|---|---|---|---|---|---|---|
| ×1.50 | ×1 | ×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.50 | ×0.35 | ×0.15 | ×0 | ×0.40 | — | ×1.10 | |
| — | — | — | — | — | — | ×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.50 | ×0.50 | ×0 | ×0.70 | — | — | |
| ×2 | ×0.10 | ×0.10 | ×0.10 | ×1 | — | ×1.20 | |
| ×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.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.50 | ×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 | ×1 | ×1 | ×0.10 | ×1 | — | ×1 | |
| ×1 | ×1 | ×1 | ×0.10 | ×1 | — | ×1 | |
| ×1.50 | ×1.50 | ×0.40 | ×0.30 | ×0.60 | — | — | |
| ×1.50 | ×1.50 | ×0.50 | ×0.30 | ×0.70 | — | — | |
| ×0.60 | ×1.30 | ×1.10 | ×0.60 | ×1 | — | — | |
| ×0.60 | ×1.30 | ×1.20 | ×0.60 | ×1.10 | — | — | |
| ×1.50 | ×1.10 | ×0.50 | ×0.50 | ×0.50 | — | — | |
| — | — | — | — | — | — | ×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[])
| 필드 | 유형 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
| 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 | ||
| salvo | boolean | the burst is fired a mount at a time: every muzzle of a mount (`bores`, `muzzlePoints`) at once, heard as one report, and the next mount (`turretMounts`) `burstDelay` later; a `burst` of all the mounts' muzzles fires each once | ||
| 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 | ||
| rack | integer 2–8 | rounds held ready and loaded one at a time, `reload` seconds each, where it stands: it fires whenever one is loaded, every round it has `burstDelay` apart, and its reload bar is a segment a round; with a `burst`, each is a pod of that many rounds, loaded as one and fired together from its own muzzles, and at a target only the pods it needs go | ||
| interceptRounds | integer 1–20 | 1 | point-defence rounds it takes to shoot one of its rounds down; a hit short of that strikes sparks and the round flies on | |
| 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–16 `{ 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`; a `rack` of pods takes them a pod at a time, the first pod the first `burst` of them | ||
| 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 | ||
| spinUp | number 0.05–10 | a rotary gun: seconds its barrels take to spin up from rest; it fires only once they are at speed, and with nothing to shoot they coast to a stop over 1.5 s | ||
| heatLimit | number 0.5–120 | barrels that heat with fire: seconds of unbroken fire before it overheats, stops and cools; firing in bursts, the heat drains between them | ||
| coolTime | number 0.1–60 | 2 | with `heatLimit`: seconds an overheated gun takes to cool before it fires again | |
| overheat | boolean | the reload is shown as the weapon overheating: named so, counted down, and the muzzle glows while it cools | ||
| sound | string | by class | the firing sound: mg, hmg, gatling, autocannon, cannon, missile, tbm, 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)
| 필드 | 유형 | 필수 | 기본값 | 설명 |
|---|---|---|---|---|
| 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 |
마지막 수정