weapons.instance module

Provides a class to store information specific to each weapon.

class weapons.instance.WeaponClass(name, basename, properties)[source]

Bases: object

Class used to store information specific to the given weapon.

__init__(name, basename, properties)[source]

Store the base attributes for the weapon.

property ammoprop

Return the ammoprop of the weapon.

Returns:

None if the weapon doesn’t have ammo.

Return type:

int

property basename

Return the basename of the weapon (e.g. ‘knife’).

Return type:

str

property clip

Return the clip value of the weapon.

Returns:

None if the weapon doesn’t have ammo.

Return type:

int

property cost

Return the cost of the weapon.

Returns:

None if the cost data is missing.

Return type:

int

property item_definition_index

Return the item definition index of the weapon.

Returns:

None if the item defition index data is missing.

Return type:

int

property maxammo

Return the maxammo amount for the weapon.

Returns:

None if the weapon doesn’t have ammo.

Return type:

int

property name

Return the entity classname of the weapon (e.g. ‘weapon_knife’).

Return type:

str

property slot

Return the slot of the weapon.

Return type:

int

property tags

Return the tags of the weapon.

Return type:

list