]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/projectile.qc
Merge branch 'master' into Mario/monsters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / projectile.qc
1 .vector iorigin1, iorigin2;
2 .float spawntime;
3 .vector trail_oldorigin;
4 .float trail_oldtime;
5 .float fade_time, fade_rate;
6
7 void SUB_Stop()
8 {
9         self.move_velocity = self.move_avelocity = '0 0 0';
10         self.move_movetype = MOVETYPE_NONE;
11 }
12
13 .float alphamod;
14 .float count; // set if clientside projectile
15 .float cnt; // sound index
16 .float gravity;
17 .float snd_looping;
18 .float silent;
19
20 void Projectile_ResetTrail(vector to)
21 {
22         self.trail_oldorigin = to;
23         self.trail_oldtime = time;
24 }
25
26 void Projectile_DrawTrail(vector to)
27 {
28         vector from;
29         float t0;
30
31         from = self.trail_oldorigin;
32         t0 = self.trail_oldtime;
33         self.trail_oldorigin = to;
34         self.trail_oldtime = time;
35
36         // force the effect even for stationary firemine
37         if(self.cnt == PROJECTILE_FIREMINE)
38                 if(from == to)
39                         from_z += 1;
40
41         if (self.traileffect)
42         {
43                 particles_alphamin = particles_alphamax = particles_fade = sqrt(self.alpha);
44                 boxparticles(self.traileffect, self, from, to, self.velocity, self.velocity, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE | PARTICLES_DRAWASTRAIL);
45         }
46 }
47
48 void Projectile_Draw()
49 {
50         vector rot;
51         vector trailorigin;
52         float f;
53         float drawn;
54         float t;
55         float a;
56
57         f = self.move_flags;
58
59         if(self.count & 0x80)
60         {
61                 //self.move_flags &~= FL_ONGROUND;
62                 if(self.move_movetype == MOVETYPE_NONE || self.move_movetype == MOVETYPE_FLY)
63                         Movetype_Physics_NoMatchServer();
64                         // the trivial movetypes do not have to match the
65                         // server's ticrate as they are ticrate independent
66                         // NOTE: this assumption is only true if MOVETYPE_FLY
67                         // projectiles detonate on impact. If they continue
68                         // moving, we might still be ticrate dependent.
69                 else
70                         Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
71                 if(!(self.move_flags & FL_ONGROUND))
72                         if(self.velocity != '0 0 0')
73                                 self.move_angles = self.angles = vectoangles(self.velocity);
74         }
75         else
76         {
77                 InterpolateOrigin_Do();
78         }
79
80         if(self.count & 0x80)
81         {
82                 drawn = (time >= self.spawntime - 0.02);
83                 t = max(time, self.spawntime);
84         }
85         else
86         {
87                 drawn = (self.iflags & IFLAG_VALID);
88                 t = time;
89         }
90
91         if(!(f & FL_ONGROUND))
92         {
93                 rot = '0 0 0';
94                 switch(self.cnt)
95                 {
96                         /*
97                         case PROJECTILE_GRENADE:
98                                 rot = '-2000 0 0'; // forward
99                                 break;
100                         */
101                         case PROJECTILE_GRENADE_BOUNCING:
102                                 rot = '0 -1000 0'; // sideways
103                                 break;
104                         case PROJECTILE_NADE_RED_BURN:
105                         case PROJECTILE_NADE_RED:
106                         case PROJECTILE_NADE_BLUE_BURN:
107                         case PROJECTILE_NADE_BLUE:
108                         case PROJECTILE_NADE_YELLOW_BURN:
109                         case PROJECTILE_NADE_YELLOW:
110                         case PROJECTILE_NADE_PINK_BURN:
111                         case PROJECTILE_NADE_PINK:
112                         case PROJECTILE_NADE_BURN:
113                         case PROJECTILE_NADE:
114                                 rot = self.avelocity; 
115                                 break;
116                         case PROJECTILE_HOOKBOMB:
117                                 rot = '1000 0 0'; // forward
118                                 break;
119                         default:
120                                 break;
121                 }
122                 self.angles = AnglesTransform_ToAngles(AnglesTransform_Multiply(AnglesTransform_FromAngles(self.angles), rot * (t - self.spawntime)));
123         }
124
125         vector ang;
126         ang = self.angles;
127         ang_x = -ang_x;
128         makevectors(ang);
129
130         a = 1 - (time - self.fade_time) * self.fade_rate;
131         self.alpha = bound(0, self.alphamod * a, 1);
132         if(self.alpha <= 0)
133                 drawn = 0;
134         self.renderflags = 0;
135
136         trailorigin = self.origin;
137         switch(self.cnt)
138         {
139             case PROJECTILE_NADE_RED_BURN:
140                 case PROJECTILE_NADE_RED:
141                 case PROJECTILE_NADE_BLUE_BURN:
142                 case PROJECTILE_NADE_BLUE:
143                 case PROJECTILE_NADE_YELLOW_BURN:
144                 case PROJECTILE_NADE_YELLOW:
145                 case PROJECTILE_NADE_PINK_BURN:
146                 case PROJECTILE_NADE_PINK:
147                 case PROJECTILE_NADE_BURN:
148                 case PROJECTILE_NADE:
149                         trailorigin += v_up * 4;
150                         break;
151                 case PROJECTILE_GRENADE:
152                 case PROJECTILE_GRENADE_BOUNCING:
153                         trailorigin += v_right * 1 + v_forward * -10;
154                         break;
155                 default:
156                         break;
157         }
158         if(drawn)
159                 Projectile_DrawTrail(trailorigin);
160         else
161                 Projectile_ResetTrail(trailorigin);
162
163         self.drawmask = 0;
164
165         if(!drawn)
166                 return;
167
168         switch(self.cnt)
169         {
170                 case PROJECTILE_BULLET_GLOWING:
171                 case PROJECTILE_BULLET_GLOWING_TRACER:
172                         adddynamiclight(self.origin, 50 * a, '1 1 0');
173                         break;
174                 default:
175                         break;
176         }
177
178         self.drawmask = MASK_NORMAL;
179 }
180
181 void loopsound(entity e, float ch, string samp, float vol, float attn)
182 {
183         if(self.silent)
184                 return;
185
186         sound(e, ch, samp, vol, attn);
187         e.snd_looping = ch;
188 }
189
190 void Ent_RemoveProjectile()
191 {
192         if(self.count & 0x80)
193         {
194                 tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 0.05, MOVE_NORMAL, self);
195                 Projectile_DrawTrail(trace_endpos);
196         }
197 }
198
199 void Ent_Projectile()
200 {
201         float f;
202
203         // projectile properties:
204         //   kind (interpolated, or clientside)
205         //
206         //   modelindex
207         //   origin
208         //   scale
209         //   if clientside:
210         //     velocity
211         //     gravity
212         //   soundindex (hardcoded list)
213         //   effects
214         //
215         // projectiles don't send angles, because they always follow the velocity
216
217         f = ReadByte();
218         self.count = (f & 0x80);
219         self.iflags = (self.iflags & IFLAG_INTERNALMASK) | IFLAG_AUTOANGLES | IFLAG_ANGLES | IFLAG_ORIGIN;
220         self.solid = SOLID_TRIGGER;
221         //self.effects = EF_NOMODELFLAGS;
222
223         // this should make collisions with bmodels more exact, but it leads to
224         // projectiles no longer being able to lie on a bmodel
225         self.move_nomonsters = MOVE_WORLDONLY;
226         if(f & 0x40)
227                 self.move_flags |= FL_ONGROUND;
228         else
229                 self.move_flags &~= FL_ONGROUND;
230
231         if(!self.move_time)
232         {
233                 // for some unknown reason, we don't need to care for
234                 // sv_gameplayfix_delayprojectiles here.
235                 self.move_time = time;
236                 self.spawntime = time;
237         }
238         else
239                 self.move_time = max(self.move_time, time);
240
241         if(!(self.count & 0x80))
242                 InterpolateOrigin_Undo();
243
244         if(f & 1)
245         {
246                 self.origin_x = ReadCoord();
247                 self.origin_y = ReadCoord();
248                 self.origin_z = ReadCoord();
249                 setorigin(self, self.origin);
250                 if(self.count & 0x80)
251                 {
252                         self.velocity_x = ReadCoord();
253                         self.velocity_y = ReadCoord();
254                         self.velocity_z = ReadCoord();
255                         if(f & 0x10)
256                                 self.gravity = ReadCoord();
257                         else
258                                 self.gravity = 0; // none
259                         self.move_origin = self.origin;
260                         self.move_velocity = self.velocity;
261                 }
262
263                 if(time == self.spawntime || (self.count & 0x80) || (f & 0x08))
264                 {
265                         self.trail_oldorigin = self.origin;
266                         if(!(self.count & 0x80))
267                                 InterpolateOrigin_Reset();
268                 }
269
270                 if(f & 0x20)
271                 {
272                         self.fade_time = time + ReadByte() * ticrate;
273                         self.fade_rate = 1 / (ReadByte() * ticrate);
274                 }
275                 else
276                 {
277                         self.fade_time = 0;
278                         self.fade_rate = 0;
279                 }
280         }
281
282         if(f & 2)
283         {
284                 self.cnt = ReadByte();
285
286                 self.silent = (self.cnt & 0x80);
287                 self.cnt = (self.cnt & 0x7F);
288
289                 self.scale = 1;
290                 self.traileffect = 0;
291                 switch(self.cnt)
292                 {
293                         case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
294                         case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum("TR_ROCKET"); self.scale = 2; break;
295                         case PROJECTILE_BULLET: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_bullet"); break;
296                         case PROJECTILE_BULLET_GLOWING: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle_weak"); break;
297                         case PROJECTILE_BULLET_GLOWING_TRACER: setmodel(self, "models/tracer.mdl");self.traileffect = particleeffectnum("tr_rifle"); break;
298                         case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
299                         case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
300                         case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
301                         case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break;
302                         case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break;
303                         case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum("TR_GRENADE"); break;
304                         case PROJECTILE_LASER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(""); break;
305                         case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(""); break;
306                         case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_WIZSPIKE"); self.scale = 4; break;
307                         case PROJECTILE_PORTO_BLUE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_WIZSPIKE"); self.scale = 4; break;
308                         case PROJECTILE_HOOKBOMB: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum("TR_KNIGHTSPIKE"); break;
309                         case PROJECTILE_HAGAR: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("tr_hagar"); self.scale = 0.75; break;
310                         case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("tr_hagar"); self.scale = 0.75; break;
311                         case PROJECTILE_FIREBALL: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("fireball"); break; // particle effect is good enough
312                         case PROJECTILE_FIREMINE: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("firemine"); break; // particle effect is good enough
313                         case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum("TR_ROCKET"); break;
314                         case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_SEEKER"); break;
315                         case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.traileffect = particleeffectnum("TR_SEEKER"); break;
316                         
317                         case PROJECTILE_MAGE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum("TR_VORESPIKE"); break;
318
319                         case PROJECTILE_RAPTORBOMB:    setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break;
320                         case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3");     self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break;
321                         case PROJECTILE_RAPTORCANNON:  setmodel(self, "models/plasmatrail.mdl"); self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
322
323                         case PROJECTILE_SPIDERROCKET: setmodel(self, "models/vehicles/rocket02.md3"); self.traileffect = particleeffectnum("spiderbot_rocket_thrust"); break;
324                         case PROJECTILE_WAKIROCKET:   setmodel(self, "models/vehicles/rocket01.md3");  self.traileffect = particleeffectnum("wakizashi_rocket_thrust"); break;
325                         case PROJECTILE_WAKICANNON:   setmodel(self, "models/laser.mdl");  self.traileffect = particleeffectnum(""); break;
326
327                         case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
328                         case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
329                         
330                         case PROJECTILE_NADE_RED: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_red"); break;
331                         case PROJECTILE_NADE_RED_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_red_burn"); break;
332                         case PROJECTILE_NADE_BLUE: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_blue"); break;
333                         case PROJECTILE_NADE_BLUE_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_blue_burn"); break;
334                         case PROJECTILE_NADE_YELLOW: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_yellow"); break;
335                         case PROJECTILE_NADE_YELLOW_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_yellow_burn"); break;
336                         case PROJECTILE_NADE_PINK: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_pink"); break;
337                         case PROJECTILE_NADE_PINK_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_pink_burn"); break;
338                         case PROJECTILE_NADE: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade"); break;
339                         case PROJECTILE_NADE_BURN: setmodel(self, "models/weapons/v_ok_grenade.md3");self.traileffect = particleeffectnum("nade_burn"); break;
340
341                         default:
342                                 error("Received invalid CSQC projectile, can't work with this!");
343                                 break;
344                 }
345
346                 self.mins = '0 0 0';
347                 self.maxs = '0 0 0';
348                 self.colormod = '0 0 0';
349                 self.move_touch = SUB_Stop;
350                 self.move_movetype = MOVETYPE_TOSS;
351                 self.alphamod = 1;
352
353                 switch(self.cnt)
354                 {
355                         case PROJECTILE_ELECTRO:
356                                 // only new engines support sound moving with object
357                                 loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
358                                 self.mins = '0 0 -4';
359                                 self.maxs = '0 0 -4';
360                                 self.move_movetype = MOVETYPE_BOUNCE;
361                                 self.move_touch = func_null;
362                                 self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
363                                 self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
364                                 break;
365                         case PROJECTILE_ROCKET:
366                                 loopsound(self, CH_SHOTS_SINGLE, "weapons/rocket_fly.wav", VOL_BASE, ATTN_NORM);
367                                 self.mins = '-3 -3 -3';
368                                 self.maxs = '3 3 3';
369                                 break;
370                         case PROJECTILE_GRENADE:
371                                 self.mins = '-3 -3 -3';
372                                 self.maxs = '3 3 3';
373                                 break;
374                         case PROJECTILE_NADE_RED_BURN:
375                         case PROJECTILE_NADE_RED:
376                         case PROJECTILE_NADE_BLUE_BURN:
377                         case PROJECTILE_NADE_BLUE:
378                                 self.mins = '-3 -3 -3';
379                                 self.maxs = '3 3 3';
380                                 self.move_movetype = MOVETYPE_BOUNCE;
381                                 self.move_touch = func_null;
382                                 self.scale = 1.5;
383                                 self.avelocity = randomvec() * 720;
384                                 break;
385                         case PROJECTILE_GRENADE_BOUNCING:
386                                 self.mins = '-3 -3 -3';
387                                 self.maxs = '3 3 3';
388                                 self.move_movetype = MOVETYPE_BOUNCE;
389                                 self.move_touch = func_null;
390                                 self.move_bounce_factor = g_balance_grenadelauncher_bouncefactor;
391                                 self.move_bounce_stopspeed = g_balance_grenadelauncher_bouncestop;
392                                 break;
393                         case PROJECTILE_NADE_RED_BURN:
394                         case PROJECTILE_NADE_RED:
395                         case PROJECTILE_NADE_BLUE_BURN:
396                         case PROJECTILE_NADE_BLUE:
397                         case PROJECTILE_NADE_YELLOW_BURN:
398                         case PROJECTILE_NADE_YELLOW:
399                         case PROJECTILE_NADE_PINK_BURN:
400                         case PROJECTILE_NADE_PINK:
401                         case PROJECTILE_NADE_BURN:
402                         case PROJECTILE_NADE:
403                                 self.mins = '-16 -16 -16';
404                                 self.maxs = '16 16 16';
405                                 self.move_movetype = MOVETYPE_BOUNCE;
406                                 self.move_touch = func_null;
407                                 self.scale = 1.5;
408                                 self.avelocity = randomvec() * 720;
409                                 break;
410                         case PROJECTILE_MINE:
411                                 self.mins = '-4 -4 -4';
412                                 self.maxs = '4 4 4';
413                                 break;
414                         case PROJECTILE_PORTO_RED:
415                                 self.colormod = '2 1 1';
416                                 self.alphamod = 0.5;
417                                 self.move_movetype = MOVETYPE_BOUNCE;
418                                 self.move_touch = func_null;
419                                 break;
420                         case PROJECTILE_PORTO_BLUE:
421                                 self.colormod = '1 1 2';
422                                 self.alphamod = 0.5;
423                                 self.move_movetype = MOVETYPE_BOUNCE;
424                                 self.move_touch = func_null;
425                                 break;
426                         case PROJECTILE_HAGAR_BOUNCING:
427                                 self.move_movetype = MOVETYPE_BOUNCE;
428                                 self.move_touch = func_null;
429                                 break;
430                         case PROJECTILE_CRYLINK_BOUNCING:
431                                 self.move_movetype = MOVETYPE_BOUNCE;
432                                 self.move_touch = func_null;
433                                 break;
434                         case PROJECTILE_FIREBALL:
435                                 loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTN_NORM);
436                                 self.mins = '-16 -16 -16';
437                                 self.maxs = '16 16 16';
438                                 break;
439                         case PROJECTILE_FIREMINE:
440                                 loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTN_NORM);
441                                 self.move_movetype = MOVETYPE_BOUNCE;
442                                 self.move_touch = func_null;
443                                 self.mins = '-4 -4 -4';
444                                 self.maxs = '4 4 4';
445                                 break;
446                         case PROJECTILE_TAG:
447                                 self.mins = '-2 -2 -2';
448                                 self.maxs = '2 2 2';
449                                 break;
450                         case PROJECTILE_FLAC:
451                                 self.mins = '-2 -2 -2';
452                                 self.maxs = '2 2 2';
453                                 break;
454                         case PROJECTILE_SEEKER:
455                                 loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
456                                 self.mins = '-4 -4 -4';
457                                 self.maxs = '4 4 4';
458                                 break;
459             case PROJECTILE_RAPTORBOMB:
460                                 self.mins = '-3 -3 -3';
461                                 self.maxs = '3 3 3';
462                                 break;
463             case PROJECTILE_RAPTORBOMBLET:
464                                 break;
465             case PROJECTILE_RAPTORCANNON:
466                                 break;
467             case PROJECTILE_SPIDERROCKET:
468                 loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
469                                 break;
470             case PROJECTILE_WAKIROCKET:
471                 loopsound(self, CH_SHOTS_SINGLE, "weapons/tag_rocket_fly.wav", VOL_BASE, ATTN_NORM);
472                                 break;            
473             /*
474             case PROJECTILE_WAKICANNON:
475                                 break;
476                         case PROJECTILE_BUMBLE_GUN:
477                                 // only new engines support sound moving with object
478                                 loopsound(self, CH_SHOTS_SINGLE, "weapons/electro_fly.wav", VOL_BASE, ATTN_NORM);
479                                 self.mins = '0 0 -4';
480                                 self.maxs = '0 0 -4';
481                                 self.move_movetype = MOVETYPE_BOUNCE;
482                                 self.move_touch = func_null;
483                                 self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
484                                 self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
485                                 break;
486                         */
487                         default:
488                                 break;
489                 }
490                 setsize(self, self.mins, self.maxs);
491         }
492
493         if(self.gravity)
494         {
495                 if(self.move_movetype == MOVETYPE_FLY)
496                         self.move_movetype = MOVETYPE_TOSS;
497                 if(self.move_movetype == MOVETYPE_BOUNCEMISSILE)
498                         self.move_movetype = MOVETYPE_BOUNCE;
499         }
500         else
501         {
502                 if(self.move_movetype == MOVETYPE_TOSS)
503                         self.move_movetype = MOVETYPE_FLY;
504                 if(self.move_movetype == MOVETYPE_BOUNCE)
505                         self.move_movetype = MOVETYPE_BOUNCEMISSILE;
506         }
507
508         if(!(self.count & 0x80))
509                 InterpolateOrigin_Note();
510
511         self.draw = Projectile_Draw;
512         self.entremove = Ent_RemoveProjectile;
513 }
514
515 void Projectile_Precache()
516 {
517         precache_model("models/ebomb.mdl");
518         precache_model("models/elaser.mdl");
519         precache_model("models/grenademodel.md3");
520         precache_model("models/mine.md3");
521         precache_model("models/hagarmissile.mdl");
522         precache_model("models/hlac_bullet.md3");
523         precache_model("models/laser.mdl");
524         precache_model("models/plasmatrail.mdl");
525         precache_model("models/rocket.md3");
526         precache_model("models/tagrocket.md3");
527         precache_model("models/tracer.mdl");
528         
529         precache_model("models/weapons/v_ok_grenade.md3");
530
531         precache_sound("weapons/electro_fly.wav");
532         precache_sound("weapons/rocket_fly.wav");
533         precache_sound("weapons/fireball_fly.wav");
534         precache_sound("weapons/fireball_fly2.wav");
535         precache_sound("weapons/tag_rocket_fly.wav");
536
537 }