]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/client/vehicles/vehicles.qc
Begin csqc vehicles framework (not functional or used yet). Add some comments. Spawn...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / vehicles / vehicles.qc
1 #define spider_rocket_icon "gfx/vehicles/rocket_ico.tga"
2 #define spider_rocket_targ "gfx/vehicles/target.tga"
3 //#define SPIDER_CROSS "textures/spiderbot/cross.tga"
4 #define SPIDER_CROSS "gfx/vehicles/sbot-xhair.tga"
5 #define SPIDER_CROSS2 "gfx/vehicles/sbot-xhair2.tga"
6
7 #define axh1 "gfx/vehicles/sbot-xhair2.tga"
8 #define axh2 "gfx/vehicles/sbot-xhair2.tga"
9 #define axh3 "gfx/vehicles/sbot-xhair2.tga"
10
11 #define spider_h "gfx/vehicles/hud_bg.tga"
12 #define spider_b "gfx/vehicles/sbot.tga"
13 #define spider_r "gfx/vehicles/sbot_rpods.tga"
14 #define spider_g "gfx/vehicles/sbot_mguns.tga"
15 #define spider_s "gfx/vehicles/shiled.tga"
16 #define spider_a1 "gfx/vehicles/sb_rocket.tga"
17 #define spider_a2 "gfx/vehicles/sb_bullets.tga"
18
19 #define raptor_h  "gfx/vehicles/hud_bg.tga"
20 #define raptor_s  "gfx/vehicles/shiled.tga"
21
22 #define raptor_b  "gfx/vehicles/raptor.tga"
23 #define raptor_g1 "gfx/vehicles/raptor_guns.tga"
24 #define raptor_g2 "gfx/vehicles/raptor_bombs.tga"
25 #define raptor_d  "gfx/vehicles/dropcross.tga"
26 #define raptor_c  "gfx/vehicles/raptor_cross.tga"
27
28 entity dropmark;
29
30 void CSQC_WAKIZASHI_HUD();
31 void CSQC_SPIDER_HUD();
32 void CSQC_RAPTOR_HUD();
33
34 #define MAX_AXH 4
35 entity AuxiliaryXhair[MAX_AXH];
36 const var void Draw_Not();
37
38 .string axh_image;
39 .float  axh_fadetime;
40 .float  axh_drawflag;
41 .float  axh_scale;
42
43 void AuxiliaryXhair_Draw2D()
44 {
45     vector loc, psize;
46
47     psize = self.axh_scale * drawgetimagesize(self.axh_image);
48     loc = project_3d_to_2d(self.origin) - 0.5 * psize;
49     if not (loc_z < 0 || loc_x < 0 || loc_y < 0 || loc_x > vid_conwidth || loc_y > vid_conheight)
50     {
51         loc_z = 0;
52         psize_z = 0;
53         drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag);
54     }
55
56     if(time - self.cnt > self.axh_fadetime)
57         self.draw2d = Draw_Not;
58 }
59
60 void Net_Vehicle(float IsNew)
61 {
62     //entnum
63 }
64
65 void Net_AuXair2(float bIsNew)
66 {
67     float axh_id;
68     entity axh;
69
70     axh_id = bound(0, ReadByte(), MAX_AXH);
71     axh = AuxiliaryXhair[axh_id];
72
73     if(axh == world || wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
74     {
75         axh               = spawn();
76                 axh.draw2d        = Draw_Not;
77                 axh.drawmask      = MASK_NORMAL;
78                 axh.axh_drawflag  = DRAWFLAG_ADDITIVE;
79                 axh.axh_fadetime  = 0.1;
80                 axh.axh_image     = "gfx/vehicles/axh-ring.tga";
81                 axh.axh_scale     = 1;
82         axh.alpha         = 1;
83                 AuxiliaryXhair[axh_id] = axh;
84     }
85
86     axh.draw2d   = AuxiliaryXhair_Draw2D;
87
88         axh.origin_x = ReadCoord();
89         axh.origin_y = ReadCoord();
90         axh.origin_z = ReadCoord();
91
92         axh.colormod_x = ReadByte() / 255;
93         axh.colormod_y = ReadByte() / 255;
94         axh.colormod_z = ReadByte() / 255;
95     axh.cnt = time;
96 }
97
98
99
100 void VehicleRacerDraw()
101 {
102     //Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
103     Movetype_Physics_NoMatchServer();
104     self.drawmask = MASK_NORMAL;    
105 }
106
107 void VehicleRacerRemove()
108 {
109 }
110
111 void Net_VehicleRacer(float bIsNew)
112 {
113     if(bIsNew)
114     {
115         setmodel(self, "models/vehicles/wakizashi.dpm");
116         self.move_movetype = MOVETYPE_BOUNCE;        
117         self.entremove = VehicleRacerRemove;
118         setsize(self,  '-60 -60 -20', '60 60 20');        
119         self.draw = VehicleRacerDraw;
120         self.scale = 0.5;
121     }
122     
123     self.cnt = ReadByte();
124     
125     self.origin_x = ReadCoord();
126     self.origin_y = ReadCoord();
127     self.origin_z = ReadCoord();
128     
129     self.velocity_x = ReadCoord();
130     self.velocity_y = ReadCoord();
131     self.velocity_z = ReadCoord();
132
133     self.angles_x = ReadAngle();
134     self.angles_y = ReadAngle();
135     self.angles_z = ReadAngle();
136
137     self.move_origin    = self.origin;
138     self.move_velocity  = self.velocity;
139     self.move_angles    = self.angles;
140     
141     setorigin(self, self.origin);
142 }
143
144
145
146 void Net_VehicleSetup()
147 {
148
149     float hud_id, i;
150     hud_id = bound(HUD_SPIDERBOT, ReadByte(), HUD_RAPTOR);
151
152     // Init auxiliary crosshairs
153 //#if 1
154     entity axh;
155     for(i = 0; i < MAX_AXH; ++i)
156     {
157         axh = AuxiliaryXhair[i];
158         if(axh != world && !wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
159             remove(axh);
160
161         axh               = spawn();
162                 axh.draw2d        = Draw_Not;
163                 axh.drawmask      = MASK_NORMAL;
164                 axh.axh_drawflag  = DRAWFLAG_ADDITIVE;
165                 axh.axh_fadetime  = 0.1;
166                 axh.axh_image     = "gfx/vehicles/axh-ring.tga";
167                 axh.axh_scale     = 1;
168         axh.alpha         = 1;
169                 AuxiliaryXhair[i] = axh;
170     }
171 /*
172 #else
173     for(i = 0; i < MAX_AXH; ++i)
174     {
175         if(AuxiliaryXhair[i] != world && !wasfreed(AuxiliaryXhair[i]))
176             remove(AuxiliaryXhair[i]);
177
178         AuxiliaryXhair[i]               = spawn();
179                 AuxiliaryXhair[i].draw2d        = Draw_Not;
180                 AuxiliaryXhair[i].drawmask      = MASK_NORMAL;
181                 AuxiliaryXhair[i].axh_drawflag  = DRAWFLAG_ADDITIVE;
182                 AuxiliaryXhair[i].axh_fadetime  = 0.1;
183                 AuxiliaryXhair[i].axh_image     = "gfx/vehicles/axh-ring.tga";
184                 AuxiliaryXhair[i].axh_scale     = 1;
185                 AuxiliaryXhair[i].alpha         = 1;
186     }
187 #endif
188 */
189     switch(hud_id)
190     {
191         case HUD_SPIDERBOT:
192             // Minigun1
193             AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-ring.tga";
194             AuxiliaryXhair[0].axh_scale   = 0.25;
195             // Minigun2
196             AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-ring.tga";
197             AuxiliaryXhair[1].axh_scale   = 0.25;
198             // Rocket
199             AuxiliaryXhair[2].axh_image   = "gfx/vehicles/axh-special1.tga";
200             AuxiliaryXhair[2].axh_scale   = 0.5;
201             break;
202         case HUD_WAKIZASHI:
203             AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-bracket.tga";
204             AuxiliaryXhair[0].axh_scale   = 0.25;
205             break;
206         case HUD_RAPTOR:
207             AuxiliaryXhair[0].axh_image   = "gfx/vehicles/axh-cross.tga";
208             AuxiliaryXhair[0].axh_scale   = 0.5;
209             AuxiliaryXhair[0].alpha       = 0.25;
210
211             AuxiliaryXhair[1].axh_image   = "gfx/vehicles/axh-bracket.tga";
212             AuxiliaryXhair[1].axh_scale   = 0.25;
213             AuxiliaryXhair[1].alpha       = 0.75;
214             AuxiliaryXhair[1].axh_drawflag  = DRAWFLAG_NORMAL;
215
216             break;
217     }
218 }
219
220 void CSQC_SPIDER_HUD()
221 {
222         float rockets, reload, heat, hp, shield;
223         vector picsize, hudloc;
224
225     // Fetch health & ammo stats
226     hp      = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
227         shield  = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
228         heat    = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 2);
229         rockets =     getstati(STAT_VEHICLESTAT_AMMO2);
230         reload  = min(getstatf(STAT_VEHICLESTAT_RELOAD2), 1);
231
232
233     hudloc_y = 4;
234     hudloc_x = 4;
235     drawfill('130 28 0', ('115 0 0' * hp) + '0 10 0', hp * '0 1 0' + (1 - hp) * '1 0 0', 0.5, DRAWFLAG_NORMAL);
236     picsize = drawgetimagesize(spider_h) * 0.5;
237     drawpic(hudloc, spider_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
238
239     picsize = drawgetimagesize(spider_a2) * 0.5;
240     drawpic(hudloc + '120 96  0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
241
242     drawstring(hudloc + '145 19  0', strcat(ftos(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
243     drawstring(hudloc + '175 34  0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
244     drawstring(hudloc + '136 102  0', strcat(ftos(100 - rint(heat * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
245
246     picsize = drawgetimagesize(spider_a1) * 0.85;
247     if(rockets == 9)
248     {
249         drawpic(hudloc + '132 54  0', spider_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
250         drawstring(hudloc + '179 69 0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
251     }
252     else
253     {
254         drawpic(hudloc + '132 54  0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
255         drawstring(hudloc + '179 69  0', strcat(ftos(9 - rockets), "/8"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
256     }
257
258     picsize = drawgetimagesize(spider_b) * 0.5;
259     hudloc_y = 10.5;
260     hudloc_x = 10.5;
261
262     drawpic(hudloc, spider_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
263     drawpic(hudloc, spider_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL);
264     drawpic(hudloc, spider_r, picsize, '1 1 1' * reload + '1 0 0' * (1 - reload), 1, DRAWFLAG_NORMAL);
265     drawpic(hudloc, spider_g, picsize, '1 1 1' * (1 - heat) + '1 0 0' *  heat, 1, DRAWFLAG_NORMAL);
266
267
268         if (scoreboard_showscores)
269         {
270                 HUD_DrawScoreboard();
271                 HUD_DrawCenterPrint();
272     }
273     else
274     {
275         picsize = drawgetimagesize(SPIDER_CROSS);
276         picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
277         picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
278
279         drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE);
280     }
281 }
282
283
284 void CSQC_RAPTOR_HUD()
285 {
286         if(autocvar_r_letterbox)
287         return;
288
289         float reload, hp, shield, energy;
290         vector picsize, hudloc, vel;
291         float movedt;
292     vector where;
293
294     // Fetch health & ammo stats
295     hp      = bound(0,getstatf(STAT_VEHICLESTAT_HEALTH), 1);
296         shield  = bound(0,getstatf(STAT_VEHICLESTAT_SHIELD), 1);
297         reload  = min(getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
298         energy  = min(getstatf(STAT_VEHICLESTAT_ENERGY),  1);
299
300     // Draw the crosshairs
301     picsize = drawgetimagesize("gfx/vehicles/axh-cross.tga");
302     picsize_x *= 0.75;
303     picsize_y *= 0.75;
304     drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), "gfx/vehicles/axh-cross.tga", picsize, '1 0 0' + '0 1 1' * energy, 0.5, DRAWFLAG_ADDITIVE);
305
306     hudloc_y = 4;
307     hudloc_x = 4;
308
309     picsize = drawgetimagesize(raptor_h) * 0.5;
310     drawpic(hudloc, raptor_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
311
312     picsize = drawgetimagesize(spider_a2) * 0.5;
313     drawpic(hudloc + '120 96  0', spider_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
314
315     drawstring(hudloc + '145 19  0', strcat(ftos(rint(hp * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
316     drawstring(hudloc + '175 34  0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
317     drawstring(hudloc + '136 102 0', strcat(ftos(rint(energy * 100)), "%"),'15 15 0','0.5 0.5 1', 1, DRAWFLAG_NORMAL);
318
319
320     picsize = drawgetimagesize(spider_a1) * 0.85;
321     if(reload == 1)
322     {
323         drawpic(hudloc + '132 54  0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
324         drawstring(hudloc + '179 69  0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 1 0', 0.5, DRAWFLAG_NORMAL);
325     }
326     else
327     {
328         drawpic(hudloc + '132 54  0', spider_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
329         drawstring(hudloc + '179 69  0', strcat(ftos(rint(reload * 100)), "%"),'14 14 0','0 0 1', 1, DRAWFLAG_NORMAL);
330     }
331
332     picsize = drawgetimagesize(raptor_b) * 0.5;
333     hudloc_y = 10.5;
334     hudloc_x = 10.5;
335
336     drawpic(hudloc, raptor_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
337     drawpic(hudloc, raptor_b, picsize, '0 1 0' * hp + '1 0 0' * (1 - hp), 1, DRAWFLAG_NORMAL);
338     drawpic(hudloc, raptor_g1, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL);
339     drawpic(hudloc, raptor_g2, picsize, '1 1 1' * reload + '1 0 0' *  (1 - reload), 1, DRAWFLAG_NORMAL);
340
341     if(!dropmark)
342     {
343         dropmark = spawn();
344         dropmark.owner = self;
345         dropmark.gravity = 1;
346     }
347
348     if(reload == 1)
349     {
350         where = dropmark.origin;
351         setorigin(dropmark, pmove_org);
352         dropmark.velocity = pmove_vel;
353         tracetoss(dropmark, self);
354
355         where = project_3d_to_2d(trace_endpos);
356
357         setorigin(dropmark, trace_endpos);
358         picsize = drawgetimagesize(raptor_d) * 0.2;
359
360         if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
361         {
362             where_x -= picsize_x * 0.5;
363             where_y -= picsize_y * 0.5;
364             where_z = 0;
365             drawpic(where, raptor_d, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE);
366         }
367         dropmark.cnt = time + 5;
368     }
369     else
370     {
371         if(dropmark.cnt > time)
372         {
373             where = project_3d_to_2d(dropmark.origin);
374             picsize = drawgetimagesize(raptor_d) * 0.25;
375
376             if not (where_z < 0 || where_x < 0 || where_y < 0 || where_x > vid_conwidth || where_y > vid_conheight)
377             {
378                 where_x -= picsize_x * 0.5;
379                 where_y -= picsize_y * 0.5;
380                 where_z = 0;
381                 drawpic(where, raptor_d, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE);
382             }
383         }
384     }
385
386         if (scoreboard_showscores)
387         {
388                 HUD_DrawScoreboard();
389                 HUD_DrawCenterPrint();
390         }
391
392 }
393
394 #define waki_h "gfx/vehicles/hud_bg.tga"
395 #define waki_b "gfx/vehicles/waki.tga"
396 #define waki_e "gfx/vehicles/waki_e.tga"
397 #define waki_g "gfx/vehicles/waki_guns.tga"
398 #define waki_r "gfx/vehicles/waki_rockets.tga"
399 #define waki_s "gfx/vehicles/shiled.tga"
400
401 #define waki_a1 "gfx/vehicles/sb_rocket.tga"
402 #define waki_a2 "gfx/vehicles/sb_cells.tga"
403
404 void CSQC_WAKIZASHI_HUD()
405 {
406         // 0--1 floats. 1 = 100%, 0.6 = 50%.
407         float health, shield, energy, rockets;
408         vector picsize, hudloc;
409
410     picsize = drawgetimagesize(SPIDER_CROSS);
411     picsize_x *= autocvar_cl_vehicle_spiderbot_cross_size;
412     picsize_y *= autocvar_cl_vehicle_spiderbot_cross_size;
413     drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), SPIDER_CROSS, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_NORMAL);
414
415     health  = min(getstatf(STAT_VEHICLESTAT_HEALTH),  1);
416         shield  = min(getstatf(STAT_VEHICLESTAT_SHIELD),  1);
417         energy  = min(getstatf(STAT_VEHICLESTAT_ENERGY),  1);
418         rockets = bound(0,getstatf(STAT_VEHICLESTAT_RELOAD1), 1);
419
420     hudloc_y =  4;
421     hudloc_x = 4;
422
423     picsize = drawgetimagesize(waki_h) * 0.5;
424     drawpic(hudloc, waki_h, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
425
426     picsize = drawgetimagesize(waki_a2) * 0.7;
427     drawpic(hudloc + '116 92  0', waki_a2, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
428
429
430     drawstring(hudloc + '145 19  0', strcat(ftos(rint(health * 100)), "%"),'15 15 0','0 1 0', 1, DRAWFLAG_NORMAL);
431     drawstring(hudloc + '175 34  0', strcat(ftos(rint(shield * 100)), "%"),'15 15 0','0 0 1', 1, DRAWFLAG_NORMAL);
432
433     drawstring(hudloc + '136 102  0', strcat(ftos(rint(energy * 100)), "%"),'14 14 0','1 1 1', 1, DRAWFLAG_NORMAL);
434
435     picsize = drawgetimagesize(waki_a1) * 0.75;
436     if(rockets == 1)
437     {
438         drawpic(hudloc + '140 55  0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
439         drawpic(hudloc + '144 59  0', waki_a1, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
440     }
441     else
442     {
443         drawpic(hudloc + '140 55  0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
444         drawpic(hudloc + '144 59  0', waki_a1, picsize, '-1 -1 -1', 1, DRAWFLAG_NORMAL);
445         drawstring(hudloc + '165 69 0', strcat(ftos(rint(rockets * 100)), "%"),'14 14 0','1 1 0', 1, DRAWFLAG_NORMAL);
446     }
447
448     picsize = drawgetimagesize(waki_b) * 0.5;
449     hudloc_y = 10.5;
450     hudloc_x = 10.5;
451
452     drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL);
453     drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL);
454     drawpic(hudloc, waki_r, picsize, '1 1 1' * rockets + '1 0 0' * (1 - rockets), 1, DRAWFLAG_NORMAL);
455     drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' *  (1 - energy), 1, DRAWFLAG_NORMAL);
456
457         if (scoreboard_showscores)
458         {
459                 HUD_DrawScoreboard();
460                 HUD_DrawCenterPrint();
461         }
462
463 }
464
465 void Vehicles_Precache()
466 {
467         precache_model("models/vehicles/bomblet.md3");
468         precache_model("models/vehicles/clusterbomb.md3");
469         precache_model("models/vehicles/clusterbomb_fragment.md3");
470         precache_model("models/vehicles/rocket01.md3");
471         precache_model("models/vehicles/rocket02.md3");
472 }
473
474
475 void RaptorCBShellfragDraw()
476 {
477         Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
478         if(wasfreed(self))
479                 return;
480
481         self.move_avelocity += randomvec() * 15;
482         self.renderflags = 0;
483         if(self.cnt < time)
484         self.alpha = bound(0, self.nextthink - time, 1);
485
486         if(self.alpha < ALPHA_MIN_VISIBLE)
487         remove(self);
488
489 }
490 void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
491 {
492     entity sfrag;
493     
494     sfrag = spawn();
495     setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3");
496     setorigin(sfrag, _org);
497     
498         sfrag.move_movetype = MOVETYPE_BOUNCE;
499         sfrag.gravity = 0.15;
500         sfrag.solid = SOLID_CORPSE;
501
502         sfrag.draw = RaptorCBShellfragDraw;
503
504         sfrag.move_origin = sfrag.origin = _org;
505         sfrag.move_velocity = _vel;
506         sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
507         sfrag.angles = self.move_angles = _ang;
508         
509         sfrag.move_time = time;
510         sfrag.damageforcescale = 4;
511
512         sfrag.nextthink = time + 3;
513         sfrag.cnt = time + 2;
514     sfrag.drawmask = MASK_NORMAL;
515     
516     
517 }
518