]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/w_seeker.qc
Merge remote branch 'origin/master' into samual/balance
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_seeker.qc
1 #ifdef REGISTER_WEAPON
2 REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "seeker", "seeker", _("T.A.G. Seeker"))
3 #else
4 #ifdef SVQC
5 //.float proxytime; = autoswitch
6 //.float tl; = wait
7 .entity tag_target, wps_tag_tracker;
8 .float tag_time;
9
10 // ============================
11 // Begin: Missile functions, these are general functions to be manipulated by other code
12 // ============================
13 void Seeker_Missile_Explode ()
14 {
15         self.event_damage = SUB_Null;
16         RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_missile_damage, autocvar_g_balance_seeker_missile_edgedamage, autocvar_g_balance_seeker_missile_radius, world, autocvar_g_balance_seeker_missile_force, self.projectiledeathtype, other);
17
18         remove (self);
19 }
20
21 void Seeker_Missile_Touch()
22 {
23         PROJECTILE_TOUCH;
24
25         Seeker_Missile_Explode();
26 }
27
28 void Seeker_Missile_Think()
29 {
30         entity e;
31         vector desireddir, olddir, newdir, eorg;
32         float turnrate;
33         float dist;
34         float spd;
35
36         if (time > self.cnt)
37         {
38                 self.projectiledeathtype |= HITTYPE_SPLASH;
39                 Seeker_Missile_Explode();
40         }
41
42         spd = vlen(self.velocity);
43         spd = bound(
44                 spd - autocvar_g_balance_seeker_missile_decel * frametime,
45                 autocvar_g_balance_seeker_missile_speed_max,
46                 spd + autocvar_g_balance_seeker_missile_accel * frametime
47         );
48
49         if (self.enemy != world)
50                 if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
51                         self.enemy = world;
52
53         if (self.enemy != world)
54         {
55                 e               = self.enemy;
56                 eorg            = 0.5 * (e.absmin + e.absmax);
57                 turnrate        = autocvar_g_balance_seeker_missile_turnrate; // how fast to turn
58                 desireddir      = normalize(eorg - self.origin);
59                 olddir          = normalize(self.velocity); // get my current direction
60                 dist            = vlen(eorg - self.origin);
61
62                 // Do evasive maneuvers for world objects? ( this should be a cpu hog. :P )
63                 if (autocvar_g_balance_seeker_missile_smart && (dist > autocvar_g_balance_seeker_missile_smart_mindist))
64                 {
65                         // Is it a better idea (shorter distance) to trace to the target itself?
66                         if ( vlen(self.origin + olddir * self.wait) < dist)
67                                 traceline(self.origin, self.origin + olddir * self.wait, FALSE, self);
68                         else
69                                 traceline(self.origin, eorg, FALSE, self);
70
71                         // Setup adaptive tracelength
72                         self.wait = bound(autocvar_g_balance_seeker_missile_smart_trace_min, vlen(self.origin - trace_endpos), self.wait = autocvar_g_balance_seeker_missile_smart_trace_max);
73
74                         // Calc how important it is that we turn and add this to the desierd (enemy) dir.
75                         desireddir  = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
76                 }
77                 
78                 newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
79                 self.velocity = newdir * spd; // make me fly in the new direction at my flight speed
80         }
81
82         // Proxy
83         if (autocvar_g_balance_seeker_missile_proxy)
84         {
85                 if ( dist <= autocvar_g_balance_seeker_missile_proxy_maxrange)
86                 {
87                         if (self.autoswitch == 0)
88                         {
89                                 self.autoswitch = time + autocvar_g_balance_seeker_missile_proxy_delay;
90                         }
91                         else
92                         {
93                                 if (self.autoswitch <= time)
94                                 {
95                                         Seeker_Missile_Explode();
96                                         self.autoswitch = 0;
97                                 }
98                         }
99                 }
100                 else
101                 {
102                         if (self.autoswitch != 0)
103                                 self.autoswitch = 0;
104                 }
105         }
106         ///////////////
107
108         if (self.enemy.deadflag != DEAD_NO)
109         {
110                 self.enemy = world;
111                 self.cnt = time + 1 + (random() * 4);
112                 self.nextthink = self.cnt;
113                 return;
114         }
115
116         //self.angles = vectoangles(self.velocity);                     // turn model in the new flight direction
117         self.nextthink = time;// + 0.05; // csqc projectiles
118         UpdateCSQCProjectile(self);
119 }
120
121
122
123 void Seeker_Missile_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
124 {
125         if (self.health <= 0)
126                 return;
127
128         if (self.realowner == attacker)
129                 self.health = self.health - (damage * 0.25);
130         else
131                 self.health = self.health - damage;
132                 
133         if (self.health <= 0)
134                 W_PrepareExplosionByDamage(attacker, Seeker_Missile_Explode);
135 }
136
137 /*
138 void Seeker_Missile_Animate()
139 {
140         self.frame = self.frame +1;
141         self.nextthink = time + 0.05;
142
143         if (self.enemy != world)
144                 if (self.enemy.takedamage != DAMAGE_AIM || self.enemy.deadflag != DEAD_NO)
145                         self.enemy = world;
146
147         if(self.frame == 5)
148         {
149                 self.think           = Seeker_Missile_Think;
150                 self.nextthink       = time;// + cvar("g_balance_seeker_missile_activate_delay"); // cant dealy with csqc projectiles
151
152                 if (autocvar_g_balance_seeker_missile_proxy)
153                         self.movetype    = MOVETYPE_BOUNCEMISSILE;
154                 else
155                         self.movetype    = MOVETYPE_FLYMISSILE;
156         }
157
158         UpdateCSQCProjectile(self);
159 }
160 */
161
162 void Seeker_Fire_Missile(vector f_diff, entity m_target)
163 {
164         local entity missile;
165
166         W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_reload_ammo);
167
168         makevectors(self.v_angle);
169         W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/seeker_fire.wav", CH_WEAPON_A, 0);
170         w_shotorg += f_diff;
171         pointparticles(particleeffectnum("seeker_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
172
173         //self.detornator         = FALSE;
174
175         missile                 = spawn();
176         missile.owner           = missile.realowner = self;
177         missile.classname       = "seeker_missile";
178         missile.bot_dodge       = TRUE;
179         missile.bot_dodgerating = autocvar_g_balance_seeker_missile_damage;
180
181         missile.think           = Seeker_Missile_Think;
182         missile.touch           = Seeker_Missile_Touch;
183         missile.event_damage    = Seeker_Missile_Damage;
184         missile.nextthink       = time;// + 0.2;// + cvar("g_balance_seeker_missile_activate_delay");
185         missile.cnt             = time + autocvar_g_balance_seeker_missile_lifetime;
186         missile.enemy           = m_target;
187         missile.solid           = SOLID_BBOX;
188         missile.scale           = 2;
189         missile.takedamage      = DAMAGE_YES;
190         missile.health          = autocvar_g_balance_seeker_missile_health;
191         missile.damageforcescale = autocvar_g_balance_seeker_missile_damageforcescale;
192         missile.damagedbycontents = TRUE;
193         //missile.think           = Seeker_Missile_Animate; // csqc projectiles.
194         
195         if (missile.enemy != world)
196                 missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
197         else 
198                 missile.projectiledeathtype = WEP_SEEKER;
199
200
201         setorigin (missile, w_shotorg);
202         setsize (missile, '-4 -4 -4', '4 4 4');
203         missile.movetype    = MOVETYPE_FLYMISSILE;
204         missile.flags       = FL_PROJECTILE;
205         W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_missile);
206
207         missile.angles = vectoangles (missile.velocity);
208
209         CSQCProjectile(missile, FALSE, PROJECTILE_SEEKER, TRUE);
210
211         other = missile; MUTATOR_CALLHOOK(EditProjectile);
212 }
213
214 // ============================
215 // Begin: FLAC, close range attack meant for defeating rockets which are coming at you. 
216 // ============================
217 void Seeker_Flac_Explode ()
218 {
219         self.event_damage = SUB_Null;
220
221         RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_flac_damage, autocvar_g_balance_seeker_flac_edgedamage, autocvar_g_balance_seeker_flac_radius, world, autocvar_g_balance_seeker_flac_force, self.projectiledeathtype, other);
222
223         remove (self);
224 }
225
226 void Seeker_Flac_Touch()
227 {
228         PROJECTILE_TOUCH;
229
230         Seeker_Flac_Explode();
231 }
232
233 void Seeker_Fire_Flac()
234 {
235         local entity missile;
236         vector f_diff;
237         float c;
238
239         W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_flac_ammo, autocvar_g_balance_seeker_reload_ammo);
240
241         c = mod(self.bulletcounter, 4);
242         switch(c)
243         {
244                 case 0:
245                         f_diff = '-1.25 -3.75 0';
246                         break;
247                 case 1:
248                         f_diff = '+1.25 -3.75 0';
249                         break;
250                 case 2:
251                         f_diff = '-1.25 +3.75 0';
252                         break;
253                 case 3:
254                 default:
255                         f_diff = '+1.25 +3.75 0';
256                         break;
257         }
258         W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/flac_fire.wav", CH_WEAPON_A, autocvar_g_balance_seeker_flac_damage);
259         w_shotorg += f_diff;
260
261         pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
262
263         missile                                 = spawn ();
264         missile.owner                   = missile.realowner = self;
265         missile.classname               = "missile";
266         missile.bot_dodge               = TRUE;
267         missile.bot_dodgerating = autocvar_g_balance_seeker_flac_damage;
268         missile.touch                   = Seeker_Flac_Explode;
269         missile.use                     = Seeker_Flac_Explode; 
270         missile.think                   = adaptor_think2use_hittype_splash;
271         missile.nextthink               = time + autocvar_g_balance_seeker_flac_lifetime + autocvar_g_balance_seeker_flac_lifetime_rand;
272         missile.solid                   = SOLID_BBOX;
273         missile.movetype                = MOVETYPE_FLY; 
274         missile.projectiledeathtype = WEP_SEEKER;
275         missile.projectiledeathtype = WEP_SEEKER | HITTYPE_SECONDARY;
276         missile.flags                           = FL_PROJECTILE;
277         
278         // csqc projectiles
279         //missile.angles                                = vectoangles (missile.velocity);       
280         //missile.scale = 0.4; // BUG: the model is too big 
281         
282         setorigin (missile, w_shotorg);
283         setsize (missile, '-2 -2 -2', '2 2 2');
284                 
285         W_SETUPPROJECTILEVELOCITY_UP(missile, g_balance_seeker_flac);
286         CSQCProjectile(missile, TRUE, PROJECTILE_FLAC, TRUE);
287
288         other = missile; MUTATOR_CALLHOOK(EditProjectile);
289 }
290
291 // ============================
292 // Begin: Tag and rocket controllers 
293 // ============================
294 entity Seeker_Tagged_Info(entity isowner, entity istarget)
295 {
296         entity tag;
297         for(tag = world; (tag = find(tag, classname, "tag_tracker")); ) 
298                 if ((tag.realowner == isowner) && (tag.tag_target == istarget))
299                         return tag;
300                 
301         return world;
302 }
303
304 void Seeker_Attack()
305 {
306         entity tracker, closest_target;
307         
308         for(tracker = world; (tracker = find(tracker, classname, "tag_tracker")); ) if (tracker.realowner == self)
309         {
310                 if (closest_target)
311                 {
312                         if (vlen(self.origin - tracker.tag_target.origin) < vlen(self.origin - closest_target.origin))
313                                 closest_target = tracker.tag_target;
314                 }
315                 else 
316                         closest_target = tracker.tag_target;
317         }
318                 
319         traceline(self.origin + self.view_ofs, closest_target.origin, MOVE_NOMONSTERS, self);
320         if ((!closest_target) || ((trace_fraction < 1) && (trace_ent != closest_target)))
321                 closest_target = world;
322         
323         Seeker_Fire_Missile('0 0 0', closest_target);
324 }
325
326 void Seeker_Vollycontroller_Think() // TODO: Merge this with Seeker_Attack
327 {
328         float c;
329         entity oldself,oldenemy;
330         self.cnt = self.cnt - 1;
331
332         if((!(self.realowner.items & IT_UNLIMITED_AMMO) && self.realowner.ammo_rockets < autocvar_g_balance_seeker_missile_ammo) || (self.cnt <= -1) || (self.realowner.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER))
333         {
334                 remove(self);
335                 return;
336         }
337
338         self.nextthink = time + autocvar_g_balance_seeker_missile_delay * W_WeaponRateFactor();
339         
340         oldself = self;
341         self = self.realowner;
342         
343         oldenemy = self.enemy;
344         self.enemy = oldself.enemy;
345         
346         c = mod(self.cnt, 4);
347         switch(c)
348         {
349                 case 0:
350                         Seeker_Fire_Missile('-1.25 -3.75 0', self.enemy);
351                         break;
352                 case 1:
353                         Seeker_Fire_Missile('+1.25 -3.75 0', self.enemy);
354                         break;
355                 case 2:
356                         Seeker_Fire_Missile('-1.25 +3.75 0', self.enemy);
357                         break;
358                 case 3:
359                 default:
360                         Seeker_Fire_Missile('+1.25 +3.75 0', self.enemy);
361                         break;
362         }
363
364         self.enemy = oldenemy;
365         self = oldself;
366 }
367
368 void Seeker_Tracker_Think() 
369 {
370         // commit suicide if: You die OR target dies OR you switch away from the seeker OR commit suicide if lifetime is up
371         if ((self.realowner.deadflag != DEAD_NO) || (self.tag_target.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER)
372         || (time > self.tag_time + autocvar_g_balance_seeker_tag_tracker_lifetime))
373         {
374                 if (self)
375                 {
376                         WaypointSprite_Kill(self.tag_target.wps_tag_tracker);
377                         remove(self);
378                 }
379                 return;
380         }
381         
382         // Update the think method information
383         self.nextthink = time;
384 }
385
386 // ============================
387 // Begin: Tag projectile 
388 // ============================
389 void Seeker_Tag_Explode ()
390 {
391         //if(other==self.realowner)
392         //    return;
393         Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_BOUNCE, self);
394
395         remove (self);
396 }
397
398 void Seeker_Tag_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
399 {
400         if (self.health <= 0)
401                 return;
402         self.health = self.health - damage;
403         if (self.health <= 0)
404                 Seeker_Tag_Explode();
405 }
406
407 void Seeker_Tag_Touch()
408 {
409         vector dir;
410         vector org2;
411         entity e;
412         
413         PROJECTILE_TOUCH;
414
415         dir     = normalize (self.realowner.origin - self.origin);
416         org2    = findbetterlocation (self.origin, 8);
417
418         te_knightspike(org2);
419
420         self.event_damage = SUB_Null;
421         Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_HEADSHOT, self);
422
423         if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
424         {
425                 // check to see if this person is already tagged by me
426                 entity tag = Seeker_Tagged_Info(self.realowner, other);
427                 
428                 if (tag != world)
429                 {
430                         if (other.wps_tag_tracker && (autocvar_g_balance_seeker_type == 1)) // don't attach another waypointsprite without killing the old one first
431                                 WaypointSprite_Kill(other.wps_tag_tracker);
432                                 
433                         tag.tag_time = time;
434                 }
435                 else
436                 {               
437                         //sprint(self.realowner, strcat("You just tagged ^2", other.netname, "^7 with a tracking device!\n"));
438                         e             = spawn();
439                         e.cnt         = autocvar_g_balance_seeker_missile_count;
440                         e.classname   = "tag_tracker";
441                         e.owner       = self.owner;
442                         e.realowner   = self.realowner;
443                         
444                         if      (autocvar_g_balance_seeker_type == 1)
445                         {
446                                 e.tag_target  = other;
447                                 e.tag_time    = time;
448                                 e.think       = Seeker_Tracker_Think;
449                         }
450                         else 
451                         {
452                                 e.enemy     = other;
453                                 e.think     = Seeker_Vollycontroller_Think;
454                         }
455                         
456                         e.nextthink   = time;
457                 }
458                 
459                 if      (autocvar_g_balance_seeker_type == 1)
460                 {
461                         WaypointSprite_Spawn("tagged-target", autocvar_g_balance_seeker_tag_tracker_lifetime, 0, other, '0 0 64', self.realowner, 0, other, wps_tag_tracker, TRUE, RADARICON_TAGGED, '0.5 1 0');
462                         WaypointSprite_UpdateRule(other.wps_tag_tracker, 0, SPRITERULE_DEFAULT);
463                 }
464         }
465
466         remove(self);
467         return;
468 }
469
470 void Seeker_Fire_Tag()
471 {
472         local entity missile;
473         W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_seeker_tag_ammo, autocvar_g_balance_seeker_reload_ammo);
474
475         W_SetupShot_ProjectileSize (self, '-2 -2 -2', '2 2 2', FALSE, 2, "weapons/tag_fire.wav", CH_WEAPON_A, autocvar_g_balance_seeker_missile_damage * autocvar_g_balance_seeker_missile_count);
476
477         missile                 = spawn();
478         missile.owner           = missile.realowner = self;
479         missile.classname       = "seeker_tag";
480         missile.bot_dodge       = TRUE;
481         missile.bot_dodgerating = 50;
482         missile.touch           = Seeker_Tag_Touch;
483         missile.think           = SUB_Remove;
484         missile.nextthink       = time + autocvar_g_balance_seeker_tag_lifetime;
485         missile.movetype        = MOVETYPE_FLY;
486         missile.solid           = SOLID_BBOX;
487
488         missile.takedamage       = DAMAGE_YES;
489         missile.event_damage    = Seeker_Tag_Explode;
490         missile.health          = autocvar_g_balance_seeker_tag_health;
491         missile.damageforcescale = autocvar_g_balance_seeker_tag_damageforcescale;
492
493         setorigin (missile, w_shotorg);
494         setsize (missile, '-2 -2 -2', '2 2 2');
495
496         missile.flags       = FL_PROJECTILE;
497
498         missile.movetype    = MOVETYPE_FLY;
499         W_SETUPPROJECTILEVELOCITY(missile, g_balance_seeker_tag);
500         missile.angles = vectoangles (missile.velocity);
501
502         CSQCProjectile(missile, TRUE, PROJECTILE_TAG, FALSE); // has sound
503
504         other = missile; MUTATOR_CALLHOOK(EditProjectile);
505 }
506
507 // ============================
508 // Begin: Genereal weapon functions
509 // ============================
510 void spawnfunc_weapon_seeker (void)
511 {
512         weapon_defaultspawnfunc(WEP_SEEKER);
513 }
514
515 float w_seeker(float req)
516 {
517         float ammo_amount;
518
519         if (req == WR_AIM)
520         {
521                 if (autocvar_g_balance_seeker_type == 1) 
522                         if (Seeker_Tagged_Info(self, self.enemy) != world)
523                                 self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_missile_speed_max, 0, autocvar_g_balance_seeker_missile_lifetime, FALSE);
524                         else
525                                 self.BUTTON_ATCK2 = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, autocvar_g_balance_seeker_tag_lifetime, FALSE);
526                 else
527                         self.BUTTON_ATCK = bot_aim(autocvar_g_balance_seeker_tag_speed, 0, autocvar_g_balance_seeker_tag_lifetime, FALSE);
528         }
529         else if (req == WR_THINK)
530         {
531                 if(autocvar_g_balance_seeker_reload_ammo && self.clip_load < min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo)) // forced reload
532                         weapon_action(self.weapon, WR_RELOAD);
533                         
534                 else if (self.BUTTON_ATCK)
535                 {
536                         if (autocvar_g_balance_seeker_type == 1) 
537                         {
538                                 if (weapon_prepareattack(0, autocvar_g_balance_seeker_missile_refire))
539                                 {
540                                         Seeker_Attack();
541                                         weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_missile_animtime, w_ready);
542                                 }
543                         }
544                         else 
545                         {
546                                 if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
547                                 {
548                                         Seeker_Fire_Tag();
549                                         weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_tag_animtime, w_ready);
550                                 }
551                         }
552                 }
553
554                 else if (self.BUTTON_ATCK2)
555                 {
556                         if (autocvar_g_balance_seeker_type == 1) 
557                         {
558                                 if (weapon_prepareattack(0, autocvar_g_balance_seeker_tag_refire))
559                                 {
560                                         Seeker_Fire_Tag();
561                                         weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_tag_animtime, w_ready);
562                                 }
563                         }
564                         else 
565                         {
566                                 if (weapon_prepareattack(0, autocvar_g_balance_seeker_flac_refire))
567                                 {
568                                         Seeker_Fire_Flac();
569                                         weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_seeker_flac_animtime, w_ready);
570                                 }
571                         }
572                 }
573         }
574         else if (req == WR_PRECACHE)
575         {
576                 precache_model ("models/weapons/g_seeker.md3");
577                 precache_model ("models/weapons/v_seeker.md3");
578                 precache_model ("models/weapons/h_seeker.iqm");
579                 precache_sound ("weapons/tag_fire.wav");
580                 precache_sound ("weapons/flac_fire.wav");
581                 precache_sound ("weapons/seeker_fire.wav");
582                 //precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound somewhere else
583         }
584         else if (req == WR_SETUP)
585         {
586                 weapon_setup(WEP_SEEKER);
587                 self.current_ammo = ammo_rockets;
588         }
589         else if (req == WR_CHECKAMMO1)
590         {
591                 ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_missile_ammo;
592                 ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_missile_ammo;
593                 return ammo_amount;
594         }
595         else if (req == WR_CHECKAMMO2)
596         {
597                 ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo;
598                 ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_tag_ammo;
599                 return ammo_amount;
600         }
601         else if (req == WR_RELOAD)
602         {
603                 W_Reload(min(autocvar_g_balance_seeker_missile_ammo, autocvar_g_balance_seeker_tag_ammo), autocvar_g_balance_seeker_reload_ammo, autocvar_g_balance_seeker_reload_time, "weapons/reload.wav");
604         }
605         return TRUE;
606 };
607 #endif
608 #ifdef CSQC
609 float w_seeker(float req)
610 {
611         if(req == WR_IMPACTEFFECT)
612         {
613                 vector org2;
614                 org2 = w_org + w_backoff * 6;
615                 if(w_deathtype & HITTYPE_BOUNCE)
616                 {
617                         pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
618                         if(!w_issilent)
619                         {
620                                 if (w_random<0.15)
621                                         sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTN_NORM);
622                                 else if (w_random<0.7)
623                                         sound(self, CH_SHOTS, "weapons/tagexp2.wav", 1, ATTN_NORM);
624                                 else
625                                         sound(self, CH_SHOTS, "weapons/tagexp3.wav", 1, ATTN_NORM);
626                         }
627                 }
628                 else if(w_deathtype & HITTYPE_HEADSHOT)
629                 {
630                         if(!w_issilent)
631                                 sound(self, CH_SHOTS, "weapons/tag_impact.wav", 1, ATTN_NORM);
632                 }
633                 else
634                 {
635                         pointparticles(particleeffectnum("hagar_explode"), org2, '0 0 0', 1);
636                         if(!w_issilent)
637                         {
638                                 if (w_random<0.15)
639                                         sound(self, CH_SHOTS, "weapons/seekerexp1.wav", 1, ATTN_NORM);
640                                 else if (w_random<0.7)
641                                         sound(self, CH_SHOTS, "weapons/seekerexp2.wav", 1, ATTN_NORM);
642                                 else
643                                         sound(self, CH_SHOTS, "weapons/seekerexp3.wav", 1, ATTN_NORM);
644                         }
645                 }
646         }
647         else if(req == WR_PRECACHE)
648         {
649                 precache_sound("weapons/seekerexp1.wav");
650                 precache_sound("weapons/seekerexp2.wav");
651                 precache_sound("weapons/seekerexp3.wav");
652                 precache_sound("weapons/tagexp1.wav");
653                 precache_sound("weapons/tagexp2.wav");
654                 precache_sound("weapons/tagexp3.wav");
655                 precache_sound("weapons/tag_impact.wav");
656         }
657         else if (req == WR_SUICIDEMESSAGE)
658                 w_deathtypestring = _("%s played with tiny rockets");
659         else if (req == WR_KILLMESSAGE)
660         {
661                 if(w_deathtype & HITTYPE_SECONDARY)
662                         w_deathtypestring = _("%s was tagged by %s");
663                 else
664                         w_deathtypestring = _("%s was pummeled by %s");
665         }
666         return TRUE;
667 }
668 #endif
669 #endif