jedioutcast/code/cgame/FX_Emplaced.cpp
2013-04-04 09:52:42 -05:00

82 lines
No EOL
1.8 KiB
C++

// Emplaced Weapon
// this line must stay at top so the whole PCH thing works...
#include "cg_headers.h"
//#include "cg_local.h"
#include "cg_media.h"
#include "FxScheduler.h"
/*
---------------------------
FX_EmplacedProjectileThink
---------------------------
*/
void FX_EmplacedProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon )
{
vec3_t forward;
if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f )
{
forward[2] = 1.0f;
}
if ( cent->gent && cent->gent->owner && cent->gent->owner->activator && cent->gent->owner->activator->s.number > 0 )
{
// NPC's do short shot
theFxScheduler.PlayEffect( "emplaced/shotNPC", cent->lerpOrigin, forward );
}
else
{
// players do long shot
theFxScheduler.PlayEffect( "emplaced/shot", cent->lerpOrigin, forward );
}
}
/*
---------------------------
FX_EmplacedHitWall
---------------------------
*/
void FX_EmplacedHitWall( vec3_t origin, vec3_t normal )
{
theFxScheduler.PlayEffect( "emplaced/wall_impact", origin, normal );
}
/*
---------------------------
FX_EmplacedHitPlayer
---------------------------
*/
void FX_EmplacedHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid )
{
if ( humanoid )
{
theFxScheduler.PlayEffect( "emplaced/flesh_impact", origin, normal );
}
else
{
theFxScheduler.PlayEffect( "emplaced/droid_impact", origin, normal );
}
}
/*
---------------------------
FX_TurretProjectileThink
---------------------------
*/
void FX_TurretProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon )
{
vec3_t forward;
if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f )
{
forward[2] = 1.0f;
}
theFxScheduler.PlayEffect( "turret/shot", cent->lerpOrigin, forward );
}