Esempio n. 1
0
/*
* CG_InstaExplosionMode
*/
void CG_InstaExplosionMode( vec3_t pos, vec3_t dir, int fire_mode )
{
	lentity_t *le;
	vec3_t angles;

	VecToAngles( dir, angles );

	le = CG_AllocModel( LE_ALPHA_FADE, pos, angles, 6, // 6 is time
		1, 1, 1, 1, //full white no inducted alpha
		250, 0.65, 0.65, 0.65, //white dlight
		CG_MediaModel( cgs.media.modInstagunWallHit ), NULL );

	le->ent.rotation = rand() % 360;

	if( fire_mode == FIRE_MODE_STRONG )
	{
		le->ent.scale = 1.5f;
		// add white energy particles on the impact
		CG_ImpactPuffParticles( pos, dir, 12, 1.25f, 1, 1, 1, 1, CG_MediaShader( cgs.media.shaderAdditiveParticleShine ) );
	}
	else
	{
		le->ent.scale = 1.0f;
		CG_ImpactPuffParticles( pos, dir, 12, 1.0f, 1, 1, 1, 1, NULL );
	}

	CG_SpawnDecal( pos, dir, random()*360, 8, 1, 1, 1, 1, 10, 1, qtrue, CG_MediaShader( cgs.media.shaderInstagunMark ) );
}
Esempio n. 2
0
/*
* CG_BoltExplosionMode
*/
void CG_BoltExplosionMode( const vec3_t pos, const vec3_t dir, int fire_mode, int surfFlags )
{
	lentity_t *le;
	vec3_t angles;

	if( !CG_SpawnDecal( pos, dir, random()*360, 12, 
		1, 1, 1, 1, 10, 1, true, CG_MediaShader( cgs.media.shaderElectroboltMark ) ) ) {
		if( surfFlags & (SURF_SKY|SURF_NOMARKS|SURF_NOIMPACT) ) {
			return;
		}
	}

	VecToAngles( dir, angles );

	le = CG_AllocModel( LE_INVERSESCALE_ALPHA_FADE, pos, angles, 6, // 6 is time
		1, 1, 1, 1, //full white no inducted alpha
		250, 0.75, 0.75, 0.75, //white dlight
		CG_MediaModel( cgs.media.modElectroBoltWallHit ), NULL );

	le->ent.rotation = rand() % 360;
	le->ent.scale = ( fire_mode == FIRE_MODE_STRONG ) ? 1.5f : 1.0f;
	
	// add white energy particles on the impact
	CG_ImpactPuffParticles( pos, dir, 15, 0.75f, 1, 1, 1, 1, NULL );
	
	trap_S_StartFixedSound( CG_MediaSfx( cgs.media.sfxElectroboltHit ), pos, CHAN_AUTO, 
		cg_volume_effects->value, ATTN_STATIC );
}
Esempio n. 3
0
void CG_SmallPileOfGibs( vec3_t origin, int damage, const vec3_t initialVelocity )
{
	lentity_t *le;
	int i, count;
	float mass;
	vec3_t angles, velocity;
	int time;
	float baseangle = random() * 2 * M_PI;
	float radialspeed = 5.0f * damage;

	if( !cg_gibs->integer )
		return;

	clamp( radialspeed, 50.0f, 100.0f );

	time = 15;
	mass = 120;
	count = cg_gibs->integer;
	clamp( count, 10, 128 );	

	VectorCopy( initialVelocity, velocity );

	// clip gib velocity
	clamp( velocity[0], -100, 100 );
	clamp( velocity[1], -100, 100 );
	clamp( velocity[2], 100, 500 );  // always some upwards

	for( i = 0; i < count; i++ )
	{
		le = CG_AllocModel( LE_NO_FADE, origin, vec3_origin, time + time * random(),
			1, 1, 1, 1,
			0, 0, 0, 0,
			CG_MediaModel( cgs.media.modTechyGibs[MAX_BIG_TECHY_GIBS + (((int)brandom( 0, MAX_SMALL_TECHY_GIBS )) % MAX_SMALL_TECHY_GIBS)] ),
			NULL );

		VectorSet( angles, crandom() * 360, crandom() * 360, crandom() * 360 );
		AnglesToAxis( angles, le->ent.axis );
		le->ent.scale = 1.0 + ( random() * 0.5f );
		le->ent.renderfx = RF_FULLBRIGHT|RF_NOSHADOW;

		le->velocity[0] = velocity[0] + ( cos( baseangle + M_PI * 2 * (float)(i) / (float)(count) ) * radialspeed ) + crandom() * radialspeed * 0.5f;
		le->velocity[1] = velocity[1] + ( sin( baseangle + M_PI * 2 * (float)(i) / (float)(count) ) * radialspeed ) + crandom() * radialspeed * 0.5f;
		le->velocity[2] = velocity[2] + 125 + crandom() * radialspeed;

		VectorSet( le->accel, -0.2f, -0.2f, -900 );
		le->bounce = 35;
	}

	CG_ImpactPuffParticles( origin, vec3_origin, 16, 2.5f, 1, 0.5, 0, 1, NULL );
}
Esempio n. 4
0
/*
* CG_InstaExplosionMode
*/
void CG_InstaExplosionMode( const vec3_t pos, const vec3_t dir, int fire_mode, int surfFlags, int owner )
{
	int team = -1;
	vec4_t tcolor = { 0.65f, 0.0f, 0.26f, 1.0f };
	lentity_t *le;
	vec3_t angles;

	if( cg_teamColoredInstaBeams->integer && owner && ( owner < gs.maxclients + 1 ) )
		team = cg_entities[owner].current.team;
	if( ( team == TEAM_ALPHA ) || ( team == TEAM_BETA ) )
	{
		CG_TeamColor( team, tcolor );
		tcolor[0] *= 0.65f;
		tcolor[1] *= 0.65f;
		tcolor[2] *= 0.65f;
	}

	if( !CG_SpawnDecal( pos, dir, random()*360, 12, 
		tcolor[0], tcolor[1], tcolor[2], 1.0f,
		10, 1, true, CG_MediaShader( cgs.media.shaderInstagunMark ) ) ) {
		if( surfFlags & (SURF_SKY|SURF_NOMARKS|SURF_NOIMPACT) ) {
			return;
		}
	}

	VecToAngles( dir, angles );

	le = CG_AllocModel( LE_ALPHA_FADE, pos, angles, 6, // 6 is time
		tcolor[0], tcolor[1], tcolor[2], 1,
		250, 0.65, 0.65, 0.65, //white dlight
		CG_MediaModel( cgs.media.modInstagunWallHit ), NULL );

	le->ent.rotation = rand() % 360;
	le->ent.scale = ( fire_mode == FIRE_MODE_STRONG ) ? 1.5f : 1.0f;
	// add white energy particles on the impact
	CG_ImpactPuffParticles( pos, dir, 15, 0.75f, 1, 1, 1, 1, NULL );
	
	trap_S_StartFixedSound( CG_MediaSfx( cgs.media.sfxElectroboltHit ), pos, CHAN_AUTO, 
		cg_volume_effects->value, ATTN_STATIC );
}