codemp/cgame/fx_blaster.c

Go to the documentation of this file.
00001 // Blaster Weapon
00002 
00003 #include "cg_local.h"
00004 
00005 /*
00006 -------------------------
00007 FX_BlasterProjectileThink
00008 -------------------------
00009 */
00010 
00011 void FX_BlasterProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon )
00012 {
00013         vec3_t forward;
00014 
00015         if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f )
00016         {
00017                 forward[2] = 1.0f;
00018         }
00019 
00020         trap_FX_PlayEffectID( cgs.effects.blasterShotEffect, cent->lerpOrigin, forward, -1, -1 );
00021 }
00022 
00023 /*
00024 -------------------------
00025 FX_BlasterAltFireThink
00026 -------------------------
00027 */
00028 void FX_BlasterAltFireThink( centity_t *cent, const struct weaponInfo_s *weapon )
00029 {
00030         vec3_t forward;
00031 
00032         if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f )
00033         {
00034                 forward[2] = 1.0f;
00035         }
00036 
00037         trap_FX_PlayEffectID( cgs.effects.blasterShotEffect, cent->lerpOrigin, forward, -1, -1 );
00038 }
00039 
00040 /*
00041 -------------------------
00042 FX_BlasterWeaponHitWall
00043 -------------------------
00044 */
00045 void FX_BlasterWeaponHitWall( vec3_t origin, vec3_t normal )
00046 {
00047         trap_FX_PlayEffectID( cgs.effects.blasterWallImpactEffect, origin, normal, -1, -1 );
00048 }
00049 
00050 /*
00051 -------------------------
00052 FX_BlasterWeaponHitPlayer
00053 -------------------------
00054 */
00055 void FX_BlasterWeaponHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid )
00056 {
00057         if ( humanoid )
00058         {
00059                 trap_FX_PlayEffectID( cgs.effects.blasterFleshImpactEffect, origin, normal, -1, -1 );
00060         }
00061         else
00062         {
00063                 trap_FX_PlayEffectID( cgs.effects.blasterDroidImpactEffect, origin, normal, -1, -1 );
00064         }
00065 }