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