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