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