#include <weaponDef.h>
Public Types | |
enum | eType { kTrace, kProj } |
Shot type enums. More... | |
enum | eFiremode { kSingle, kFullauto, kBurst, kShotgun } |
Fire mode enums. More... | |
enum | eFxBatchType { kFxShot, kFxHit, kFxMuzzle } |
FX batch type enums. More... | |
Public Member Functions | |
Create methods | |
CWeaponDef () | |
~CWeaponDef () | |
Get/Set Value methods | |
void | name (std::string name) |
Set name. | |
const std::string & | name () |
Get name. | |
void | type (eType type) |
Set type. | |
eType | type () |
Get type. | |
void | firemode (eFiremode type) |
Set firemode. | |
eFiremode | firemode () |
Get firemode. | |
void | ammotype (int i) |
Set AmmoType. | |
int | ammotype () |
Get AmmoType. | |
void | range (unit u) |
Set range. | |
unit | range () |
Get range. | |
void | damage (unit u) |
Set damage. | |
unit | damage () |
Get damage. | |
void | cycle (unit u) |
Set cycle time between shots. | |
unit | cycle () |
Get cycle time between shots. | |
void | reload (unit u) |
Set reload time. | |
unit | reload () |
Get reload time. | |
void | clipsize (int i) |
Set clipsize. | |
int | clipsize () |
Get clipsize. | |
void | accuracy (unit u) |
Set accuracy adjustment. | |
unit | accuracy () |
Get accuracy adjustment. | |
void | sound_shot (const std::string &str) |
Set the shot firing sound. | |
void | sound_shot (const CSound &inSnd) |
Set the shot firing sound. | |
FX methods | |
bool | fx_add (CFxBatch::eType fxType, eFxBatchType batchType) |
Add an FX to the batch type given. | |
bool | fxShot_add (const char *str) |
Add an FX to the fxShot batch. | |
bool | fxHit_add (const char *str) |
Add an FX to the fxHit batch. | |
bool | fxMuzzle_add (const char *str) |
Add an FX to the fxMuzzle batch. | |
int | fx_size (eFxBatchType batchType) |
Get the size of the FX arrays. | |
void | soundShot_play (ENTITY *pEnt=NULL) |
Play the firing sound. | |
void | fxShot_play (const CVector3D &vStart, const CVector3D &vEnd) |
Play FX along shot path. | |
void | fxMuzzle_play (const CVector3D &vStart, const CAngle3D &ang) |
Play FX at muzzle. | |
void | fxHit_play (const CVector3D &vStart, const CVector3D &vNormal) |
Play FX at hit point. |
(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 CWeaponDef::eType |
void CWeaponDef::cycle | ( | unit | u | ) | [inline] |
Set cycle time between shots.
u | Time in ticks. |
void CWeaponDef::reload | ( | unit | u | ) | [inline] |
Set reload time.
u | Time in ticks. |
void CWeaponDef::accuracy | ( | unit | u | ) | [inline] |
Set accuracy adjustment.
u | Adjustment (0 = dead-aim, >0 less accurate). |
void CWeaponDef::sound_shot | ( | const std::string & | str | ) |
Set the shot firing sound.
str | Name of sound file (look in "sound" folder) |
void CWeaponDef::sound_shot | ( | const CSound & | inSnd | ) |
Set the shot firing sound.
inSnd | Sound used as input |
bool CWeaponDef::fx_add | ( | CFxBatch::eType | fxType, | |
eFxBatchType | batchType | |||
) |
Add an FX to the batch type given.
fxType | The type of FX to add. | |
batchType | Which batch to add to |
bool CWeaponDef::fxShot_add | ( | const char * | str | ) |
Add an FX to the fxShot batch.
str | Name of the effect to add. |
bool CWeaponDef::fxHit_add | ( | const char * | str | ) |
Add an FX to the fxHit batch.
str | Name of the effect to add. |
bool CWeaponDef::fxMuzzle_add | ( | const char * | str | ) |
Add an FX to the fxMuzzle batch.
str | Name of the effect to add. |
void CWeaponDef::soundShot_play | ( | ENTITY * | pEnt = NULL |
) |
Play the firing sound.
pEnt | ENTITY pointer (NULL to just play the sound) |
Play FX along shot path.
vStart | Starting point. | |
vEnd | Ending point. |
Play FX at muzzle.
vStart | Firing point. | |
ang | Firing angle. |
Play FX at hit point.
vStart | Hit point. | |
vNormal | Surface normal. |