#include <weapon.h>
Public Types | |
| enum | eState { kUndef = -1, kEmpty = 0, kReady, kReloading, kFiring } |
| Current weapon state enum. More... | |
Public Member Functions | |
| void | update () |
| Update the weapon. | |
Create methods | |
| CWeapon () | |
| Create with default values. | |
| CWeapon (int i) | |
| Create with an index into the WeaponDefPool. | |
| ~CWeapon () | |
Info methods | |
| eState | state () |
| |
Weapon Def methods | |
| bool | def (int index) |
| Set CWeaponDef index. | |
| CWeaponDef * | weaponDef () const |
| |
Action methods | |
| bool | fire (const CVector3D &v, const CAngle3D &a) |
| Try to fire the weapon. | |
| int | reload (int ammo) |
| Try to reload the weapon. | |
Info methods | |
| int | ammo () const |
| |
| int | ammotype () const |
| |
| const CVector3D & | hit_pos () const |
| |
| unit | damage () const |
| |
| unit | range () const |
| |
| int | def () const |
| |
(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.
| enum CWeapon::eState |
| bool CWeapon::def | ( | int | index | ) | [inline] |
Set CWeaponDef index.
| index | Index of CWeaponDef we want to use (from pool). |
Try to fire the weapon.
| v | Vector we are firing from. | |
| a | Angle we are firing along. |
| int CWeapon::reload | ( | int | ammo | ) |
Try to reload the weapon.
| ammo | Max number of rounds that can be used to load this weapon. |
1.5.4