96 lines
2.7 KiB
C
96 lines
2.7 KiB
C
#include "cg_local.h"
|
|
#include "fx_local.h"
|
|
|
|
|
|
#define BORG_SPIN 0.6f
|
|
|
|
void FX_BorgProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon )
|
|
{
|
|
float len;
|
|
vec3_t dir, end;
|
|
|
|
FX_AddSprite( cent->lerpOrigin, NULL, qfalse,
|
|
8.0f + ( random() * 24.0f ), 0.0f,
|
|
1.0f, 1.0f,
|
|
random() * 360, 0.0f,
|
|
1,
|
|
cgs.media.borgFlareShader);
|
|
|
|
// Energy glow
|
|
FX_AddSprite( cent->lerpOrigin, NULL, qfalse,
|
|
18.0f + ( random() * 24.0f ), 0.0f,
|
|
0.2f, 0.1f,
|
|
random() * 360, 0.0f,
|
|
1,
|
|
cgs.media.borgFlareShader);
|
|
|
|
VectorSet( dir, crandom(), crandom(), crandom() );
|
|
VectorNormalize( dir );
|
|
len = random() * 12.0f + 18.0f;
|
|
VectorMA( cent->lerpOrigin, len, dir, end );
|
|
FX_AddElectricity( cent->lerpOrigin, end, 0.2f, 0.6f, 0.0f, 0.3f, 0.0f, 5, cgs.media.borgLightningShaders[2], 1.0f );
|
|
}
|
|
|
|
/*
|
|
-------------------------
|
|
FX_BorgWeaponHitWall
|
|
-------------------------
|
|
*/
|
|
void FX_BorgWeaponHitWall( vec3_t origin, vec3_t normal )
|
|
{
|
|
weaponInfo_t *weaponInfo = &cg_weapons[WP_BORG_WEAPON];
|
|
|
|
// Expanding shock ring
|
|
FX_AddQuad( origin, normal,
|
|
0.5f, 6.4f,
|
|
0.8, 0.0,
|
|
random() * 360.0f,
|
|
200,
|
|
cgs.media.borgLightningShaders[0] );
|
|
|
|
// Impact core
|
|
FX_AddQuad( origin, normal,
|
|
16.0f + ( random() * 8.0f ), 3.2f,
|
|
0.6f, 0.0f,
|
|
cg.time * BORG_SPIN,
|
|
100,
|
|
cgs.media.borgLightningShaders[0] );
|
|
|
|
//Sound
|
|
trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, weaponInfo->mainHitSound);
|
|
|
|
CG_ImpactMark( cgs.media.scavMarkShader, origin, normal, random()*360, 1,1,1,0.2, qfalse, random() + 5.5f, qfalse );
|
|
}
|
|
|
|
/*
|
|
-------------------------
|
|
FX_BorgTaser
|
|
-------------------------
|
|
*/
|
|
|
|
void FX_BorgTaser( vec3_t end, vec3_t start )
|
|
{
|
|
float len;
|
|
vec3_t dis;
|
|
|
|
FX_AddSprite( end, NULL, qfalse, 9.0f, 0.0f, 1.0f, 0.0f, 30.0f, 0.0f, 250, cgs.media.borgLightningShaders[0] );
|
|
FX_AddSprite( end, NULL, qfalse, 18.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 150, cgs.media.borgLightningShaders[0] );
|
|
FX_AddSprite( start, NULL, qfalse, 12.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 100, cgs.media.borgLightningShaders[0] );
|
|
FX_AddSprite( start, NULL, qfalse, 6.0f, 0.0f, 1.0f, 0.0f, 60.0f, 0.0f, 150, cgs.media.borgLightningShaders[0] );
|
|
|
|
VectorSubtract( start, end, dis );
|
|
len = VectorNormalize( dis );
|
|
|
|
if ( len < 96 )
|
|
len = 0.6f;
|
|
else if ( len < 256 )
|
|
len = 0.4f;
|
|
else if ( len > 512 )
|
|
len = 0.1f;
|
|
else
|
|
len = 0.2f;
|
|
|
|
FX_AddLine( start, end, 1.0f, 5.0f, 0.0f, 1.0f, 0.0f, 150, cgs.media.borgLightningShaders[1] );
|
|
FX_AddElectricity( start, end, 0.2f, 3.0f, 0.0f, 1.0f, 0.0f, 150, cgs.media.borgLightningShaders[2], len );
|
|
FX_AddElectricity( start, end, 0.5f, 2.0f, 0.0f, 1.0f, 0.0f, 150, cgs.media.borgLightningShaders[3], len );
|
|
}
|