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