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