jjWEAPON class JJ2+

Options of one weapon

Reached through jjWeapons, indexed by WEAPON::Weapon. These are the options the game itself plays the level by, so changing them changes how the weapon behaves for every player.

Properties

bool allowed
Whether the weapon can be used in the level
bool allowedPowerup
Whether the weapon can be powered up in the level
bool comesFromBirds
Whether a companion bird fires the weapon
bool comesFromBirdsPowerup
Whether a companion bird fires the weapon powered up
bool comesFromGunCrates
Whether gun crates and gun barrels can drop ammo of the weapon
bool defaultSample
Whether the sound of firing the weapon is played
int gemsLost
Gems a player hit by the weapon loses in Treasure Hunt
int gemsLostPowerup
Gems a player hit by the powered-up weapon loses in Treasure Hunt
bool gradualAim
Whether bullets turn towards where the player aims over a few shots
bool infinite
Whether the ammo of the weapon never runs out
int maximum
Most ammo of the weapon a player can carry
int multiplier
How many times as much ammo pickups give
bool replacedByBubbles
Whether the weapon fires air bubbles under water
bool replacedByShield
Whether an active shield fires in place of the weapon
bool replenishes
Whether the ammo is refilled to the maximum when the level starts
SPREAD::Spread spread partially supported
How many bullets the weapon fires at once
int8 style
How the weapon fires while the fire key is held

Property documentation

bool jjWEAPON::allowed

Whether the weapon can be used in the level

When false, players can't fire it and lose their ammo of it when the level starts. True by default.

bool jjWEAPON::allowedPowerup

Whether the weapon can be powered up in the level

When false, players don't get or keep the powerup of it. True by default.

bool jjWEAPON::comesFromBirds

Whether a companion bird fires the weapon

Otherwise the bird fires blaster bullets, whatever weapon the player has selected.

bool jjWEAPON::comesFromBirdsPowerup

Whether a companion bird fires the weapon powered up

Only when comesFromBirds is true and the player has the powerup of the weapon.

bool jjWEAPON::comesFromGunCrates

Whether gun crates and gun barrels can drop ammo of the weapon

True by default for every weapon but the blaster.

int jjWEAPON::gemsLost

Gems a player hit by the weapon loses in Treasure Hunt

3 by default.

int jjWEAPON::gemsLostPowerup

Gems a player hit by the powered-up weapon loses in Treasure Hunt

3 by default.

bool jjWEAPON::gradualAim

Whether bullets turn towards where the player aims over a few shots

Kept for scripts, the game's own weapons don't use it.

bool jjWEAPON::infinite

Whether the ammo of the weapon never runs out

The HUD shows such ammo as unlimited. True by default for the blaster only. Changing it converts the ammo every player has of the weapon accordingly.

int jjWEAPON::maximum

Most ammo of the weapon a player can carry

0 or less means the default of 99, higher values are capped at 255. -1 by default.

int jjWEAPON::multiplier

How many times as much ammo pickups give

The ammo shown on the HUD is divided by it. 1 by default.

bool jjWEAPON::replacedByBubbles

Whether the weapon fires air bubbles under water

False by default.

bool jjWEAPON::replacedByShield

Whether an active shield fires in place of the weapon

True by default for the blaster only.

bool jjWEAPON::replenishes

Whether the ammo is refilled to the maximum when the level starts

False by default.

SPREAD::Spread jjWEAPON::spread

How many bullets the weapon fires at once

int8 jjWEAPON::style

How the weapon fires while the fire key is held

A WEAPON::Style value.