Jazz2::WeaponsDescription struct

Weapons of a level.

Derived classes

struct LevelWeapons
Weapons of a level as the editor changes them.

Public static functions

static auto GetImageMetadataPath(const WeaponImage& image) -> String
Returns the path of the metadata an image is available as while a level that has it is loaded.
static auto GetSoundIdentifier(const WeaponSound& sound) -> String
Returns the identifier a sound is played by while a level that has it is loaded.

Constructors, destructors, conversion operators

WeaponsDescription()

Public functions

auto IsDefault() const -> bool
Returns true if the level doesn't change any weapon.
auto GetSpriteMetadataPath(const WeaponSprite& sprite) const -> String
Returns the path of the metadata of a sprite, empty if it's the sprite of the weapon of the game.
auto GetFireSoundIdentifier(const WeaponFireOptions& fire) const -> String
Returns the identifier of the sound of firing, an embedded one or the name of one, empty for none.

Public variables

WeaponDefinition Weapons
Weapons by WeaponType.
SmallVector<WeaponImage, 0> Images
Images the weapons use.
SmallVector<WeaponSound, 0> Sounds
Sounds the weapons use.
std::int16_t ScriptHookArgument
Argument of the hook the weapons of the script share, -1 for none.

Function documentation

static String Jazz2::WeaponsDescription::GetImageMetadataPath(const WeaponImage& image)

Returns the path of the metadata an image is available as while a level that has it is loaded.

The path comes from what the image is, so two levels loaded at once share the same image, and a server and its clients name it the same.

static String Jazz2::WeaponsDescription::GetSoundIdentifier(const WeaponSound& sound)

Returns the identifier a sound is played by while a level that has it is loaded.

As GetImageMetadataPath(), it comes from what the sound is. Actors play it as a sound of their own (see ContentResolver::FindWeaponSound()), also on the clients of a server.