|
|
|
@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
#include "particles.h"
|
|
|
|
|
entity_state_t *CL_FindPacketEntity(int num);
|
|
|
|
|
|
|
|
|
|
#define R_AddDecals(a) //disabled for now
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
pt_gunshot=P_INVALID,
|
|
|
|
|
ptdp_gunshotquad=P_INVALID,
|
|
|
|
@ -225,10 +223,11 @@ sfx_t *cl_sfx_ric2;
|
|
|
|
|
sfx_t *cl_sfx_ric3;
|
|
|
|
|
sfx_t *cl_sfx_r_exp3;
|
|
|
|
|
|
|
|
|
|
cvar_t cl_expsprite = CVARF("cl_expsprite", "0", CVAR_ARCHIVE);
|
|
|
|
|
cvar_t cl_expsprite = CVARFD("cl_expsprite", "0", CVAR_ARCHIVE, "Display a central sprite in explosion effects. QuakeWorld typically does so, NQ mods should not.");
|
|
|
|
|
cvar_t r_explosionlight = CVARFC("r_explosionlight", "1", CVAR_ARCHIVE, Cvar_Limiter_ZeroToOne_Callback);
|
|
|
|
|
cvar_t cl_truelightning = CVARF("cl_truelightning", "0", CVAR_SEMICHEAT);
|
|
|
|
|
cvar_t cl_beam_trace = CVAR("cl_beam_trace", "0");
|
|
|
|
|
cvar_t cl_legacystains = CVARD("cl_legacystains", "1", "WARNING: this cvar will default to 0 and later removed at some point"); //FIXME: do as the description says!
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
sfx_t **sfx;
|
|
|
|
@ -344,6 +343,7 @@ void CL_InitTEnts (void)
|
|
|
|
|
Cvar_Register (&cl_truelightning, "Temporary entity control");
|
|
|
|
|
Cvar_Register (&cl_beam_trace, "Temporary entity control");
|
|
|
|
|
Cvar_Register (&r_explosionlight, "Temporary entity control");
|
|
|
|
|
Cvar_Register (&cl_legacystains, "Temporary entity control");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CL_ShutdownTEnts (void)
|
|
|
|
@ -764,8 +764,7 @@ void CL_AddBeam (int tent, int ent, vec3_t start, vec3_t end) //fixme: use TE_ n
|
|
|
|
|
if (etype >= 0)
|
|
|
|
|
{
|
|
|
|
|
P_RunParticleEffectState (impact, normal, 1, etype, &(b->emitstate));
|
|
|
|
|
R_AddDecals(end);
|
|
|
|
|
R_AddStain(end, -10, -10, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(end, -10, -10, -10, 20);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void CL_ParseBeam (int tent)
|
|
|
|
@ -846,7 +845,7 @@ void CL_ParseStream (int type)
|
|
|
|
|
b->model = Mod_ForName("models/stice.mdl", true);
|
|
|
|
|
b->flags |= 2;
|
|
|
|
|
b->particleeffect = P_FindParticleType("te_stream_icechunks");
|
|
|
|
|
R_AddStain(end, -10, -10, 0, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(end, -10, -10, 0, 20);
|
|
|
|
|
break;
|
|
|
|
|
case TEH2_STREAM_SUNSTAFF1:
|
|
|
|
|
b->model = Mod_ForName("models/stsunsf1.mdl", true);
|
|
|
|
@ -865,7 +864,7 @@ void CL_ParseStream (int type)
|
|
|
|
|
case TEH2_STREAM_SUNSTAFF2:
|
|
|
|
|
b->model = Mod_ForName("models/stsunsf1.mdl", true);
|
|
|
|
|
b->particleeffect = P_FindParticleType("te_stream_sunstaff2");
|
|
|
|
|
R_AddStain(end, -10, -10, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(end, -10, -10, -10, 20);
|
|
|
|
|
break;
|
|
|
|
|
case TEH2_STREAM_COLORBEAM:
|
|
|
|
|
b->model = Mod_ForName("models/stclrbm.mdl", true);
|
|
|
|
@ -919,6 +918,21 @@ void CL_ParseTEnt (void)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nqprot)
|
|
|
|
|
{
|
|
|
|
|
//easiest way to handle these
|
|
|
|
|
switch(type)
|
|
|
|
|
{
|
|
|
|
|
case TENQ_EXPLOSION2:
|
|
|
|
|
type = TEQW_EXPLOSION2;
|
|
|
|
|
break;
|
|
|
|
|
case TENQ_BEAM:
|
|
|
|
|
type = TEQW_BEAM;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
switch (type)
|
|
|
|
|
{
|
|
|
|
|
case TE_WIZSPIKE: // spike hitting wall
|
|
|
|
@ -926,7 +940,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, 0, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, 0, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_wizspike))
|
|
|
|
|
P_RunParticleEffect (pos, vec3_origin, 20, 30);
|
|
|
|
@ -939,7 +953,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_knightspike))
|
|
|
|
|
P_RunParticleEffect (pos, vec3_origin, 226, 20);
|
|
|
|
@ -952,8 +966,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
R_AddDecals(pos);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, ptdp_spikequad))
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_spike))
|
|
|
|
@ -978,8 +991,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
R_AddDecals(pos);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_spike))
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 10, pt_gunshot))
|
|
|
|
@ -1003,8 +1015,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
R_AddDecals(pos);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, ptdp_superspikequad))
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_superspike))
|
|
|
|
@ -1030,8 +1041,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
R_AddDecals(pos);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_superspike))
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 2, pt_spike))
|
|
|
|
@ -1060,8 +1070,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
R_AddDecals(pos);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, ptfte_bullet))
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 10, pt_gunshot))
|
|
|
|
@ -1085,8 +1094,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
R_AddDecals(pos);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, ptfte_superbullet))
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 2, ptfte_bullet))
|
|
|
|
@ -1117,7 +1125,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
|
|
|
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
|
|
|
|
|
// light
|
|
|
|
|
if (r_explosionlight.value)
|
|
|
|
@ -1157,7 +1165,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
|
|
|
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
|
|
|
|
|
// light
|
|
|
|
|
if (r_explosionlight.value)
|
|
|
|
@ -1190,6 +1198,29 @@ void CL_ParseTEnt (void)
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case TEQW_EXPLOSION2:
|
|
|
|
|
{
|
|
|
|
|
int colorStart;
|
|
|
|
|
int colorLength;
|
|
|
|
|
pos[0] = MSG_ReadCoord ();
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
colorStart = MSG_ReadByte ();
|
|
|
|
|
colorLength = MSG_ReadByte ();
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
|
|
|
|
P_RunParticleEffect(pos, NULL, (colorStart + colorLength/2), 512);
|
|
|
|
|
if (r_explosionlight.value)
|
|
|
|
|
{
|
|
|
|
|
dl = CL_AllocDlight (0);
|
|
|
|
|
VectorCopy (pos, dl->origin);
|
|
|
|
|
dl->radius = 350;
|
|
|
|
|
dl->die = cl.time + 0.5;
|
|
|
|
|
dl->decay = 300;
|
|
|
|
|
}
|
|
|
|
|
S_StartSound (-2, 0, cl_sfx_r_exp3, pos, 1, 1, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case TEDP_EXPLOSIONRGB:
|
|
|
|
|
pos[0] = MSG_ReadCoord ();
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
@ -1197,7 +1228,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
|
|
|
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// light
|
|
|
|
@ -1228,7 +1259,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
|
|
|
|
P_RunParticleEffect(pos, NULL, 107, 1024); // should be 97-111
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
|
|
|
|
|
// light
|
|
|
|
|
if (r_explosionlight.value)
|
|
|
|
@ -1287,7 +1318,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, ptdp_gunshotquad))
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_gunshot))
|
|
|
|
@ -1303,7 +1334,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, cnt, pt_gunshot))
|
|
|
|
|
P_RunParticleEffect (pos, vec3_origin, 0, 20*cnt);
|
|
|
|
@ -1316,7 +1347,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, 0, -10, -10, 40);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, 0, -10, -10, 40);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, cnt, ptqw_blood))
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, cnt, ptdp_blood))
|
|
|
|
@ -1329,7 +1360,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
pos[1] = MSG_ReadCoord ();
|
|
|
|
|
pos[2] = MSG_ReadCoord ();
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, 1, -10, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, 1, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, ptqw_lightningblood))
|
|
|
|
|
P_RunParticleEffect (pos, vec3_origin, 225, 50);
|
|
|
|
@ -1485,7 +1516,7 @@ void CL_ParseTEnt (void)
|
|
|
|
|
dl->color[2] = 1.0;
|
|
|
|
|
|
|
|
|
|
// stain (Hopefully this is close to how DP does it)
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 30);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 30);
|
|
|
|
|
|
|
|
|
|
if (P_ParticleTrail(pos, pos2, P_FindParticleType("te_plasmaburn"), 0, NULL))
|
|
|
|
|
P_ParticleTrailIndex(pos, pos2, 15, 0, NULL);
|
|
|
|
@ -2200,7 +2231,7 @@ void CLQ2_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blood))
|
|
|
|
|
if (P_RunParticleEffectType(pos, dir, 1, ptqw_blood))
|
|
|
|
|
P_RunParticleEffect(pos, dir, 0xe8, 60);
|
|
|
|
|
R_AddStain(pos, 0, -10, -10, 40);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, 0, -10, -10, 40);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case Q2TE_GUNSHOT: // bullet hitting wall
|
|
|
|
@ -2213,7 +2244,7 @@ void CLQ2_ParseTEnt (void)
|
|
|
|
|
else
|
|
|
|
|
P_RunParticleEffect (pos, dir, 0xe0, 6);
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
|
|
|
|
|
if (type != Q2TE_SPARKS)
|
|
|
|
|
{
|
|
|
|
@ -2248,7 +2279,7 @@ void CLQ2_ParseTEnt (void)
|
|
|
|
|
MSG_ReadDir (dir);
|
|
|
|
|
P_RunParticleEffect (pos, dir, 0, 20);
|
|
|
|
|
CL_SmokeAndFlash(pos);
|
|
|
|
|
R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -10, -10, 20);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case Q2TE_SPLASH: // bullet hitting water
|
|
|
|
@ -2308,7 +2339,7 @@ void CLQ2_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blasterparticles))
|
|
|
|
|
P_RunParticleEffect (pos, dir, 0xe0, 40);
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, 0, -5, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, 0, -5, -10, 20);
|
|
|
|
|
|
|
|
|
|
ex = CL_AllocExplosion ();
|
|
|
|
|
VectorCopy (pos, ex->origin);
|
|
|
|
@ -2368,7 +2399,7 @@ void CLQ2_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
|
|
|
|
P_RunParticleEffect(pos, NULL, 0xe0, 256);
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
|
|
|
|
|
// light
|
|
|
|
|
if (r_explosionlight.value)
|
|
|
|
@ -2463,7 +2494,7 @@ void CLQ2_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, NULL, 1, pt_explosion))
|
|
|
|
|
P_RunParticleEffect(pos, NULL, 0xe0, 256);
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -1, -1, -1, 100);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// light
|
|
|
|
@ -2639,7 +2670,7 @@ void CLQ2_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blasterparticles))
|
|
|
|
|
P_RunParticleEffect (pos, dir, 0xd0, 40);
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, 0, -10, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, 0, -10, 20);
|
|
|
|
|
|
|
|
|
|
ex = CL_AllocExplosion ();
|
|
|
|
|
VectorCopy (pos, ex->origin);
|
|
|
|
@ -2689,7 +2720,7 @@ void CLQ2_ParseTEnt (void)
|
|
|
|
|
if (P_RunParticleEffectType(pos, dir, 1, ptq2_blasterparticles))
|
|
|
|
|
P_RunParticleEffect (pos, dir, 0x6f, 40);
|
|
|
|
|
|
|
|
|
|
R_AddStain(pos, -10, -2, 0, 20);
|
|
|
|
|
if (cl_legacystains.ival) R_AddStain(pos, -10, -2, 0, 20);
|
|
|
|
|
|
|
|
|
|
ex = CL_AllocExplosion ();
|
|
|
|
|
VectorCopy (pos, ex->origin);
|
|
|
|
|