weapons.entity module

Provides simplified weapon functionality.

class weapons.entity.Weapon(index)[source]

Bases: entities._base.Entity

Allows easy usage of the weapon’s attributes.

get_ammo()[source]

Return the amount of ammo the player has for the weapon.

get_clip()[source]

Return the amount of ammo in the weapon’s clip.

get_secondary_fire_ammo()[source]

Return the secondary fire ammo the player has for the weapon.

get_secondary_fire_clip()[source]

Return the amount of ammo in the weapon’s secondary fire clip.

remove()[source]

Remove the weapon.

set_ammo(value)[source]

Set the player’s ammo property for the weapon.

set_clip(value)[source]

Set the amount of ammo in the weapon’s clip.

set_secondary_fire_ammo(value)[source]

Set the player’s secondary fire ammo property for the weapon.

set_secondary_fire_clip(value)[source]

Set the amount of ammo in the weapon’s secondary fire clip.

ammo

Property to get/set the weapon’s ammo.

clip

Property to get/set the weapon’s clip.

secondary_fire_ammo

Property to get/set the weapon’s secondary fire ammo.

secondary_fire_clip

Property to get/set the weapon’s secondary fire clip.

weapon_name

Return the full class name of the weapon.