Jazz2::WeaponDefinition struct

What a level makes of one of the weapons.

WeaponKind::Stock keeps the weapon of the game and changes only its Options and ammo. WeaponKind::Custom fires shots as its GetCustom() says, which only a custom weapon has allocated. WeaponKind::Script is set up by the script of the level, which gets ScriptParams.

Public static functions

static auto MakeDefault(WeaponType weaponType) -> WeaponDefinition
Returns the weapon of the game.
static auto MakeCustom(WeaponType weaponType, WeaponType basedOn) -> WeaponDefinition
Returns a custom weapon made from a weapon of the game.

Constructors, destructors, conversion operators

WeaponDefinition() defaulted
WeaponDefinition(const WeaponDefinition& other)
WeaponDefinition(WeaponDefinition&& other) defaulted noexcept

Public functions

auto operator=(const WeaponDefinition& other) -> WeaponDefinition&
auto operator=(WeaponDefinition&& other) -> WeaponDefinition& defaulted noexcept
auto GetCustom() const -> const CustomWeaponOptions&
Returns how it fires and what, the defaults if it has none of its own.
auto GetCustom() -> CustomWeaponOptions&
Returns how it fires and what to change, made with the defaults if it has none yet.
auto HasCustom() const -> bool
Returns true if it has options of a custom weapon of its own.
void ResetCustom()
Forgets the options of a custom weapon.
auto IsDefault(WeaponType weaponType) const -> bool
Returns true if the level doesn't change the weapon.
auto operator==(const WeaponDefinition& other) const -> bool
auto operator!=(const WeaponDefinition& other) const -> bool

Public variables

String Name
Name, empty for the name of the weapon of the game.
SmallVector<std::uint8_t, 0> ScriptParams
Parameters the script gets, for WeaponKind::Script.
WeaponOptions Options
Options as JJ2+ scripts know them.
std::uint16_t StartAmmo
Ammo a player has when the level starts, in whole rounds.
WeaponKind Kind
What the level makes of it.
std::uint8_t AmmoCrateEvent
Event that becomes an ammo crate of it, 0 for none.