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