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