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