39 0,0,0,15,15,15,31,31,31,47,47,47,63,63,63,75,75,75,91,91,91,107,107,107,123,123,123,139,139,139,155,155,155,171,171,171,187,187,187,203,203,203,219,219,219,235,235,235,99,75,35,91,67,31,83,63,31,79,59,27,71,55,27,63,47,
40 23,59,43,23,51,39,19,47,35,19,43,31,19,39,27,15,35,23,15,27,19,11,23,15,11,19,15,7,15,11,7,95,95,111,91,91,103,91,83,95,87,79,91,83,75,83,79,71,75,71,63,67,63,59,59,59,55,55,51,47,47,47,43,43,39,
41 39,39,35,35,35,27,27,27,23,23,23,19,19,19,143,119,83,123,99,67,115,91,59,103,79,47,207,151,75,167,123,59,139,103,47,111,83,39,235,159,39,203,139,35,175,119,31,147,99,27,119,79,23,91,59,15,63,39,11,35,23,7,167,59,43,
42 159,47,35,151,43,27,139,39,19,127,31,15,115,23,11,103,23,7,87,19,0,75,15,0,67,15,0,59,15,0,51,11,0,43,11,0,35,11,0,27,7,0,19,7,0,123,95,75,115,87,67,107,83,63,103,79,59,95,71,55,87,67,51,83,63,
43 47,75,55,43,67,51,39,63,47,35,55,39,27,47,35,23,39,27,19,31,23,15,23,15,11,15,11,7,111,59,23,95,55,23,83,47,23,67,43,23,55,35,19,39,27,15,27,19,11,15,11,7,179,91,79,191,123,111,203,155,147,215,187,183,203,
44 215,223,179,199,211,159,183,195,135,167,183,115,151,167,91,135,155,71,119,139,47,103,127,23,83,111,19,75,103,15,67,91,11,63,83,7,55,75,7,47,63,7,39,51,0,31,43,0,23,31,0,15,19,0,7,11,0,0,0,139,87,87,131,79,79,
45 123,71,71,115,67,67,107,59,59,99,51,51,91,47,47,87,43,43,75,35,35,63,31,31,51,27,27,43,19,19,31,15,15,19,11,11,11,7,7,0,0,0,151,159,123,143,151,115,135,139,107,127,131,99,119,123,95,115,115,87,107,107,79,99,99,
46 71,91,91,67,79,79,59,67,67,51,55,55,43,47,47,35,35,35,27,23,23,19,15,15,11,159,75,63,147,67,55,139,59,47,127,55,39,119,47,35,107,43,27,99,35,23,87,31,19,79,27,15,67,23,11,55,19,11,43,15,7,31,11,7,23,
47 7,0,11,0,0,0,0,0,119,123,207,111,115,195,103,107,183,99,99,167,91,91,155,83,87,143,75,79,127,71,71,115,63,63,103,55,55,87,47,47,75,39,39,63,35,31,47,27,23,35,19,15,23,11,7,7,155,171,123,143,159,111,135,151,99,
48 123,139,87,115,131,75,103,119,67,95,111,59,87,103,51,75,91,39,63,79,27,55,67,19,47,59,11,35,47,7,27,35,0,19,23,0,11,15,0,0,255,0,35,231,15,63,211,27,83,187,39,95,167,47,95,143,51,95,123,51,255,255,255,255,255,
49 211,255,255,167,255,255,127,255,255,83,255,255,39,255,235,31,255,215,23,255,191,15,255,171,7,255,147,0,239,127,0,227,107,0,211,87,0,199,71,0,183,59,0,171,43,0,155,31,0,143,23,0,127,15,0,115,7,0,95,0,0,71,0,0,47,
50 0,0,27,0,0,239,0,0,55,55,255,255,0,0,0,0,255,43,43,35,27,27,23,19,19,15,235,151,127,195,115,83,159,87,51,123,63,27,235,211,199,199,171,155,167,139,119,135,107,87,159,91,83
110 yaw = (
int) (atan2(value1[1], value1[0]) * 180 /
M_PI);
111 forward =
sqrt (value1[0]*value1[0] + value1[1]*value1[1]);
117 angles[
PITCH] = -pitch;
119 angles[
ROLL] = - angleyaw;
204 for (k=0 ; k<
j ; k++)
261 memset (dl, 0,
sizeof(*dl));
274 memset (dl, 0,
sizeof(*dl));
281 memset (dl, 0,
sizeof(*dl));
297 memset (dl, 0,
sizeof(*dl));
304 memset (dl, 0,
sizeof(*dl));
386 dl->
radius = 100 + (rand()&31);
388 dl->
radius = 200 + (rand()&31);
413 Com_sprintf(soundname,
sizeof(soundname),
"weapons/machgf%ib.wav", (rand() % 5) + 1);
426 dl->
radius = 200 + (rand()&31);
428 Com_sprintf(soundname,
sizeof(soundname),
"weapons/machgf%ib.wav", (rand() % 5) + 1);
432 dl->
radius = 225 + (rand()&31);
435 Com_sprintf(soundname,
sizeof(soundname),
"weapons/machgf%ib.wav", (rand() % 5) + 1);
437 Com_sprintf(soundname,
sizeof(soundname),
"weapons/machgf%ib.wav", (rand() % 5) + 1);
441 dl->
radius = 250 + (rand()&31);
444 Com_sprintf(soundname,
sizeof(soundname),
"weapons/machgf%ib.wav", (rand() % 5) + 1);
446 Com_sprintf(soundname,
sizeof(soundname),
"weapons/machgf%ib.wav", (rand() % 5) + 1);
448 Com_sprintf(soundname,
sizeof(soundname),
"weapons/machgf%ib.wav", (rand() % 5) + 1);
452 dl->
color[0] = cl_railred->value/255;
453 dl->
color[1] = cl_railgreen->value/255;
454 dl->
color[2] = cl_railblue->value/255;
577 dl->
radius = 200 + (rand()&31);
581 switch (flash_number)
742 Com_sprintf(soundname,
sizeof(soundname),
"tank/tnkatk2%c.wav",
'a' + rand() % 5);
928 dl->
radius = 300 + (rand()&100);
979 float angle0,
float angle1,
float angle2,
980 float org0,
float org1,
float org2,
981 float vel0,
float vel1,
float vel2,
982 float accel0,
float accel1,
float accel2,
983 float color0,
float color1,
float color2,
984 float colorvel0,
float colorvel1,
float colorvel2,
985 float alpha,
float alphavel,
986 float size,
float sizevel,
1043 p->thinknext=thinknext;
1045 for (
j=0;
j<P_LIGHTS_MAX;
j++)
1047 cplight_t *plight = &p->lights[
j];
1048 plight->isactive =
false;
1050 plight->lightvel = 0;
1051 plight->lightcol[0] = 0;
1052 plight->lightcol[1] = 0;
1053 plight->lightcol[2] = 0;
1060 float light,
float lightvel,
1061 float lcol0,
float lcol1,
float lcol2)
1065 for (
i=0;
i<P_LIGHTS_MAX;
i++)
1067 cplight_t *plight = &p->lights[
i];
1068 if (!plight->isactive)
1070 plight->isactive =
true;
1071 plight->light = light;
1072 plight->lightvel = lightvel;
1073 plight->lightcol[0] = lcol0;
1074 plight->lightcol[1] = lcol1;
1075 plight->lightcol[2] = lcol2;
1111 float len, dec, frac;
1135 frac*0.5, -1.0 / (0.8+
frand()*0.2),
1155 angle[
YAW] = sin(angle[
YAW])*30;
1158 p->thinknext =
true;
1169 pos[0], pos[1], pos[2],
1172 color[0], color[1], color[2],
1174 .5, -1 / (0.8+
frand()*0.2),
1183 pos[0], pos[1], pos[2],
1186 color[0], color[1], color[2],
1188 .75, -1 / (0.8+
frand()*0.2),
1207 dir[0]*5, dir[1]*5, dir[2]*5,
1208 pos[0], pos[1], pos[2],
1209 dir[0]*10*size, dir[1]*10*size, dir[2]*10*size,
1211 color[0], color[1], color[2],
1213 .5, -2.0 / (0.8+
frand()*0.2),
1226 float len, dec, length, frac;
1244 move[0], move[1], move[2],
1249 1, -2.0 / (0.8+
frand()*0.2),
1257 move[0], move[1], move[2],
1262 1, -2.0 / (0.8+
frand()*0.2),
1283 float len, dec, length, frac;
1300 move[0], move[1], move[2],
1303 40 + 215*frac, 100, 255 - 215*frac,
1305 1, -2.0 / (0.8+
frand()*0.2),
1319 float len, dec, size2 = size * size;
1325 dec = (20.0*size2+1);
1334 move[0], move[1], move[2],
1339 1, -1.0 / (0.8+
frand()*0.2),
1340 1 + 20.0*size2, 5 + 50.0 * size2,
1382 dec = (20.0*size+1);
1391 move[0] +
crand()*3*size, move[1] +
crand()*3*size, move[2] +
crand()*3*size,
1396 1, -2.0 / (0.8+
frand()*0.2),
1397 5 + size*5, 175.0 * size,
1405 0.5+
random()*0.5, 0.5, 0.1);
1429 start[0], start[1], start[2],
1434 1, -2.0 / (0.8+
frand()*0.2),
1443 0.5+
random()*0.5, 0.5, 0.1);
1464 dir[0], dir[1], dir[2],
1465 origin[0], origin[1], origin[2],
1473 PART_DIRECTION|PART_TRANS,
1481 for (
i=0;
i<times;
i++)
1484 origin[0], origin[1], origin[2],
1506 dir[0], dir[1], dir[2],
1507 origin[0], origin[1], origin[2],
1524 origin[0], origin[1], origin[2],
1549 if (list->src_ent == srcEnt && list->dst_ent == dstEnt && list->image ==
particle_lightning)
1560 start[0], start[1], start[2],
1561 end[0], end[1], end[2],
1585 if (list->src_ent == srcEnt && list->dst_ent == dstEnt && list->image ==
particle_lightflare)
1595 start[0], start[1], start[2],
1632 else if (*
alpha>.25)
1644 p->thinknext =
true;
1647 #define EXPLODESTAININTESITY 75
1668 org[0], org[1], org[2],
1673 1, (0.5+
random()*0.5) * (rocket)? -2 : -1.5,
1674 (size!=0)?size:(150-(!rocket)?75:0), 0,
1676 PART_DEPTHHACK_SHORT,
1681 float lightsize = (large)? 1.0 : 0.75;
1721 else if (*
alpha>.33333)
1731 p->thinknext =
true;
1736 float alphastart = 1,
1746 org[0], org[1], org[2],
1751 alphastart, alphadecel,
1754 PART_DEPTHHACK_SHORT,
1826 time2 = time1*time1;
1829 angle[
i] = 0.2*(p->
vel[
i]*time1 + (p->
accel[
i])*time2);
1834 if (length>*size*10.0)
1835 length = *size*10.0;
1845 switch ((
int)p->temp)
1856 p->flags = PART_SHADED|PART_ANGLED;
1862 p->sizevel = 10 + 10*
random();
1881 p->thinknext =
true;
1893 flags = PART_SHADED|PART_DIRECTION|PART_GRAVITY;
1900 flags = PART_TRANS|PART_SHADED|PART_DIRECTION|PART_GRAVITY;
1906 org[0], org[1], org[2],
1907 vec[0], vec[1], vec[2],
1909 color[0], color[1], color[2],
1911 1.0, -1 / (1 + time),
1930 #define MAXBLEEDSIZE 5
1944 time2 = time1*time1;
1947 angle[
i] = 0.2*(p->
vel[
i]*time1 + (p->
accel[
i])*time2);
1971 p->thinknext =
true;
1978 org[0], org[1], org[2],
1983 1.0, -0.5 / (0.5 +
frand()*0.3),
1986 PART_TRANS|PART_SHADED,
1993 org[0], org[1], org[2],
1994 org[0] + ((rand()&7)-4) + dir[0], org[1] + ((rand()&7)-4) + dir[1], org[2] + ((rand()&7)-4) + dir[2],
1999 1.0, -0.25 / (0.5 +
frand()*0.3),
2002 PART_TRANS|PART_SHADED|PART_DIRECTION|PART_GRAVITY,
2013 switch ((
int)(cl_blood->value))
2054 org[0] + ((rand()&7)-4) + d*dir[0], org[1] + ((rand()&7)-4) + d*dir[1], org[2] + ((rand()&7)-4) + d*dir[2],
2057 color[0], color[1], color[2],
2059 1.0, -1.0 / (0.5 +
frand()*0.3),
2075 #define SplashSize 7.5
2091 time2 = time1*time1;
2094 angle[
i] = 0.5*(p->
vel[
i]*time1 + (p->
accel[
i])*time2);
2098 p->thinknext =
true;
2111 org[0], org[1], org[2],
2112 org[0]+d*dir[0], org[1]+d*dir[1], org[2]+d*dir[2],
2113 dir[0]*40 +
crand()*10, dir[1]*40 +
crand()*10, dir[2]*40 +
crand()*10,
2115 color[0], color[1], color[2],
2117 1, -1.0 / (0.5 +
frand()*0.3),
2120 PART_GRAVITY|PART_DIRECTION ,
2142 org[0]+((rand()&7)-4)+d*dir[0], org[1]+((rand()&7)-4)+d*dir[1], org[2]+((rand()&7)-4)+d*dir[2],
2147 1, -1.0 / (0.5 +
frand()*0.3),
2175 org[0]+((rand()&7)-4)+d*dir[0], org[1]+((rand()&7)-4)+d*dir[1], org[2]+((rand()&7)-4)+d*dir[2],
2180 1, -1.0 / (0.5 +
frand()*0.3),
2203 time2 = time1*time1;
2206 angle[
i] = 0.75*(p->
vel[
i]*time1 + (p->
accel[
i])*time2);
2210 p->thinknext =
true;
2222 org[0]+((rand()&3)-2), org[1]+((rand()&3)-2), org[2]+((rand()&3)-2),
2225 20+dir[0]*75,20+dir[1]*75,20+dir[2]*75,
2227 color[0], color[1], color[2],
2229 0.75, -1.5 / (0.5 +
frand()*0.3),
2232 PART_GRAVITY|PART_DIRECTION,
2245 float alpha = DIV254BY255;
2248 angle[0], angle[1], angle[2],
2249 org[0], org[1], org[2],
2252 color[0], color[1], color[2],
2257 PART_TRANS|PART_ANGLED|PART_SHADED,
2277 ang[0], ang[1], ang[2],
2278 org[0]+dir[0], org[1]+dir[1], org[2]+dir[2],
2286 PART_TRANS|PART_ANGLED|PART_SHADED,
2299 for (
i=0 ;
i<8 ;
i++)
2303 ent->
origin[0]-16+(rand()&31), ent->
origin[1]-16+(rand()&31), ent->
origin[2]-16+(rand()&31),
2306 200+rand()*50, 200+rand()*50, 200+rand()*50,
2328 for (
i=0 ;
i<500 ;
i++)
2351 org[0] - 16 +
frand()*32, org[1] - 16 +
frand()*32, org[2] - 24 +
frand()*56,
2354 color[0], color[1], color[2],
2356 1, -1.0 / (1.0 +
frand()*0.3),
2375 for (
i=0 ;
i<64 ;
i++)
2382 0, 150+rand()*25, 0,
2384 1, -1.0 / (1.0 +
frand()*0.3),
2408 time2 = time1*time1;
2411 angle[
i] = 0.25*(p->
vel[
i]*time1 + (p->
accel[
i])*time2);
2416 p->thinknext =
true;
2453 for (
i=0 ;
i<256 ;
i++)
2465 p->
color[2] = rand() & 7;
2466 for (
j=0 ;
j<3 ;
j++)
2468 p->
org[
j] = org[
j] + ((rand()%32)-16);
2469 p->
vel[
j] = (rand()%384)-192;
2488 static int colortable0[4] = {10,50,150,50};
2489 static int colortable1[4] = {150,150,50,10};
2490 static int colortable2[4] = {50,10,10,150};
2492 for (
i=0 ;
i<4096 ;
i++)
2496 angle =
M_PI*2*(rand()&1023)/1023.0;
2500 org[0]+cos(angle)*dist, org[1] + sin(angle)*dist,org[2] + 8 + (rand()%90),
2501 cos(angle)*(70+(rand()&63)),sin(angle)*(70+(rand()&63)),-100 + (rand()&31),
2503 colortable0[index], colortable1[index], colortable2[index],
2505 1, -0.3 / (0.5 +
frand()*0.3),
2506 1, 0.3 / (0.5 +
frand()*0.3),
2521 #define pBlasterMaxSize 5
2531 p->thinknext =
true;
2544 org[0], org[1], org[2],
2545 org[0]+((rand()&5)-2)+d*dir[0], org[1]+((rand()&5)-2)+d*dir[1], org[2]+((rand()&5)-2)+d*dir[2],
2546 (dir[0]*75 +
crand()*20)*speed, (dir[1]*75 +
crand()*20)*speed, (dir[2]*75 +
crand()*20)*speed,
2550 1, -1.0 / (0.5 +
frand()*0.3),
2590 1, -1.0 / (0.5 +
frand()*0.3),
2631 1, -1.0 / (0.8+
frand()*0.2),
2670 (isred)?255:0, 0, (!isred)?255:0,
2672 1, -1.0 / (0.8+
frand()*0.2),
2731 move[0], move[1], move[2],
2739 PART_TRANS|PART_SHADED,
2751 move[0] +
crand()*orgscale, move[1] +
crand()*orgscale, move[2] +
crand()*orgscale,
2756 0.75, -0.75 / (1+
frand()*0.4),
2759 PART_TRANS|PART_GRAVITY|PART_SHADED,
2766 move[0] +
crand()*orgscale, move[1] +
crand()*orgscale, move[2] +
crand()*orgscale,
2771 0, -1.0 / (1+
frand()*0.4),
2774 PART_GRAVITY|PART_SHADED,
2781 move[0] +
crand()*orgscale, move[1] +
crand()*orgscale, move[2] +
crand()*orgscale,
2789 PART_TRANS|PART_SHADED,
2829 float len, totallen;
2853 move[0],move[1],move[2],
2854 vec[0], vec[1], vec[2],
2859 2.0*(2-len/totallen), -15,
2865 if ( (rand()&7) == 0)
2874 1, -2.0 / (1+
frand()*0.2),
2890 #define RAILSPACE 1.0
2922 move[0] + dir[0]*3, move[1] + dir[1]*3, move[2] + dir[2]*3,
2923 dir[0]*6, dir[1]*6, dir[2]*6,
2925 cl_railred->value, cl_railgreen->value, cl_railblue->value,
2952 time2 = time1*time1;
2955 angle[
i] = 3*(p->
vel[
i]*time1 + (p->
accel[
i])*time2);
2959 p->thinknext =
true;
2961 #define DEVRAILSTEPS 2
2990 last[0], last[1], last[2],
2991 move[0], move[1], move[2],
2994 cl_railred->value, cl_railgreen->value, cl_railblue->value,
3005 move[0], move[1], move[2],
3008 cl_railred->value, cl_railgreen->value, cl_railblue->value,
3010 1, -0.75 / (0.5 +
frand()*0.3),
3013 PART_GRAVITY|PART_DIRECTION,
3018 move[0], move[1], move[2],
3026 PART_TRANS|PART_GRAVITY,
3031 #define RAILTRAILSPACE 15
3039 qboolean colored = (cl_railtype->value!=1);
3051 if (cl_railtype->value == 3)
3062 if (cl_railtype->value == 2)
3068 last[0], last[1], last[2],
3069 move[0], move[1], move[2],
3072 cl_railred->value, cl_railgreen->value, cl_railblue->value,
3087 move[0], move[1], move[2],
3090 (colored)?cl_railred->value:255, (colored)?cl_railgreen->value:255, (colored)?cl_railblue->value:255,
3100 if (cl_railtype->value == 1)
3139 last[0], last[1], last[2],
3140 move[0]+aim[0]*overlap, move[1]+aim[1]*overlap, move[2]+aim[2]*overlap,
3145 0.5, -1.0 / (0.3 +
frand() * 0.2),
3154 start[0], start[1], start[2],
3159 0.5, -1.0 / (0.3 +
frand() * 0.2),
3188 for (
i=0 ;
i<len ;
i+=dec)
3198 0.75, -1.0 / (1 +
frand() * 0.2),
3201 PART_TRANS|PART_SHADED,
3215 #define BEAMLENGTH 16
3220 float sr, sp, sy, cr, cp, cy;
3236 ltime = (float)
cl.
time / 1000.0;
3253 dist = sin(ltime +
i)*64;
3289 count = n * 162 / 20000.0;
3294 count = n * 162 / 20000.0;
3316 #define BEAMLENGTH 16
3322 float sr, sp, sy, cr, cp, cy;
3324 float dist = 64, dist2;
3335 ltime = (float)
cl.
time / 1000.0;
3353 dist = sin(ltime +
i)*64;
3423 colors[index][0], colors[index][1], colors[index][2],
3425 1, -1.0 / (0.3+
frand()*0.2),
3446 for (
i=-2 ;
i<=2 ;
i+=4)
3447 for (
j=-2 ;
j<=2 ;
j+=4)
3448 for (k=-2 ; k<=4 ; k+=4)
3456 vel = 50 + (rand()&63);
3462 org[0] +
i + ((rand()&23) *
crand()), org[1] +
j + ((rand()&23) *
crand()), org[2] + k + ((rand()&23) *
crand()),
3463 dir[0]*vel, dir[1]*vel, dir[2]*vel,
3465 colors[index][0], colors[index][1], colors[index][2],
3467 1, -1.0 / (0.3+
frand()*0.2),
3487 for (
i=0 ;
i<256 ;
i++)
3491 org[0] + ((rand()%32)-16), org[1] + ((rand()%32)-16), org[2] + ((rand()%32)-16),
3492 (rand()%150)-75, (rand()%150)-75, (rand()%150)-75,
3494 200, 100+rand()*50, 0,
3496 1, -0.8 / (0.5 +
frand()*0.3),
3517 float vel, resize = 1;
3522 for (
i=-16 ;
i<=16 ;
i+=4)
3523 for (
j=-16 ;
j<=16 ;
j+=4)
3524 for (k=min ; k<=max ; k+=4)
3535 org[0]+ (
i+(rand()&3))*resize, org[1]+(
j+(rand()&3))*resize, org[2]+(k+(rand()&3))*resize,
3536 dir[0]*vel, dir[1]*vel, dir[2]*(25 + vel),
3540 1, -0.75 / (0.3 + (rand()&7) * 0.02),
3541 (
random()*.25+.75)*size*resize, 0,
3580 p->thinknext =
true;
3587 pos[0], pos[1], pos[2],
3590 color[0], color[1], color[2],
3608 float alpha, size, light;
3609 float time=0, time2;
3610 vec3_t org, color, angle;
3628 time = (p->
time - p->start)*0.001;
3661 if (color[
i]>255) color[
i]=255;
3662 if (color[
i]<0) color[
i]=0;
3664 angle[
i] = p->angle[
i];
3668 if (p->flags&PART_GRAVITY)
3671 size = p->size + p->sizevel*time;
3673 for (
i=0;
i<P_LIGHTS_MAX;
i++)
3675 const cplight_t *plight = &p->lights[
i];
3676 if (plight->isactive)
3678 light = plight->light*
alpha + plight->lightvel*time;
3679 V_AddLight (org, light, plight->lightcol[0], plight->lightcol[1], plight->lightcol[2]);
3683 if (p->thinknext && p->think)
3686 p->think(p, org, angle, &
alpha, &size, &image, &time);