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