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