WeaponSettings
What a weapon does, which the room holds every shot to.
Properties
Section titled “Properties”| Property | Type | Default value | Description |
|---|---|---|---|
aimAssist? |
AimAssistOptions |
undefined |
Its own aim assist, each field laid over the game’s weapons() options. Only the aiming weapon’s act: the first the character holds. |
autoFire? |
boolean |
true for WeaponKind.Instant, false for WeaponKind.Projectile, which leads and arcs |
Whether it fires on its own on a touch screen while its shot line rests on a target, where the game’s weapons() keeps auto-fire on. Off for a slow precision weapon, as Fortnite’s Auto Fire skips snipers. |
automatic? |
boolean |
true |
Whether a trigger held down fires at its rate, rather than once per press: a held button through the crosshair and a held fire button. Auto-fire fires at its rate either way, and a click on a free cursor fires once. |
damage |
number |
undefined |
Health one hit takes. |
data? |
Readonly<Readonly<Record<string, unknown>>> |
undefined |
The game’s own data every hit of it carries, such as a pellet’s dose of an element, as the game’s hitData registers it. What depends on the shooter, a game reads off the hit’s source. |
friendlyFire? |
boolean |
undefined |
Whether its shots hurt the shooter’s allies, over the world’s friendly fire: true for a weapon that hurts teammates in a game where friendly fire is off, false for one that never does. Left out, it follows the world’s, which teams() sets and which is off with no teams(), so a player’s shot passes through another player’s character, as through a teammate. |
judge? |
ShotJudge |
undefined |
Who decides what its shots hit, over the game’s ShotSettings: the room unless one of them says the page. |
kind |
WeaponKind |
undefined |
- |
model? |
string |
undefined |
The registered model a projectile is drawn as; none draws nothing. |
muzzle? |
(character, out) => Vector3 | null |
undefined |
Writes into out where its shot leaves character, such as its gun’s drawn barrel, and returns it; null for the middle of its body. aimShot and auto-fire read it alike. The room takes a muzzle within its tolerance of the character’s middle. |
pellets? |
number |
undefined |
Pellets one pull of an instant weapon fires, each judged apart; one when left out. |
pierce? |
number |
undefined |
Targets past the first one pellet of an instant weapon passes through; none when left out. |
range |
number |
undefined |
Metres a shot reaches. |
rules? |
ShotRules |
undefined |
The rules its shots meet, laid over the game’s by name: a rule to add or replace one, false to take one out. |
shotsPerSecond |
number |
undefined |
The most shots a second a player fires with it. |
speed? |
number |
undefined |
Metres a second a projectile flies: defaultProjectileSpeed when left out. An instant shot has none. |
spread? |
number |
undefined |
Radians between two neighbouring pellets, fanned level with the ground round the pull’s direction. |
stats? |
Partial<Record<WeaponNumber, string | readonly string[]>> |
undefined |
The shooter’s stats laid on its numbers, so a card or an item that raises the shooter’s stat changes what the shooter’s shots do with every weapon that names it. |
zoneDamage? |
number |
undefined |
Times a zone’s own multiplier its hits there deal: 1.5 turns a head’s double into triple, and 1 when left out keeps it. A hit on the body deals the weapon’s damage whatever this is. |