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