]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/w_electro.qc
More descriptive stuff, better naming
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_electro.qc
1 #ifdef REGISTER_WEAPON
2 REGISTER_WEAPON(
3 /* WEP_##id  */ ELECTRO,
4 /* function  */ W_Electro,
5 /* ammotype  */ ammo_cells,
6 /* impulse   */ 5,
7 /* flags     */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
8 /* rating    */ BOT_PICKUP_RATING_MID,
9 /* color     */ '0 0.5 1',
10 /* model     */ "electro",
11 /* crosshair */ "gfx/crosshairelectro 0.5",
12 /* refname   */ "electro",
13 /* wepname   */ _("Electro")
14 );
15
16 #define ELECTRO_SETTINGS(w_cvar,w_prop) ELECTRO_SETTINGS_LIST(w_cvar, w_prop, ELECTRO, electro)
17 #define ELECTRO_SETTINGS_LIST(w_cvar,w_prop,id,sn) \
18         w_cvar(id, sn, BOTH, ammo) \
19         w_cvar(id, sn, BOTH, animtime) \
20         w_cvar(id, sn, BOTH, damage) \
21         w_cvar(id, sn, BOTH, edgedamage) \
22         w_cvar(id, sn, BOTH, force) \
23         w_cvar(id, sn, BOTH, radius) \
24         w_cvar(id, sn, BOTH, refire) \
25         w_cvar(id, sn, BOTH, speed) \
26         w_cvar(id, sn, BOTH, spread) \
27         w_cvar(id, sn, BOTH, lifetime) \
28         w_cvar(id, sn, PRI,  comboradius) \
29         w_cvar(id, sn, PRI,  midaircombo_explode) \
30         w_cvar(id, sn, PRI,  midaircombo_interval) \
31         w_cvar(id, sn, PRI,  midaircombo_radius) \
32         w_cvar(id, sn, SEC,  bouncefactor) \
33         w_cvar(id, sn, SEC,  bouncestop) \
34         w_cvar(id, sn, SEC,  count) \
35         w_cvar(id, sn, SEC,  damageforcescale) \
36         w_cvar(id, sn, SEC,  damagedbycontents) \
37         w_cvar(id, sn, SEC,  health) \
38         w_cvar(id, sn, SEC,  refire2) \
39         w_cvar(id, sn, SEC,  speed_up) \
40         w_cvar(id, sn, SEC,  speed_z) \
41         w_cvar(id, sn, SEC,  touchexplode) \
42         w_cvar(id, sn, NONE, combo_comboradius) \
43         w_cvar(id, sn, NONE, combo_comboradius_thruwall) \
44         w_cvar(id, sn, NONE, combo_damage) \
45         w_cvar(id, sn, NONE, combo_edgedamage) \
46         w_cvar(id, sn, NONE, combo_force) \
47         w_cvar(id, sn, NONE, combo_radius) \
48         w_cvar(id, sn, NONE, combo_speed) \
49         w_cvar(id, sn, NONE, combo_safeammocheck) \
50         w_prop(id, sn, float,  reloading_ammo, reload_ammo) \
51         w_prop(id, sn, float,  reloading_time, reload_time) \
52         w_prop(id, sn, float,  switchdelay_raise, switchdelay_raise) \
53         w_prop(id, sn, float,  switchdelay_drop, switchdelay_drop) \
54         w_prop(id, sn, string, weaponreplace, weaponreplace) \
55         w_prop(id, sn, float,  weaponstart, weaponstart) \
56         w_prop(id, sn, float,  weaponstartoverride, weaponstartoverride)
57
58 #ifdef SVQC
59 ELECTRO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
60 .float electro_count;
61 .float electro_secondarytime;
62 void W_Electro_ExplodeCombo(void);
63 #endif
64 #else
65 #ifdef SVQC
66 void spawnfunc_weapon_electro() { weapon_defaultspawnfunc(WEP_ELECTRO); }
67
68 void W_Electro_TriggerCombo(vector org, float rad, entity own)
69 {
70         entity e = WarpZone_FindRadius(org, rad, !WEP_CVAR(electro, combo_comboradius_thruwall));
71         while(e)
72         {
73                 if(e.classname == "electro_orb")
74                 {
75                         // do we allow thruwall triggering?
76                         if(WEP_CVAR(electro, combo_comboradius_thruwall))
77                         {
78                                 // if distance is greater than thruwall distance, check to make sure it's not through a wall
79                                 if(vlen(e.WarpZone_findradius_dist) > WEP_CVAR(electro, combo_comboradius_thruwall))
80                                 {
81                                         WarpZone_TraceLine(org, e.origin, MOVE_NOMONSTERS, e);
82                                         if(trace_fraction != 1)
83                                         {
84                                                 // trigger is through a wall and outside of thruwall range, abort
85                                                 e = e.chain;
86                                                 continue;
87                                         }
88                                 }
89                         }
90                         
91                         // change owner to whoever caused the combo explosion
92                         e.realowner = own;
93                         e.takedamage = DAMAGE_NO;
94                         e.classname = "electro_orb_chain";
95                         
96                         // now set the next one to trigger as well
97                         e.think = W_Electro_ExplodeCombo;
98                         
99                         // delay combo chains, looks cooler
100                         e.nextthink =
101                                 (
102                                         time
103                                         +
104                                         (WEP_CVAR(electro, combo_speed) ?
105                                                 (vlen(e.WarpZone_findradius_dist) / WEP_CVAR(electro, combo_speed))
106                                                 :
107                                                 0
108                                         )
109                                 );
110                 }
111                 e = e.chain;
112         }
113 }
114
115 void W_Electro_ExplodeCombo(void)
116 {
117         W_Electro_TriggerCombo(self.origin, WEP_CVAR(electro, combo_comboradius), self.realowner);
118
119         self.event_damage = func_null;
120         
121         RadiusDamage(
122                 self,
123                 self.realowner,
124                 WEP_CVAR(electro, combo_damage),
125                 WEP_CVAR(electro, combo_edgedamage),
126                 WEP_CVAR(electro, combo_radius),
127                 world,
128                 world,
129                 WEP_CVAR(electro, combo_force),
130                 WEP_ELECTRO | HITTYPE_BOUNCE, // use THIS type for a combo because primary can't bounce
131                 world
132         );
133
134         remove(self);
135 }
136
137 void W_Electro_Explode(void)
138 {
139         if(other.takedamage == DAMAGE_AIM)
140                 if(IS_PLAYER(other))
141                         if(DIFF_TEAM(self.realowner, other))
142                                 if(other.deadflag == DEAD_NO)
143                                         if(IsFlying(other))
144                                                 Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
145
146         self.event_damage = func_null;
147         self.takedamage = DAMAGE_NO;
148         
149         if(self.movetype == MOVETYPE_BOUNCE)
150         {
151                 RadiusDamage(
152                         self,
153                         self.realowner,
154                         WEP_CVAR_SEC(electro, damage),
155                         WEP_CVAR_SEC(electro, edgedamage),
156                         WEP_CVAR_SEC(electro, radius),
157                         world,
158                         world,
159                         WEP_CVAR_SEC(electro, force),
160                         self.projectiledeathtype,
161                         other
162                 );
163         }
164         else
165         {
166                 W_Electro_TriggerCombo(self.origin, WEP_CVAR_PRI(electro, comboradius), self.realowner);
167                 RadiusDamage(
168                         self,
169                         self.realowner,
170                         WEP_CVAR_PRI(electro, damage),
171                         WEP_CVAR_PRI(electro, edgedamage),
172                         WEP_CVAR_PRI(electro, radius),
173                         world,
174                         world,
175                         WEP_CVAR_PRI(electro, force),
176                         self.projectiledeathtype,
177                         other
178                 );
179         }
180
181         remove(self);
182 }
183
184 void W_Electro_TouchExplode(void)
185 {
186         PROJECTILE_TOUCH;
187         W_Electro_Explode();
188 }
189
190 void W_Electro_Bolt_Think()
191 {
192         if(time >= self.ltime)
193         {
194                 self.use();
195                 return;
196         }
197
198         if(WEP_CVAR_PRI(electro, midaircombo_radius))
199         {
200                 float found = 0;
201                 entity e = WarpZone_FindRadius(self.origin, WEP_CVAR_PRI(electro, midaircombo_radius), TRUE);
202
203                 // loop through nearby orbs and trigger them
204                 while(e)
205                 {
206                         if(e.classname == "electro_orb")
207                         {
208                                 // change owner to whoever caused the combo explosion
209                                 e.realowner = self.realowner;
210                                 e.takedamage = DAMAGE_NO;
211                                 e.classname = "electro_orb_chain";
212
213                                 // now set the next one to trigger as well
214                                 e.think = W_Electro_ExplodeCombo;
215                                 
216                                 // delay combo chains, looks cooler
217                                 e.nextthink =
218                                         (
219                                                 time
220                                                 +
221                                                 (WEP_CVAR(electro, combo_speed) ?
222                                                         (vlen(e.WarpZone_findradius_dist) / WEP_CVAR(electro, combo_speed))
223                                                         :
224                                                         0
225                                                 )
226                                         );
227
228                                 ++found;
229                         }
230                         e = e.chain;
231                 }
232
233                 // if we triggered an orb, should we explode? if not, lets try again next time
234                 if(found && WEP_CVAR_PRI(electro, midaircombo_explode))
235                         { self.use(); }
236                 else
237                         { self.nextthink = min(time + WEP_CVAR_PRI(electro, midaircombo_interval), self.ltime); }
238         }
239         else { self.nextthink = self.ltime; }
240 }
241
242 void W_Electro_Attack_Bolt(void)
243 {
244         entity proj;
245
246         W_DecreaseAmmo(WEP_CVAR_PRI(electro, ammo));
247
248         W_SetupShot_ProjectileSize(self, '0 0 -3', '0 0 -3', FALSE, 2, "weapons/electro_fire.wav", CH_WEAPON_A, WEP_CVAR_PRI(electro, damage));
249
250         pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
251
252         proj = spawn ();
253         proj.classname = "electro_bolt";
254         proj.owner = proj.realowner = self;
255         proj.bot_dodge = TRUE;
256         proj.bot_dodgerating = WEP_CVAR_PRI(electro, damage);
257         proj.use = W_Electro_Explode;
258         proj.think = W_Electro_Bolt_Think;
259         proj.nextthink = time;
260         proj.ltime = time + WEP_CVAR_PRI(electro, lifetime);
261         PROJECTILE_MAKETRIGGER(proj);
262         proj.projectiledeathtype = WEP_ELECTRO;
263         setorigin(proj, w_shotorg);
264
265         proj.movetype = MOVETYPE_FLY;
266         W_SetupProjVelocity_PRI(proj, electro);
267         proj.angles = vectoangles(proj.velocity);
268         proj.touch = W_Electro_TouchExplode;
269         setsize(proj, '0 0 -3', '0 0 -3');
270         proj.flags = FL_PROJECTILE;
271         proj.missile_flags = MIF_SPLASH;
272
273         CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO_BEAM, TRUE);
274
275         other = proj; MUTATOR_CALLHOOK(EditProjectile);
276 }
277
278 void W_Electro_Orb_Touch(void)
279 {
280         PROJECTILE_TOUCH;
281         if(other.takedamage == DAMAGE_AIM)
282                 { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(); } }
283         else
284         {
285                 //UpdateCSQCProjectile(self);
286                 spamsound(self, CH_SHOTS, "weapons/electro_bounce.wav", VOL_BASE, ATTEN_NORM);
287                 self.projectiledeathtype |= HITTYPE_BOUNCE;
288         }
289 }
290
291 void W_Electro_Orb_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
292 {
293         if(self.health <= 0)
294                 return;
295
296         // note: combos are usually triggered by W_Electro_TriggerCombo, not damage
297         float is_combo = (inflictor.classname == "electro_orb_chain" || inflictor.classname == "electro_bolt");
298
299         if(!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, (is_combo ? 1 : -1)))
300                 return; // g_projectiles_damage says to halt
301
302         self.health = self.health - damage;
303         if(self.health <= 0)
304         {
305                 self.takedamage = DAMAGE_NO;
306                 self.nextthink = time;
307                 if(is_combo)
308                 {
309                         // change owner to whoever caused the combo explosion
310                         self.realowner = inflictor.realowner;
311                         self.classname = "electro_orb_chain";
312                         self.think = W_Electro_ExplodeCombo;
313                         self.nextthink = time +
314                                 (
315                                         // bound the length, inflictor may be in a galaxy far far away (warpzones)
316                                         min(
317                                                 WEP_CVAR(electro, combo_radius),
318                                                 vlen(self.origin - inflictor.origin)
319                                         )
320                                         /
321                                         // delay combo chains, looks cooler
322                                         WEP_CVAR(electro, combo_speed)
323                                 );
324                 }
325                 else
326                 {
327                         self.use = W_Electro_Explode;
328                         self.think = adaptor_think2use; // not _hittype_splash, as this runs "immediately"
329                 }
330         }
331 }
332
333 void W_Electro_Attack_Orb(void)
334 {
335         W_DecreaseAmmo(WEP_CVAR_SEC(electro, ammo));
336
337         W_SetupShot_ProjectileSize(self, '0 0 -4', '0 0 -4', FALSE, 2, "weapons/electro_fire2.wav", CH_WEAPON_A, WEP_CVAR_SEC(electro, damage));
338
339         w_shotdir = v_forward; // no TrueAim for grenades please
340
341         pointparticles(particleeffectnum("electro_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
342
343         entity proj = spawn();
344         proj.classname = "electro_orb";
345         proj.owner = proj.realowner = self;
346         proj.use = W_Electro_Explode;
347         proj.think = adaptor_think2use_hittype_splash;
348         proj.bot_dodge = TRUE;
349         proj.bot_dodgerating = WEP_CVAR_SEC(electro, damage);
350         proj.nextthink = time + WEP_CVAR_SEC(electro, lifetime);
351         PROJECTILE_MAKETRIGGER(proj);
352         proj.projectiledeathtype = WEP_ELECTRO | HITTYPE_SECONDARY;
353         setorigin(proj, w_shotorg);
354
355         //proj.glow_size = 50;
356         //proj.glow_color = 45;
357         proj.movetype = MOVETYPE_BOUNCE;
358         W_SetupProjVelocity_UP_SEC(proj, electro);
359         proj.touch = W_Electro_Orb_Touch;
360         setsize(proj, '0 0 -4', '0 0 -4');
361         proj.takedamage = DAMAGE_YES;
362         proj.damageforcescale = WEP_CVAR_SEC(electro, damageforcescale);
363         proj.health = WEP_CVAR_SEC(electro, health);
364         proj.event_damage = W_Electro_Orb_Damage;
365         proj.flags = FL_PROJECTILE;
366         proj.damagedbycontents = (WEP_CVAR_SEC(electro, damagedbycontents));
367
368         proj.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor);
369         proj.bouncestop = WEP_CVAR_SEC(electro, bouncestop);
370         proj.missile_flags = MIF_SPLASH | MIF_ARC;
371
372 #if 0
373         entity p2;
374         p2 = spawn();
375         copyentity(proj, p2);
376         setmodel(p2, "models/ebomb.mdl");
377         setsize(p2, proj.mins, proj.maxs);
378 #endif
379
380         CSQCProjectile(proj, TRUE, PROJECTILE_ELECTRO, FALSE); // no culling, it has sound
381
382         other = proj; MUTATOR_CALLHOOK(EditProjectile);
383 }
384
385 void W_Electro_CheckAttack()
386 {
387         if(self.electro_count > 1)
388         if(self.BUTTON_ATCK2)
389         if(weapon_prepareattack(1, -1))
390         {
391                 W_Electro_Attack_Orb();
392                 self.electro_count -= 1;
393                 weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
394                 return;
395         }
396         // WEAPONTODO: when the player releases the button, cut down the length of refire2? 
397         w_ready();
398 }
399
400 .float bot_secondary_electromooth;
401 float W_Electro(float req)
402 {
403         float ammo_amount;
404         switch(req)
405         {
406                 case WR_AIM:
407                 {
408                         self.BUTTON_ATCK = self.BUTTON_ATCK2 = FALSE;
409                         if(vlen(self.origin-self.enemy.origin) > 1000) { self.bot_secondary_electromooth = 0; }
410                         if(self.bot_secondary_electromooth == 0)
411                         {
412                                 float shoot;
413
414                                 if(WEP_CVAR_PRI(electro, speed))
415                                         shoot = bot_aim(WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), FALSE);
416                                 else
417                                         shoot = bot_aim(1000000, 0, 0.001, FALSE);
418
419                                 if(shoot)
420                                 {
421                                         self.BUTTON_ATCK = TRUE;
422                                         if(random() < 0.01) self.bot_secondary_electromooth = 1;
423                                 }
424                         }
425                         else
426                         {
427                                 if(bot_aim(WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), TRUE))
428                                 {
429                                         self.BUTTON_ATCK2 = TRUE;
430                                         if(random() < 0.03) self.bot_secondary_electromooth = 0;
431                                 }
432                         }
433                         
434                         return TRUE;
435                 }
436                 case WR_THINK:
437                 {
438                         if(autocvar_g_balance_electro_reload_ammo) // forced reload // WEAPONTODO
439                         {
440                                 ammo_amount = 0;
441                                 if(self.clip_load >= WEP_CVAR_PRI(electro, ammo))
442                                         ammo_amount = 1;
443                                 if(self.clip_load >= WEP_CVAR_SEC(electro, ammo))
444                                         ammo_amount += 1;
445
446                                 if(!ammo_amount)
447                                 {
448                                         WEP_ACTION(self.weapon, WR_RELOAD);
449                                         return FALSE;
450                                 }
451                                 
452                                 return TRUE;
453                         }
454                         
455                         if(self.BUTTON_ATCK)
456                         {
457                                 if(weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire)))
458                                 {
459                                                 W_Electro_Attack_Bolt();
460                                                 weapon_thinkf(WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
461                                 }
462                         }
463                         else if(self.BUTTON_ATCK2)
464                         {
465                                 if(time >= self.electro_secondarytime)
466                                 if(weapon_prepareattack(1, WEP_CVAR_SEC(electro, refire)))
467                                 {
468                                         W_Electro_Attack_Orb();
469                                         self.electro_count = WEP_CVAR_SEC(electro, count);
470                                         weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
471                                         self.electro_secondarytime = time + WEP_CVAR_SEC(electro, refire2) * W_WeaponRateFactor();
472                                 }
473                         }
474
475                         return TRUE;
476                 }
477                 case WR_INIT:
478                 {
479                         precache_model("models/weapons/g_electro.md3");
480                         precache_model("models/weapons/v_electro.md3");
481                         precache_model("models/weapons/h_electro.iqm");
482                         precache_sound("weapons/electro_bounce.wav");
483                         precache_sound("weapons/electro_fire.wav");
484                         precache_sound("weapons/electro_fire2.wav");
485                         precache_sound("weapons/electro_impact.wav");
486                         precache_sound("weapons/electro_impact_combo.wav");
487                         ELECTRO_SETTINGS(WEP_SKIPCVAR, WEP_SET_PROP)
488                         return TRUE;
489                 }
490                 case WR_CHECKAMMO1:
491                 {
492                         ammo_amount = self.WEP_AMMO(ELECTRO) >= WEP_CVAR_PRI(electro, ammo);
493                         ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_PRI(electro, ammo);
494                         return ammo_amount;
495                 }
496                 case WR_CHECKAMMO2:
497                 {
498                         if(WEP_CVAR(electro, combo_safeammocheck)) // true if you can fire at least one secondary blob AND one primary shot after it, otherwise false.
499                         {
500                                 ammo_amount = self.WEP_AMMO(ELECTRO) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
501                                 ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
502                         }
503                         else
504                         {
505                                 ammo_amount = self.WEP_AMMO(ELECTRO) >= WEP_CVAR_SEC(electro, ammo);
506                                 ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= WEP_CVAR_SEC(electro, ammo);
507                         }
508                         return ammo_amount;
509                 }
510                 case WR_CONFIG:
511                 {
512                         ELECTRO_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS)
513                         return TRUE;
514                 }
515                 case WR_RESETPLAYER:
516                 {
517                         self.electro_secondarytime = time;
518                         return TRUE;
519                 }
520                 case WR_RELOAD:
521                 {
522                         W_Reload(min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), "weapons/reload.wav");
523                         return TRUE;
524                 }
525                 case WR_SUICIDEMESSAGE:
526                 {
527                         if(w_deathtype & HITTYPE_SECONDARY)
528                                 return WEAPON_ELECTRO_SUICIDE_ORBS;
529                         else
530                                 return WEAPON_ELECTRO_SUICIDE_BOLT;
531                 }
532                 case WR_KILLMESSAGE:
533                 {
534                         if(w_deathtype & HITTYPE_SECONDARY)
535                         {
536                                 return WEAPON_ELECTRO_MURDER_ORBS;
537                         }
538                         else
539                         {
540                                 if(w_deathtype & HITTYPE_BOUNCE)
541                                         return WEAPON_ELECTRO_MURDER_COMBO;
542                                 else
543                                         return WEAPON_ELECTRO_MURDER_BOLT;
544                         }
545                 }
546         }
547         return TRUE;
548 }
549 #endif
550 #ifdef CSQC
551 float W_Electro(float req)
552 {
553         switch(req)
554         {
555                 case WR_IMPACTEFFECT:
556                 {
557                         vector org2;
558                         org2 = w_org + w_backoff * 6;
559                         if(w_deathtype & HITTYPE_SECONDARY)
560                         {
561                                 pointparticles(particleeffectnum("electro_ballexplode"), org2, '0 0 0', 1);
562                                 if(!w_issilent)
563                                         sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
564                         }
565                         else
566                         {
567                                 if(w_deathtype & HITTYPE_BOUNCE)
568                                 {
569                                         // this is sent as "primary (w_deathtype & HITTYPE_BOUNCE)" to distinguish it from (w_deathtype & HITTYPE_SECONDARY) bounced balls
570                                         pointparticles(particleeffectnum("electro_combo"), org2, '0 0 0', 1);
571                                         if(!w_issilent)
572                                                 sound(self, CH_SHOTS, "weapons/electro_impact_combo.wav", VOL_BASE, ATTEN_NORM);
573                                 }
574                                 else
575                                 {
576                                         pointparticles(particleeffectnum("electro_impact"), org2, '0 0 0', 1);
577                                         if(!w_issilent)
578                                                 sound(self, CH_SHOTS, "weapons/electro_impact.wav", VOL_BASE, ATTEN_NORM);
579                                 }
580                         }
581                         
582                         return TRUE;
583                 }
584                 case WR_INIT:
585                 {
586                         precache_sound("weapons/electro_impact.wav");
587                         precache_sound("weapons/electro_impact_combo.wav");
588                         return TRUE;
589                 }
590                 case WR_ZOOMRETICLE:
591                 {
592                         // no weapon specific image for this weapon
593                         return FALSE;
594                 }
595         }
596         return TRUE;
597 }
598 #endif
599 #endif