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