示例#1
0
文件: cl_tent.c 项目: eukos16/NGUNIX
void CL_ParseTEnt (void)
{
	int		type;
	vec3_t	pos;
	vec3_t	pos2;
	vec3_t	vel;
	vec3_t	dir;
	vec3_t	mins;
	vec3_t	maxs;
	vec3_t	vel1;
	vec3_t	vel2;
	int		count;
	int		thecol;
	int		speed;
	vec3_t	endpos;
	int		amount;
	dlight_t	*dl;
	int		rnd;
	int		colorStart, colorLength;

	type = MSG_ReadByte ();
	switch (type)
	{
	case TE_WIZSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 20, 30);
		S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
		break;

	case TE_KNIGHTSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 226, 20);
		S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
		break;

	case TE_SPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (particleset == 7){		
			//R_FlareTest (pos, 1, 255, 0, 0);
			R_FlareTest (pos, 1, rand()&255, rand()&255, rand()&255, 0, NULL);	// tseting random colored flares with nails
		}
			else
		R_RunParticleEffect (pos, vec3_origin, 0, 10);
		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;
	case TE_SUPERSPIKE:			// super spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 20);

		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;

// TomazQuake code
	case TE_SNOW:
		pos[0] = MSG_ReadCoord (); // mins
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		pos2[0] = MSG_ReadCoord (); // maxs
		pos2[1] = MSG_ReadCoord ();
		pos2[2] = MSG_ReadCoord ();
		amount	= MSG_ReadShort ();
		R_Snow(pos, pos2, amount);
		break;
		
	case TE_RAIN:
		pos[0]	= MSG_ReadCoord (); // mins
		pos[1]	= MSG_ReadCoord ();
		pos[2]	= MSG_ReadCoord ();
		pos2[0] = MSG_ReadCoord (); // maxs
		pos2[1] = MSG_ReadCoord ();
		pos2[2] = MSG_ReadCoord ();
		amount	= MSG_ReadShort ();
		R_Rain(pos, pos2, amount);
		break;			
// TomazQuake code

	case TE_GUNSHOT:			// bullet hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (particleset == 2){
			R_Smoke (pos, vec3_origin, 0, 20);
			R_Decal (pos, 4, 6, 0, 0);
		}
			else
		R_RunParticleEffect (pos, vec3_origin, 0, 20);
		break;

	case TE_EXPLOSION:			// rocket explosion
		pos[0] = MSG_ReadCoord();
		pos[1] = MSG_ReadCoord();
		pos[2] = MSG_ReadCoord();

		if (particleset == 2){
	//		R_Smoke (pos, vec3_origin, 0, 20);
			R_ParticleExplosionSpritey (pos, 13, 6, 2);
			R_Decal (pos, 13, 6, 2, 0);
		}
		else
		R_ParticleExplosion (pos);
		dl = CL_AllocDlight (0);
			if (r_coloreddyns->value){
				dl->color[0] = 4.0f;
				dl->color[1] = 2.0f;
				dl->color[2] = 0.5f;	// TODO: get avg color from model
		
					}
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
// 2000-05-02 NVS SVC_TE te_explosion by Maddes  start
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes  start
		if ((nvs_current_csvc->value >= 0.50) && (cls.signon > 1))
		{
			dl->flashcolor[0] = dl->color[0] = MSG_ReadCoord();
			dl->flashcolor[1] = dl->color[1] = MSG_ReadCoord();
			dl->flashcolor[2] = dl->color[2] = MSG_ReadCoord();
			dl->flashcolor[3] = MSG_ReadCoord();
		}
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes  end
// 2000-05-02 NVS SVC_TE te_explosion by Maddes  end
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);


		break;

	case TE_TAREXPLOSION:			// tarbaby explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_BlobExplosion (pos);

		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;

	case TE_LIGHTNING1:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt.mdl", true));
		break;

	case TE_LIGHTNING2:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", true));
		break;

	case TE_LIGHTNING3:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", true));
		break;

// PGM 01/21/97
	case TE_BEAM:				// grappling hook beam
		CL_ParseBeam (Mod_ForName("progs/beam.mdl", true));
		break;
// PGM 01/21/97

	case TE_LAVASPLASH:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_LavaSplash (pos);
		break;

	case TE_TELEPORT:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_TeleportSplash (pos);
		break;

	case TE_EXPLOSION2:				// color mapped explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		colorStart = MSG_ReadByte ();
		colorLength = MSG_ReadByte ();
		R_ParticleExplosion2 (pos, colorStart, colorLength);
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;

//	case TE_IMPLOSION:
//		pos[0] = MSG_ReadCoord ();
//		pos[1] = MSG_ReadCoord ();
//		pos[2] = MSG_ReadCoord ();
//		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
//		break;

	case TE_RAILTRAIL:				// Straight out of Quake2!
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		endpos[0] = MSG_ReadCoord ();
		endpos[1] = MSG_ReadCoord ();
		endpos[2] = MSG_ReadCoord ();
		vel[0] = MSG_ReadCoord ();
		vel[1] = MSG_ReadCoord ();
		vel[2] = MSG_ReadCoord ();
		R_RailTrail (pos, endpos);
//		R_RocketTrail (pos, endpos, 7);
		break;

	case TE_BLOOD:
		pos[0] = MSG_ReadCoord();
		pos[1] = MSG_ReadCoord();
		pos[2] = MSG_ReadCoord();
		vel[0] = (float)MSG_ReadChar();
		vel[1] = (float)MSG_ReadChar();
		vel[2] = (float)MSG_ReadChar();
		count = MSG_ReadByte();
		R_Blood(count, pos, pos, vel, vel);
		break;

	case TE_BLOODSHOWER:
		mins[0] = MSG_ReadCoord();
		mins[1] = MSG_ReadCoord();
		mins[2] = MSG_ReadCoord();
		maxs[0] = MSG_ReadCoord();
		maxs[1] = MSG_ReadCoord();
		maxs[2] = MSG_ReadCoord();
		speed = MSG_ReadCoord();
		count = MSG_ReadShort();
		vel1[0] = -speed;
		vel1[1] = -speed;
		vel1[2] = -speed;
		vel2[0] = speed;
		vel2[1] = speed;
		vel2[2] = speed;
		R_Blood(count, mins, maxs, vel1, vel2);
		break;

	case TE_PLASMABURN:			// plasma burn
		pos[0] = MSG_ReadCoord();
		pos[1] = MSG_ReadCoord();
		pos[2] = MSG_ReadCoord(); // all thius is, is just a quick white flash
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 250;
		dl->die = cl.time + 0.2;
		dl->decay = 1500;
		break;

	case TE_TEI_SMOKE:			// makes some puff of smoke
							// the direction doesn't do much in DP
							// but we do it anyway
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		vel[0] = MSG_ReadCoord ();
		vel[1] = MSG_ReadCoord ();
		vel[2] = MSG_ReadCoord ();
		count = MSG_ReadByte();
		R_Smoke (pos, vel, 0, count * 4);
		break;

	case TE_TEI_BIGEXPLOSION:			// rocket explosion
		pos[0] = MSG_ReadCoord();
		pos[1] = MSG_ReadCoord();
		pos[2] = MSG_ReadCoord();
		R_ParticleExplosion (pos); // in dp, this is just a explosion with a 
			//much much much much bigger dynamic light. Why? don't ask.
		dl = CL_AllocDlight (0);
			if (r_coloreddyns->value){
				dl->color[0] = 0.6f;
				dl->color[1] = 0.5f;
				dl->color[2] = 0.1f;	// TODO: get avg color from model
		
					}
		VectorCopy (pos, dl->origin);
		dl->radius = 850;
		dl->die = cl.time + 1;
		dl->decay = 800;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;


// Darkplaces QUAD DAMAGE TE's

	case TE_GUNSHOTQUAD:			// bullet hitting wall... one that does 4x damage
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 20);
				dl = CL_AllocDlight (0);
		if (r_coloreddyns->value){
				dl->color[0] = 0.1f;dl->color[1] = 0.1f;dl->color[2] = 1.0f;}
		VectorCopy (pos, dl->origin);
		dl->radius = 200;
		dl->die = cl.time + 0.2;
		dl->decay = 1500;
		break;


	case TE_SPIKEQUAD:			// spike hitting wall WITH A BLUE FLASH of QUAD DAMAGE POWER!
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 10);
		dl = CL_AllocDlight (0);
		if (r_coloreddyns->value){
				dl->color[0] = 0.1f;dl->color[1] = 0.1f;dl->color[2] = 1.0f;}
		VectorCopy (pos, dl->origin);
		dl->radius = 200;
		dl->die = cl.time + 0.2;
		dl->decay = 1500;
		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;
	case TE_SUPERSPIKEQUAD:			// THE INFAMOUSLY REDUNDANT SPIKE FUNCTION GETS FLASH TOO
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 20);
		dl = CL_AllocDlight (0);
		if (r_coloreddyns->value){
				dl->color[0] = 0.1f;dl->color[1] = 0.1f;dl->color[2] = 1.0f;}
		VectorCopy (pos, dl->origin);
		dl->radius = 200;
		dl->die = cl.time + 0.2;
		dl->decay = 1500;
		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;

	case TE_EXPLOSIONQUAD:			// one explosion no one wants to be part of
		pos[0] = MSG_ReadCoord();
		pos[1] = MSG_ReadCoord();
		pos[2] = MSG_ReadCoord();
		R_ParticleExplosion (pos);
		dl = CL_AllocDlight (0);
			if (r_coloreddyns->value){
				dl->color[0] = 0.1f;
				dl->color[1] = 0.1f;
				dl->color[2] = 1.0f;
		
					}
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;

// ---------------------------------------------------------
// Weird Teitei effects implemented by Leilei
// ---------------------------------------------------------
	case TE_TEI_G3:		// This was used for the Nex weapon in 
						// super old (2002) Nexuiz alphas
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		endpos[0] = MSG_ReadCoord ();
		endpos[1] = MSG_ReadCoord ();
		endpos[2] = MSG_ReadCoord ();
		vel[0] = MSG_ReadCoord () * 0.25;	// NONSTANDARD NOTE - this is "Angles" in the spec
		vel[1] = MSG_ReadCoord () * 0.25;;	// but in DP the angles aren't actually used
		vel[2] = MSG_ReadCoord () * 0.25;;	// for *ANYTHING* so we'll use them for color instead!
									// LH, can you 'color' the angles too?
									// vel[0] is inner colorindex
									// vel[1] is outer colorindex
									// vel[2] might tell it how to blend
	//	thecol = FindColorNoFB((int)vel[0],(int)vel[1],(int)vel[2]);
		
		if (vel[0] > 63) vel[0] = 63;
		if (vel[1] > 63) vel[1] = 63;
		if (vel[2] > 63) vel[2] = 63;
		if (vel[0] < 0) vel[0] = 0;
		if (vel[1] < 0) vel[1] = 0;
		if (vel[2] < 0) vel[2] = 0;
		//thecol = BestColor((int)vel[0],(int)vel[1],(int)vel[2]);
		thecol = palmap2[(int)vel[0]][(int)vel[1]][(int)vel[2]];
		R_BeamBeam (pos, endpos, thecol, 1);
		break;

	case TE_TEI_PLASMAHIT:				// Nexuiz electro explosion!
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		vel[0] = MSG_ReadCoord ();	// in dp, angle/dir isn't really used
		vel[1] = MSG_ReadCoord ();
		vel[2] = MSG_ReadCoord ();	// tei is messy :(
		count = MSG_ReadByte();
		R_PlasmaExplosion (pos, 40, 7, count);
		dl = CL_AllocDlight (0);
					if (r_coloreddyns->value){
				dl->color[0] = 0.2f;
				dl->color[1] = 0.2f;
				dl->color[2] = 1.0f;
		
					}
		VectorCopy (pos, dl->origin);
		dl->radius = 250;
		dl->die = cl.time + 0.3;
		dl->decay = 800;
		break;




	default:
// 2001-12-16 Various crashes changed to host errors by Maddes  start
//		Sys_Error ("CL_ParseTEnt: bad type");
		Host_Error ("CL_ParseTEnt: bad type %i", type);
		break;
// 2001-12-16 Various crashes changed to host errors by Maddes  end
	}
}
示例#2
0
/*
=================
CL_ParseTEnt
=================
*/
void CL_ParseTEnt (void)
{
	int		type;
	vec3_t	pos;
#ifdef QUAKE2
	vec3_t	endpos;
#endif
	dlight_t	*dl;
	int		rnd;
	int		colorStart, colorLength;

	type = MSG_ReadByte ();
	switch (type)
	{
	case TE_WIZSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 20, 30);
		S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
		break;
		
	case TE_KNIGHTSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 226, 20);
		S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
		break;
		
	case TE_SPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
#ifdef GLTEST
		Test_Spawn (pos);
#else
		R_RunParticleEffect (pos, vec3_origin, 0, 10);
#endif
		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;
	case TE_SUPERSPIKE:			// super spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 20);

		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;
		
	case TE_GUNSHOT:			// bullet hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 20);
		break;
		
	case TE_EXPLOSION:			// rocket explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_ParticleExplosion (pos);
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5f;
		dl->decay = 300;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;
		
	case TE_TAREXPLOSION:			// tarbaby explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_BlobExplosion (pos);

		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;

	case TE_LIGHTNING1:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt.mdl", TRUE));
		break;
	
	case TE_LIGHTNING2:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", TRUE));
		break;
	
	case TE_LIGHTNING3:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", TRUE));
		break;
	
// PGM 01/21/97 
	case TE_BEAM:				// grappling hook beam
		CL_ParseBeam (Mod_ForName("progs/beam.mdl", TRUE));
		break;
// PGM 01/21/97

	case TE_LAVASPLASH:	
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_LavaSplash (pos);
		break;
	
	case TE_TELEPORT:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_TeleportSplash (pos);
		break;
		
	case TE_EXPLOSION2:				// color mapped explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		colorStart = MSG_ReadByte ();
		colorLength = MSG_ReadByte ();
		R_ParticleExplosion2 (pos, colorStart, colorLength);
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5f;
		dl->decay = 300;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;
		
#ifdef QUAKE2
	case TE_IMPLOSION:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		S_StartSound (-1, 0, cl_sfx_imp, pos, 1, 1);
		break;

	case TE_RAILTRAIL:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		endpos[0] = MSG_ReadCoord ();
		endpos[1] = MSG_ReadCoord ();
		endpos[2] = MSG_ReadCoord ();
		S_StartSound (-1, 0, cl_sfx_rail, pos, 1, 1);
		S_StartSound (-1, 1, cl_sfx_r_exp3, endpos, 1, 1);
		R_RocketTrail (pos, endpos, 0+128);
		R_ParticleExplosion (endpos);
		dl = CL_AllocDlight (-1);
		VectorCopy (endpos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5f;
		dl->decay = 300;
		break;
#endif

	default:
		Sys_Error ("CL_ParseTEnt: bad type");
	}
}
示例#3
0
/*
=================
CL_ParseTEnt
=================
*/
void CL_ParseTEnt (void)
{
	int		type;
	vec3_t	pos;
#ifdef QUAKE2
	vec3_t	endpos;
#endif
	dlight_t	*dl;
	int		rnd;
	int		colorStart, colorLength;

	type = MSG_ReadByte ();
	switch (type)
	{
	case TE_WIZSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
        if (r_part_spikes.value == 2 && !cl_q3gunshot_mod)
			cl_q3gunshot_mod = Mod_ForName ("progs/bullet.md3", true);
		R_RunParticleEffect (pos, vec3_origin, 20, 30);
		S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
		break;
		
	case TE_KNIGHTSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
        if (r_part_spikes.value == 2 && !cl_q3gunshot_mod)
			cl_q3gunshot_mod = Mod_ForName ("progs/bullet.md3", true);
		R_RunParticleEffect (pos, vec3_origin, 226, 20);
		S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
		break;
		
	case TE_SPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
        if (r_part_spikes.value == 2 && !cl_q3gunshot_mod)
			cl_q3gunshot_mod = Mod_ForName ("progs/bullet.md3", true);
		//R00k--start
		if (r_decal_bullets.value)
		{
			R_SpawnDecalStatic(pos, decal_mark, 8);
		}
		//R00k--end

#ifdef GLTEST
		Test_Spawn (pos);
#else
		R_RunParticleEffect (pos, vec3_origin, 0, 10);
#endif
		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;
	case TE_SUPERSPIKE:			// super spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
        if (r_part_spikes.value == 2 && !cl_q3gunshot_mod)
			cl_q3gunshot_mod = Mod_ForName ("progs/bullet.md3", true);
		R_RunParticleEffect (pos, vec3_origin, 0, 20);

		//R00k--start
		if (r_decal_bullets.value)
		{
			R_SpawnDecalStatic(pos, decal_mark, 10);
		}
		//R00k--end

		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;
		
	case TE_GUNSHOT:			// bullet hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_SurfacePoint();
        if (r_part_gunshots.value == 2 && !cl_q3gunshot_mod)
			cl_q3gunshot_mod = Mod_ForName ("progs/bullet.md3", true);
                if(!Q_strncmp(texturehit,"sky",3) )                             //Don't draw decals or sparks on the skybox
        break;
		//R00k--start
		if (r_decal_bullets.value)
		{
			R_SpawnDecalStatic(pos, decal_mark, 8);
	}
		//R00k--end
                if(!Q_strncmp(texturehit,"metal",5) )
                {
                        rnd = rand() & 3;
                        if (rnd == 1)
                                S_StartSound (-1, 0, cl_sfx_mric1, pos, 1, 1);
                        else if (rnd == 2)
                                S_StartSound (-1, 0, cl_sfx_mric2, pos, 1, 1);
                        else
                                S_StartSound (-1, 0, cl_sfx_mric3, pos, 1, 1);
                } 
            else if(!Q_strncmp(texturehit,"wood",4) )
                {
                        rnd = rand() & 3;  
                        if (rnd == 1)
                                S_StartSound (-1, 0, cl_sfx_wric1, pos, 1, 1);
                        else if (rnd == 2)
                                S_StartSound (-1, 0, cl_sfx_wric2, pos, 1, 1);
                        else
                                S_StartSound (-1, 0, cl_sfx_wric3, pos, 1, 1);
                }
                else
                {
                        rnd = rand() & 3;
                        if (rnd == 1)
                                S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
                        else if (rnd == 2)
                                S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
                        else
                                S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
                }
		R_RunParticleEffect (pos, vec3_origin, 0, 20);	
	break;	
	case TE_EXPLOSION:			// rocket explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_ParticleExplosion (pos);
        if (r_decal_explosions.value)
		{
			R_SpawnDecalStatic(pos, decal_burn, 100);
		}
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;
		
	case TE_TAREXPLOSION:			// tarbaby explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_BlobExplosion (pos);
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;

	case TE_LIGHTNING1:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt.mdl", true));
		break;
	
	case TE_LIGHTNING2:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", true));
		break;
	
	case TE_LIGHTNING3:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", true));
		break;
	
// PGM 01/21/97 
	case TE_BEAM:				// grappling hook beam
		CL_ParseBeam (Mod_ForName("progs/beam.mdl", true));
		break;
// PGM 01/21/97

	case TE_LAVASPLASH:	
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_LavaSplash (pos);
        dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 150;
		dl->die = cl.time + 0.75;
		dl->decay = 200;
		break;
	
	case TE_TELEPORT:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
        if (r_part_telesplash.value == 2 && !cl_q3teleport_mod)
			cl_q3teleport_mod = Mod_ForName ("progs/telep.md3", true);
		R_TeleportSplash (pos);
		break;
		
	case TE_EXPLOSION2:				// color mapped explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		colorStart = MSG_ReadByte ();
		colorLength = MSG_ReadByte ();
		R_ParticleExplosion2 (pos, colorStart, colorLength);

		if (r_decal_explosions.value)
		{
			R_SpawnDecalStatic(pos, decal_burn, 100);
		}

		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;
		
#ifdef QUAKE2
	case TE_IMPLOSION:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		S_StartSound (-1, 0, cl_sfx_imp, pos, 1, 1);
		break;

	case TE_RAILTRAIL:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		endpos[0] = MSG_ReadCoord ();
		endpos[1] = MSG_ReadCoord ();
		endpos[2] = MSG_ReadCoord ();
		S_StartSound (-1, 0, cl_sfx_rail, pos, 1, 1);
		S_StartSound (-1, 1, cl_sfx_r_exp3, endpos, 1, 1);
		R_RocketTrail (pos, endpos, 0+128);
		R_ParticleExplosion (endpos);
		dl = CL_AllocDlight (-1);
		VectorCopy (endpos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
		break;
#endif

	default:
		Sys_Error ("CL_ParseTEnt: bad type");
	}
}
示例#4
0
文件: cl_tent.c 项目: indev/asquake
/*
=================
CL_ParseTEnt
=================
*/
void CL_ParseTEnt(void)
{
    int type;
    vec3_t pos;
    dlight_t *dl;
    int rnd;

    type = MSG_ReadByte();
    switch (type) {
    case TE_WIZSPIKE:		// spike hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 20, 30);
	S_StartSound(-1, 0, cl_sfx_wizhit, pos, 1, 1);
	break;

    case TE_KNIGHTSPIKE:	// spike hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 226, 20);
	S_StartSound(-1, 0, cl_sfx_knighthit, pos, 1, 1);
	break;

    case TE_SPIKE:		// spike hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 0, 10);

	if (rand() % 5)
	    S_StartSound(-1, 0, cl_sfx_tink1, pos, 1, 1);
	else {
	    rnd = rand() & 3;
	    if (rnd == 1)
		S_StartSound(-1, 0, cl_sfx_ric1, pos, 1, 1);
	    else if (rnd == 2)
		S_StartSound(-1, 0, cl_sfx_ric2, pos, 1, 1);
	    else
		S_StartSound(-1, 0, cl_sfx_ric3, pos, 1, 1);
	}
	break;
    case TE_SUPERSPIKE:	// super spike hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 0, 20);

	if (rand() % 5)
	    S_StartSound(-1, 0, cl_sfx_tink1, pos, 1, 1);
	else {
	    rnd = rand() & 3;
	    if (rnd == 1)
		S_StartSound(-1, 0, cl_sfx_ric1, pos, 1, 1);
	    else if (rnd == 2)
		S_StartSound(-1, 0, cl_sfx_ric2, pos, 1, 1);
	    else
		S_StartSound(-1, 0, cl_sfx_ric3, pos, 1, 1);
	}
	break;

    case TE_GUNSHOT:		// bullet hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 0, 20);
	break;

    case TE_EXPLOSION:		// rocket explosion
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_ParticleExplosion(pos);
	dl = CL_AllocDlight();
	VectorCopy(pos, dl->origin);
	dl->radius = 350;
	dl->die = cl.time + 0.5;
	dl->decay = 300;
	S_StartSound(-1, 0, cl_sfx_r_exp3, pos, 1, 1);
	break;

    case TE_TAREXPLOSION:	// tarbaby explosion
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_BlobExplosion(pos);

	S_StartSound(-1, 0, cl_sfx_r_exp3, pos, 1, 1);
	break;

    case TE_LIGHTNING1:	// lightning bolts
	CL_ParseBeam(Mod_ForName("progs/bolt.mdl", true));
	break;

    case TE_LIGHTNING2:	// lightning bolts
	CL_ParseBeam(Mod_ForName("progs/bolt2.mdl", true));
	break;

    case TE_LIGHTNING3:	// lightning bolts
	CL_ParseBeam(Mod_ForName("progs/bolt3.mdl", true));
	break;

    case TE_LAVASPLASH:
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_LavaSplash(pos);
	break;

    case TE_TELEPORT:
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_TeleportSplash(pos);
	break;

    default:
	Sys_Error("CL_ParseTEnt: bad type");
    }
}
示例#5
0
/*
=================
CL_ParseTEnt
=================
*/
qboolean CL_ParseTEnt (qboolean parse_only)
{
	int			type, rnd, colorStart, colorLength, cnt;
	vec3_t		pos, dir;
	dlight_t	*dl;
	byte		*colorByte;
	float		ExploColor[3];

	type = MSG_ReadByte ();
	switch (type)
	{
	
	case TE_WIZSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (!parse_only)
		{
			R_RunParticleEffect (pos, vec3_origin, 20, 30);
		#ifdef HEXEN2_SUPPORT
			if (!hexen2)
		#endif
				S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
		}
		break;

	case TE_KNIGHTSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (!parse_only)
		{
			R_RunParticleEffect (pos, vec3_origin, 226, 20);
		#ifdef HEXEN2_SUPPORT
			if (!hexen2)
		#endif
				S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
		}
		break;

	case TE_SPIKE:				// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
	// joe: they put the ventillator's wind effect to "10" in Nehahra. sigh.
		if (!parse_only)
		{
			if (nehahra)
				R_RunParticleEffect (pos, vec3_origin, 0, 9);
			else
				R_RunParticleEffect (pos, vec3_origin, 0, 10);

			if (rand() % 5)
			{
				S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
			}
			else
			{
				rnd = rand() & 3;
				if (rnd == 1)
					S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
				else if (rnd == 2)
					S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
				else
					S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
			}
		}
		break;

	case TE_SUPERSPIKE:			// super spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (!parse_only)
		{
			R_RunParticleEffect (pos, vec3_origin, 0, 20);

			if (rand() % 5)
			{
				S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
			}
			else
			{
				rnd = rand() & 3;
				if (rnd == 1)
					S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
				else if (rnd == 2)
					S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
				else
					S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
			}
		}
		break;

		// DP105 version
		/* 
	case TE_BLOOD:	// blood puff
		MSG_ReadVector(pos);
		dir[0] = MSG_ReadChar ();
		dir[1] = MSG_ReadChar ();
		dir[2] = MSG_ReadChar ();
		count = MSG_ReadByte (); // amount of particles
		if (!parse_only)
			R_BloodPuff(pos, dir, count);
		break;
		*/

	case TE_BLOOD:	// blood puff hitting flesh
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		dir[0] = MSG_ReadChar ();
		dir[1] = MSG_ReadChar ();
		dir[2] = MSG_ReadChar ();
		cnt = MSG_ReadByte (); // amount of particles
		if (!parse_only)
		{
			if (!qmb_initialized || !gl_part_blood.value)		// JDH: fix for Marcher/Bastion
			{
				VectorScale (dir, 0.1f, dir);		// 0.1 and 2 (below) come from standard SpawnBlood
			}
			R_RunParticleEffect (pos, dir, 73, cnt*2);
		}
		break;

/*	case TE_CUSTOMFLASH:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		radius = (MSG_ReadByte() + 1) * 8;
		velspeed = (MSG_ReadByte() + 1) / 256.0;
		color[0] = MSG_ReadByte() * (2.0f / 255.0f);
		color[1] = MSG_ReadByte() * (2.0f / 255.0f);
		color[2] = MSG_ReadByte() * (2.0f / 255.0f);
	//	Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
	//	CL_AllocDlight(NULL, &tempmatrix, radius, color[0], color[1], color[2], radius / velspeed, velspeed, 0, -1, true, 1, 0.25, 1, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
		if (!parse_only)
			CL_NewDlight (0, pos, radius, );
		break;
*/
	case TE_GUNSHOT:			// bullet hitting wall
		cnt = (cl.protocol == PROTOCOL_VERSION_QW) ? MSG_ReadByte () : 1;
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (!parse_only)
		{
			/*if (nehahra)
				R_SparkShower (pos, vec3_origin, 15, 0);
			else*/
				R_RunParticleEffect (pos, vec3_origin, 0, 21*cnt);
		}
		break;

	case TE_EXPLOSION:			// rocket explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (!parse_only)
		{
			if (r_explosiontype.value == 3)
				R_RunParticleEffect (pos, vec3_origin, 225, 50);
			else
				R_ParticleExplosion (pos);

			if (r_explosionlight.value)
			{
				SetCommonExploStuff;
//				dl->type = SetDlightColor (r_explosionlightcolor.value, lt_explosion, true);
				SetDlightColor (dl, r_explosionlightcolor.value, lt_explosion, true);
			}

			S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		}
		break;

	case TE_TAREXPLOSION:			// tarbaby explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (!parse_only)
		{
			R_BlobExplosion (pos);

			S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		}
		break;

	case TE_LIGHTNING1:				// lightning bolts
		CL_ParseBeam ("progs/bolt.mdl", parse_only);
		break;

	case TE_LIGHTNING2:				// lightning bolts
		CL_ParseBeam ("progs/bolt2.mdl", parse_only);
		break;

	case TE_LIGHTNING3:				// lightning bolts
		CL_ParseBeam ("progs/bolt3.mdl", parse_only);
		break;

	// nehahra support
	case TE_LIGHTNING4NEH:                             // lightning bolts
		CL_ParseBeam (MSG_ReadString(), parse_only);
		break;

// PGM 01/21/97 
	case TE_BEAM:				// grappling hook beam
		if (cl.protocol == PROTOCOL_VERSION_QW)
		{
			// temp ent #13 in QW is TE_LIGHTNINGBLOOD
			pos[0] = MSG_ReadCoord ();
			pos[1] = MSG_ReadCoord ();
			pos[2] = MSG_ReadCoord ();
			if (!parse_only)
				R_RunParticleEffect (pos, vec3_origin, 225, 50);
		}
		else
			CL_ParseBeam ("progs/beam.mdl", parse_only);
		break;
// PGM 01/21/97

	case TE_LAVASPLASH:	
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (!parse_only)
			R_LavaSplash (pos);
		break;

	case TE_TELEPORT:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		if (!parse_only)
			R_TeleportSplash (pos);
		break;

	case TE_EXPLOSION2:			// color mapped explosion
		if (cl.protocol == PROTOCOL_VERSION_QW)
		{
			// JDH: temp ent #12 in QW is TE_BLOOD
			cnt = MSG_ReadByte ();
			pos[0] = MSG_ReadCoord ();
			pos[1] = MSG_ReadCoord ();
			pos[2] = MSG_ReadCoord ();
			if (!parse_only)
				R_RunParticleEffect (pos, vec3_origin, 73, 20*cnt);
			break;
		}
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		colorStart = MSG_ReadByte ();
		colorLength = MSG_ReadByte ();

		if (!parse_only)
		{
			if (r_explosiontype.value == 3)
				R_RunParticleEffect (pos, vec3_origin, 225, 50);
			else
				R_ColorMappedExplosion (pos, colorStart, colorLength);

			if (r_explosionlight.value)
			{
				SetCommonExploStuff;
	//#ifdef GLQUAKE
				colorByte = (byte *)&d_8to24table[colorStart];
				/*ExploColor[0] = ((float)colorByte[0]) / (2.0 * 255.0);
				ExploColor[1] = ((float)colorByte[1]) / (2.0 * 255.0);
				ExploColor[2] = ((float)colorByte[2]) / (2.0 * 255.0);
				dl->type = lt_explosion2;*/
				dl->color[0] = ((float)colorByte[0]) / (2.0 * 255.0);
				dl->color[1] = ((float)colorByte[1]) / (2.0 * 255.0);
				dl->color[2] = ((float)colorByte[2]) / (2.0 * 255.0);	
	//#endif
			}

			S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		}
		break;

	// nehahra support
	case TE_SMOKE:                      // rocket explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		MSG_ReadByte();		//R_Smoke(pos, MSG_ReadByte());
	case TE_EXPLOSION3:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		ExploColor[0] = MSG_ReadCoord () / 2.0;
		ExploColor[1] = MSG_ReadCoord () / 2.0;
		ExploColor[2] = MSG_ReadCoord () / 2.0;

		if (!parse_only)
		{
			if (r_explosiontype.value == 3)
				R_RunParticleEffect (pos, vec3_origin, 225, 50);
			else
				R_ParticleExplosion (pos);

			if (r_explosionlight.value)
			{
				SetCommonExploStuff;
//				dl->type = lt_explosion3;
				VectorCopy (ExploColor, dl->color);
			}

			S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		}
		break;

#ifdef HEXEN2_SUPPORT
	case TE_STREAM_CHAIN:
	case TE_STREAM_SUNSTAFF1:
	case TE_STREAM_SUNSTAFF2:
	case TE_STREAM_LIGHTNING:
	case TE_STREAM_LIGHTNING_SMALL:
	case TE_STREAM_COLORBEAM:
	case TE_STREAM_ICECHUNKS:
	case TE_STREAM_GAZE:
	case TE_STREAM_FAMINE:
		CL_ParseStream (type, parse_only);
		break;

#endif
	
	default:
		if (!parse_only)
			Sys_Error ("CL_ParseTEnt: bad type");
		return false;
	}

	return true;
}
/*
=================
CL_ParseTEnt
=================
*/
void CL_ParseTEnt (void)
{
	int		type;
	vec3_t	pos;
	dlight_t	*dl;
	int		rnd;
	int		colorStart, colorLength;

	type = MSG_ReadByte ();
	switch (type)
	{
	case TE_WIZSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 20, 30);
#ifdef SUPPORTS_SOFTWARE_FTESTAIN
		R_AddStain(pos, -20, 11); //qbism ftestain
#endif
		S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
		break;

	case TE_KNIGHTSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 226, 20);
#ifdef SUPPORTS_SOFTWARE_FTESTAIN
		R_AddStain(pos, -20, 15); //qbism ftestain
#endif
		S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
		break;

	case TE_SPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();

		R_RunParticleEffect (pos, vec3_origin, 0, 10);
#ifdef SUPPORTS_SOFTWARE_FTESTAIN
		R_AddStain(pos, -30, 10); //qbism ftestain
#endif

		if ( rand() % 5 )
		{
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		}
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;

	case TE_SUPERSPIKE:			// super spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 20);
#ifdef SUPPORTS_SOFTWARE_FTESTAIN
		R_AddStain(pos, -30, 10); //qbism ftestain
#endif

		if ( rand() % 5 )
		{
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		}
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;

	case TE_GUNSHOT:			// bullet hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
#ifdef SUPPORTS_KUROK
		if (!kurok)
#endif
		{
			R_RunParticleEffect (pos, vec3_origin, 0, 20);
#ifdef SUPPORTS_SOFTWARE_FTESTAIN
			R_AddStain(pos, -40, 12); //qbism ftestain
#endif
		}
		break;

	case TE_EXPLOSION:			// rocket explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_ParticleExplosion (pos);
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
#ifdef SUPPORTS_KUROK
		if(kurok)
		{
        	dl->color[0] = MSG_ReadCoord ();
			dl->color[1] = MSG_ReadCoord ();
			dl->color[2] = MSG_ReadCoord ();
		}
#endif
#ifdef SUPPORTS_SOFTWARE_FTESTAIN
		R_AddStain(pos, -30, 45); //qbism ftestain
#endif
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;

	case TE_TAREXPLOSION:			// tarbaby explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_BlobExplosion (pos);
#ifdef SUPPORTS_KUROK
		if(kurok)
		{
			dl = CL_AllocDlight (0);
			VectorCopy (pos, dl->origin);
			dl->radius = 150;
			dl->die = cl.time + 0.75;
			dl->decay = 200;
        	dl->color[0] = MSG_ReadCoord ();
			dl->color[1] = MSG_ReadCoord ();
			dl->color[2] = MSG_ReadCoord ();
		}
#endif
#ifdef SUPPORTS_SOFTWARE_FTESTAIN
		R_AddStain(pos, -20, 60); //qbism ftestain
#endif
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;

	case TE_LIGHTNING1:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt.mdl", true));
		break;

	case TE_LIGHTNING2:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt2.mdl", true));
		break;

	case TE_LIGHTNING3:				// lightning bolts
		CL_ParseBeam (Mod_ForName("progs/bolt3.mdl", true));
		break;

// PGM 01/21/97
	case TE_BEAM:				// grappling hook beam
		CL_ParseBeam (Mod_ForName("progs/beam.mdl", true));
		break;
// PGM 01/21/97

	case TE_LAVASPLASH:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_LavaSplash (pos);
		break;

	case TE_TELEPORT:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_TeleportSplash (pos);
		break;

	case TE_EXPLOSION2:				// color mapped explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		colorStart = MSG_ReadByte ();
		colorLength = MSG_ReadByte ();
		R_ParticleExplosion2 (pos, colorStart, colorLength);
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
#ifdef SUPPORTS_SOFTWARE_FTESTAIN
		R_AddStain(pos, -30, 50); //qbism ftestain
#endif
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;

	default:
		Sys_Error ("CL_ParseTEnt: bad type");
	}
}
示例#7
0
/*
=================
CL_ParseTEnt
=================
*/
void
CL_ParseTEnt(void)
{
    int type;
    vec3_t pos;
    dlight_t *dl;
    int rnd;
    explosion_t *ex;
    int cnt;

    type = MSG_ReadByte();
    switch (type) {
    case TE_WIZSPIKE:		// spike hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 20, 30);
	S_StartSound(-1, 0, cl_sfx_wizhit, pos, 1, 1);
	break;

    case TE_KNIGHTSPIKE:	// spike hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 226, 20);
	S_StartSound(-1, 0, cl_sfx_knighthit, pos, 1, 1);
	break;

    case TE_SPIKE:		// spike hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 0, 10);

	if (rand() % 5)
	    S_StartSound(-1, 0, cl_sfx_tink1, pos, 1, 1);
	else {
	    rnd = rand() & 3;
	    if (rnd == 1)
		S_StartSound(-1, 0, cl_sfx_ric1, pos, 1, 1);
	    else if (rnd == 2)
		S_StartSound(-1, 0, cl_sfx_ric2, pos, 1, 1);
	    else
		S_StartSound(-1, 0, cl_sfx_ric3, pos, 1, 1);
	}
	break;
    case TE_SUPERSPIKE:	// super spike hitting wall
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 0, 20);

	if (rand() % 5)
	    S_StartSound(-1, 0, cl_sfx_tink1, pos, 1, 1);
	else {
	    rnd = rand() & 3;
	    if (rnd == 1)
		S_StartSound(-1, 0, cl_sfx_ric1, pos, 1, 1);
	    else if (rnd == 2)
		S_StartSound(-1, 0, cl_sfx_ric2, pos, 1, 1);
	    else
		S_StartSound(-1, 0, cl_sfx_ric3, pos, 1, 1);
	}
	break;

    case TE_EXPLOSION:		// rocket explosion
	// particles
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_ParticleExplosion(pos);

	// light
	dl = CL_AllocDlight(0);
	VectorCopy(pos, dl->origin);
	dl->radius = 350;
	dl->die = cl.time + 0.5;
	dl->decay = 300;
	dl->color = dl_colors[DLIGHT_FLASH];

	// sound
	S_StartSound(-1, 0, cl_sfx_r_exp3, pos, 1, 1);

	// sprite
	ex = CL_AllocExplosion();
	VectorCopy(pos, ex->origin);
	ex->start = cl.time;
	ex->model = Mod_ForName("progs/s_explod.spr", true);
	break;

    case TE_TAREXPLOSION:	// tarbaby explosion
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_BlobExplosion(pos);

	S_StartSound(-1, 0, cl_sfx_r_exp3, pos, 1, 1);
	break;

    case TE_LIGHTNING1:	// lightning bolts
	CL_ParseBeam(Mod_ForName("progs/bolt.mdl", true));
	break;

    case TE_LIGHTNING2:	// lightning bolts
	CL_ParseBeam(Mod_ForName("progs/bolt2.mdl", true));
	break;

    case TE_LIGHTNING3:	// lightning bolts
	CL_ParseBeam(Mod_ForName("progs/bolt3.mdl", true));
	break;

    case TE_LAVASPLASH:
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_LavaSplash(pos);
	break;

    case TE_TELEPORT:
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_TeleportSplash(pos);
	break;

    case TE_GUNSHOT:		// bullet hitting wall
	cnt = MSG_ReadByte();
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 0, 20 * cnt);
	break;

    case TE_BLOOD:		// bullets hitting body
	cnt = MSG_ReadByte();
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 73, 20 * cnt);
	break;

    case TE_LIGHTNINGBLOOD:	// lightning hitting body
	pos[0] = MSG_ReadCoord();
	pos[1] = MSG_ReadCoord();
	pos[2] = MSG_ReadCoord();
	R_RunParticleEffect(pos, vec3_origin, 225, 50);
	break;

    default:
	Sys_Error("%s: bad type", __func__);
    }
}
示例#8
0
文件: CL_TENT.C 项目: elhobbs/hexen2
void CL_ParseTEnt(void)
{
	int type;
	vec3_t pos;
#ifdef QUAKE2
	vec3_t endpos;
#endif
	dlight_t *dl;
	int rnd;
	int colorStart, colorLength;

	type = MSG_ReadByte();
	switch(type)
	{
	case TE_WIZSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 20, 30);
//		S_StartSound (-1, 0, cl_sfx_wizhit, pos, 1, 1);
		break;
		
	case TE_KNIGHTSPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 226, 20);
//		S_StartSound (-1, 0, cl_sfx_knighthit, pos, 1, 1);
		break;
		
	case TE_SPIKE:			// spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
#ifdef GLTEST
		Test_Spawn (pos);
#else
		R_RunParticleEffect (pos, vec3_origin, 0, 10);
#endif
		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;
	case TE_SUPERSPIKE:			// super spike hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 20);

		if ( rand() % 5 )
			S_StartSound (-1, 0, cl_sfx_tink1, pos, 1, 1);
		else
		{
			rnd = rand() & 3;
			if (rnd == 1)
				S_StartSound (-1, 0, cl_sfx_ric1, pos, 1, 1);
			else if (rnd == 2)
				S_StartSound (-1, 0, cl_sfx_ric2, pos, 1, 1);
			else
				S_StartSound (-1, 0, cl_sfx_ric3, pos, 1, 1);
		}
		break;
		
	case TE_GUNSHOT:			// bullet hitting wall
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_RunParticleEffect (pos, vec3_origin, 0, 20);
		break;
		
	case TE_EXPLOSION:			// rocket explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_ParticleExplosion (pos);
		break;
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;
/*	//jfm:not used
	case TE_TAREXPLOSION:			// tarbaby explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_BlobExplosion (pos);

		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;
*/
	case TE_LIGHTNING1:
	case TE_LIGHTNING2:
	case TE_LIGHTNING3:
		MSG_ReadShort();
		MSG_ReadCoord();
		MSG_ReadCoord();
		MSG_ReadCoord();
		MSG_ReadCoord();
		MSG_ReadCoord();
		MSG_ReadCoord();
		break;

	case TE_STREAM_CHAIN:
	case TE_STREAM_SUNSTAFF1:
	case TE_STREAM_SUNSTAFF2:
	case TE_STREAM_LIGHTNING:
	case TE_STREAM_LIGHTNING_SMALL:
	case TE_STREAM_COLORBEAM:
	case TE_STREAM_ICECHUNKS:
	case TE_STREAM_GAZE:
	case TE_STREAM_FAMINE:
		ParseStream(type);
		break;

	case TE_LAVASPLASH:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_LavaSplash (pos);
		break;

	case TE_TELEPORT:
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		R_TeleportSplash (pos);
		break;
/*	//jfm:not used
	case TE_EXPLOSION2:				// color mapped explosion
		pos[0] = MSG_ReadCoord ();
		pos[1] = MSG_ReadCoord ();
		pos[2] = MSG_ReadCoord ();
		colorStart = MSG_ReadByte ();
		colorLength = MSG_ReadByte ();
		R_ParticleExplosion2 (pos, colorStart, colorLength);
		dl = CL_AllocDlight (0);
		VectorCopy (pos, dl->origin);
		dl->radius = 350;
		dl->die = cl.time + 0.5;
		dl->decay = 300;
		S_StartSound (-1, 0, cl_sfx_r_exp3, pos, 1, 1);
		break;
*/
	default:
		Sys_Error ("CL_ParseTEnt: bad type");
	}
}