]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/weapons/weapon/electro.qc
Merge branch 'terencehill/v_deathtilt_fix' into 'master'
[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(self.origin, WEP_CVAR(electro, combo_comboradius), self.realowner);
128
129         self.event_damage = func_null;
130
131         RadiusDamage(
132                 self,
133                 self.realowner,
134                 WEP_CVAR(electro, combo_damage),
135                 WEP_CVAR(electro, combo_edgedamage),
136                 WEP_CVAR(electro, combo_radius),
137                 world,
138                 world,
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                 world
142         );
143
144         remove(self);
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(self.realowner, other))
152                                 if(!IS_DEAD(other))
153                                         if(IsFlying(other))
154                                                 Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_ELECTROBITCH);
155
156         self.event_damage = func_null;
157         self.takedamage = DAMAGE_NO;
158
159         if(self.movetype == MOVETYPE_BOUNCE)
160         {
161                 RadiusDamage(
162                         self,
163                         self.realowner,
164                         WEP_CVAR_SEC(electro, damage),
165                         WEP_CVAR_SEC(electro, edgedamage),
166                         WEP_CVAR_SEC(electro, radius),
167                         world,
168                         world,
169                         WEP_CVAR_SEC(electro, force),
170                         self.projectiledeathtype,
171                         other
172                 );
173         }
174         else
175         {
176                 W_Electro_TriggerCombo(self.origin, WEP_CVAR_PRI(electro, comboradius), self.realowner);
177                 RadiusDamage(
178                         self,
179                         self.realowner,
180                         WEP_CVAR_PRI(electro, damage),
181                         WEP_CVAR_PRI(electro, edgedamage),
182                         WEP_CVAR_PRI(electro, radius),
183                         world,
184                         world,
185                         WEP_CVAR_PRI(electro, force),
186                         self.projectiledeathtype,
187                         other
188                 );
189         }
190
191         remove(self);
192 }
193
194 void W_Electro_Explode_use(entity this, entity actor, entity trigger)
195 {
196         WITHSELF(this, 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 void W_Electro_Bolt_Think(entity this)
206 {
207         if(time >= self.ltime)
208         {
209                 this.use(this, NULL, NULL);
210                 return;
211         }
212
213         if(WEP_CVAR_PRI(electro, midaircombo_radius))
214         {
215                 float found = 0;
216                 entity e = WarpZone_FindRadius(self.origin, WEP_CVAR_PRI(electro, midaircombo_radius), true);
217
218                 // loop through nearby orbs and trigger them
219                 while(e)
220                 {
221                         if(e.classname == "electro_orb")
222                         {
223                                 // change owner to whoever caused the combo explosion
224                                 e.realowner = self.realowner;
225                                 e.takedamage = DAMAGE_NO;
226                                 e.classname = "electro_orb_chain";
227
228                                 // now set the next one to trigger as well
229                                 setthink(e, W_Electro_ExplodeCombo);
230
231                                 // delay combo chains, looks cooler
232                                 e.nextthink =
233                                         (
234                                                 time
235                                                 +
236                                                 (WEP_CVAR(electro, combo_speed) ?
237                                                         (vlen(e.WarpZone_findradius_dist) / WEP_CVAR(electro, combo_speed))
238                                                         :
239                                                         0
240                                                 )
241                                         );
242
243                                 ++found;
244                         }
245                         e = e.chain;
246                 }
247
248                 // if we triggered an orb, should we explode? if not, lets try again next time
249                 if(found && WEP_CVAR_PRI(electro, midaircombo_explode))
250                         { this.use(this, NULL, NULL); }
251                 else
252                         { self.nextthink = min(time + WEP_CVAR_PRI(electro, midaircombo_interval), self.ltime); }
253         }
254         else { self.nextthink = self.ltime; }
255 }
256
257 void W_Electro_Attack_Bolt(Weapon thiswep, entity actor)
258 {entity this = actor;
259         entity proj;
260
261         W_DecreaseAmmo(thiswep, self, WEP_CVAR_PRI(electro, ammo));
262
263         W_SetupShot_ProjectileSize(
264                 self,
265                 '0 0 -3',
266                 '0 0 -3',
267                 false,
268                 2,
269                 SND_ELECTRO_FIRE,
270                 CH_WEAPON_A,
271                 WEP_CVAR_PRI(electro, damage)
272         );
273
274         Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
275
276         proj = new(electro_bolt);
277         proj.owner = proj.realowner = self;
278         proj.bot_dodge = true;
279         proj.bot_dodgerating = WEP_CVAR_PRI(electro, damage);
280         proj.use = W_Electro_Explode_use;
281         setthink(proj, W_Electro_Bolt_Think);
282         proj.nextthink = time;
283         proj.ltime = time + WEP_CVAR_PRI(electro, lifetime);
284         PROJECTILE_MAKETRIGGER(proj);
285         proj.projectiledeathtype = WEP_ELECTRO.m_id;
286         setorigin(proj, w_shotorg);
287
288         proj.movetype = MOVETYPE_FLY;
289         W_SetupProjVelocity_PRI(proj, electro);
290         proj.angles = vectoangles(proj.velocity);
291         settouch(proj, W_Electro_TouchExplode);
292         setsize(proj, '0 0 -3', '0 0 -3');
293         proj.flags = FL_PROJECTILE;
294         proj.missile_flags = MIF_SPLASH;
295
296         CSQCProjectile(proj, true, PROJECTILE_ELECTRO_BEAM, true);
297
298         MUTATOR_CALLHOOK(EditProjectile, self, proj);
299 }
300
301 void W_Electro_Orb_Touch(entity this)
302 {
303         PROJECTILE_TOUCH(this);
304         if(other.takedamage == DAMAGE_AIM)
305                 { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(self); } }
306         else
307         {
308                 //UpdateCSQCProjectile(self);
309                 spamsound(self, CH_SHOTS, SND(ELECTRO_BOUNCE), VOL_BASE, ATTEN_NORM);
310                 self.projectiledeathtype |= HITTYPE_BOUNCE;
311         }
312 }
313
314 void W_Electro_Orb_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
315 {
316         if(this.health <= 0)
317                 return;
318
319         // note: combos are usually triggered by W_Electro_TriggerCombo, not damage
320         float is_combo = (inflictor.classname == "electro_orb_chain" || inflictor.classname == "electro_bolt");
321
322         if(!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, (is_combo ? 1 : -1)))
323                 return; // g_projectiles_damage says to halt
324
325         this.health = this.health - damage;
326         if(this.health <= 0)
327         {
328                 this.takedamage = DAMAGE_NO;
329                 this.nextthink = time;
330                 if(is_combo)
331                 {
332                         // change owner to whoever caused the combo explosion
333                         this.realowner = inflictor.realowner;
334                         this.classname = "electro_orb_chain";
335                         setthink(this, W_Electro_ExplodeCombo);
336                         this.nextthink = time +
337                                 (
338                                         // bound the length, inflictor may be in a galaxy far far away (warpzones)
339                                         min(
340                                                 WEP_CVAR(electro, combo_radius),
341                                                 vlen(this.origin - inflictor.origin)
342                                         )
343                                         /
344                                         // delay combo chains, looks cooler
345                                         WEP_CVAR(electro, combo_speed)
346                                 );
347                 }
348                 else
349                 {
350                         this.use = W_Electro_Explode_use;
351                         setthink(this, adaptor_think2use); // not _hittype_splash, as this runs "immediately"
352                 }
353         }
354 }
355
356 void W_Electro_Attack_Orb(Weapon thiswep, entity actor)
357 {entity this = actor;
358         W_DecreaseAmmo(thiswep, self, WEP_CVAR_SEC(electro, ammo));
359
360         W_SetupShot_ProjectileSize(
361                 self,
362                 '0 0 -4',
363                 '0 0 -4',
364                 false,
365                 2,
366                 SND_ELECTRO_FIRE2,
367                 CH_WEAPON_A,
368                 WEP_CVAR_SEC(electro, damage)
369         );
370
371         w_shotdir = v_forward; // no TrueAim for grenades please
372
373         Send_Effect(EFFECT_ELECTRO_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
374
375         entity proj = new(electro_orb);
376         proj.owner = proj.realowner = self;
377         proj.use = W_Electro_Explode_use;
378         setthink(proj, adaptor_think2use_hittype_splash);
379         proj.bot_dodge = true;
380         proj.bot_dodgerating = WEP_CVAR_SEC(electro, damage);
381         proj.nextthink = time + WEP_CVAR_SEC(electro, lifetime);
382         PROJECTILE_MAKETRIGGER(proj);
383         proj.projectiledeathtype = WEP_ELECTRO.m_id | HITTYPE_SECONDARY;
384         setorigin(proj, w_shotorg);
385
386         //proj.glow_size = 50;
387         //proj.glow_color = 45;
388         proj.movetype = MOVETYPE_BOUNCE;
389         W_SetupProjVelocity_UP_SEC(proj, electro);
390         settouch(proj, W_Electro_Orb_Touch);
391         setsize(proj, '0 0 -4', '0 0 -4');
392         proj.takedamage = DAMAGE_YES;
393         proj.damageforcescale = WEP_CVAR_SEC(electro, damageforcescale);
394         proj.health = WEP_CVAR_SEC(electro, health);
395         proj.event_damage = W_Electro_Orb_Damage;
396         proj.flags = FL_PROJECTILE;
397         proj.damagedbycontents = (WEP_CVAR_SEC(electro, damagedbycontents));
398
399         proj.bouncefactor = WEP_CVAR_SEC(electro, bouncefactor);
400         proj.bouncestop = WEP_CVAR_SEC(electro, bouncestop);
401         proj.missile_flags = MIF_SPLASH | MIF_ARC;
402
403 #if 0
404         entity p2;
405         p2 = spawn();
406         copyentity(proj, p2);
407         setmodel(p2, MDL_PROJECTILE_ELECTRO);
408         setsize(p2, proj.mins, proj.maxs);
409 #endif
410
411         CSQCProjectile(proj, true, PROJECTILE_ELECTRO, false); // no culling, it has sound
412
413         MUTATOR_CALLHOOK(EditProjectile, self, proj);
414 }
415
416 void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, int fire)
417 {entity this = actor;
418         if(self.electro_count > 1)
419         if(PHYS_INPUT_BUTTON_ATCK2(self))
420         if(weapon_prepareattack(thiswep, actor, weaponentity, true, -1))
421         {
422                 W_Electro_Attack_Orb(WEP_ELECTRO, actor);
423                 self.electro_count -= 1;
424                 weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
425                 return;
426         }
427         // WEAPONTODO: when the player releases the button, cut down the length of refire2?
428         w_ready(thiswep, actor, weaponentity, fire);
429 }
430
431 .float bot_secondary_electromooth;
432
433 METHOD(Electro, wr_aim, void(entity thiswep, entity actor))
434 {
435     entity this = actor;
436     PHYS_INPUT_BUTTON_ATCK(self) = PHYS_INPUT_BUTTON_ATCK2(self) = false;
437     if(vdist(self.origin - self.enemy.origin, >, 1000)) { self.bot_secondary_electromooth = 0; }
438     if(self.bot_secondary_electromooth == 0)
439     {
440         float shoot;
441
442         if(WEP_CVAR_PRI(electro, speed))
443             shoot = bot_aim(self, WEP_CVAR_PRI(electro, speed), 0, WEP_CVAR_PRI(electro, lifetime), false);
444         else
445             shoot = bot_aim(self, 1000000, 0, 0.001, false);
446
447         if(shoot)
448         {
449             PHYS_INPUT_BUTTON_ATCK(self) = true;
450             if(random() < 0.01) self.bot_secondary_electromooth = 1;
451         }
452     }
453     else
454     {
455         if(bot_aim(self, WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
456         {
457             PHYS_INPUT_BUTTON_ATCK2(self) = true;
458             if(random() < 0.03) self.bot_secondary_electromooth = 0;
459         }
460     }
461 }
462 METHOD(Electro, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
463 {
464     if(autocvar_g_balance_electro_reload_ammo) // forced reload // WEAPONTODO
465     {
466         float ammo_amount = 0;
467         if(actor.clip_load >= WEP_CVAR_PRI(electro, ammo))
468             ammo_amount = 1;
469         if(actor.clip_load >= WEP_CVAR_SEC(electro, ammo))
470             ammo_amount += 1;
471
472         if(!ammo_amount)
473         {
474             thiswep.wr_reload(thiswep, actor, weaponentity);
475             return;
476         }
477     }
478
479     if(fire & 1)
480     {
481         if(weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire)))
482         {
483                 W_Electro_Attack_Bolt(thiswep, actor);
484                 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(electro, animtime), w_ready);
485         }
486     }
487     else if(fire & 2)
488     {
489         if(time >= actor.electro_secondarytime)
490         if(weapon_prepareattack(thiswep, actor, weaponentity, true, WEP_CVAR_SEC(electro, refire)))
491         {
492             W_Electro_Attack_Orb(thiswep, actor);
493             actor.electro_count = WEP_CVAR_SEC(electro, count);
494             weapon_thinkf(actor, weaponentity, WFRAME_FIRE2, WEP_CVAR_SEC(electro, animtime), W_Electro_CheckAttack);
495             actor.electro_secondarytime = time + WEP_CVAR_SEC(electro, refire2) * W_WeaponRateFactor();
496         }
497     }
498 }
499 METHOD(Electro, wr_checkammo1, bool(entity thiswep, entity actor))
500 {
501     float ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_PRI(electro, ammo);
502     ammo_amount += actor.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_PRI(electro, ammo);
503     return ammo_amount;
504 }
505 METHOD(Electro, wr_checkammo2, bool(entity thiswep, entity actor))
506 {
507     float ammo_amount;
508     if(WEP_CVAR(electro, combo_safeammocheck)) // true if you can fire at least one secondary blob AND one primary shot after it, otherwise false.
509     {
510         ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
511         ammo_amount += actor.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_SEC(electro, ammo) + WEP_CVAR_PRI(electro, ammo);
512     }
513     else
514     {
515         ammo_amount = actor.(thiswep.ammo_field) >= WEP_CVAR_SEC(electro, ammo);
516         ammo_amount += actor.(weapon_load[WEP_ELECTRO.m_id]) >= WEP_CVAR_SEC(electro, ammo);
517     }
518     return ammo_amount;
519 }
520 METHOD(Electro, wr_resetplayer, void(entity thiswep, entity actor))
521 {
522     entity this = actor;
523     self.electro_secondarytime = time;
524 }
525 METHOD(Electro, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
526 {
527     W_Reload(actor, min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo)), SND_RELOAD);
528 }
529 METHOD(Electro, wr_suicidemessage, Notification(entity thiswep))
530 {
531     if(w_deathtype & HITTYPE_SECONDARY)
532         return WEAPON_ELECTRO_SUICIDE_ORBS;
533     else
534         return WEAPON_ELECTRO_SUICIDE_BOLT;
535 }
536 METHOD(Electro, wr_killmessage, Notification(entity thiswep))
537 {
538     if(w_deathtype & HITTYPE_SECONDARY)
539     {
540         return WEAPON_ELECTRO_MURDER_ORBS;
541     }
542     else
543     {
544         if(w_deathtype & HITTYPE_BOUNCE)
545             return WEAPON_ELECTRO_MURDER_COMBO;
546         else
547             return WEAPON_ELECTRO_MURDER_BOLT;
548     }
549 }
550
551 #endif
552 #ifdef CSQC
553
554 METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
555 {
556     entity this = actor;
557     vector org2;
558     org2 = w_org + w_backoff * 6;
559     if(w_deathtype & HITTYPE_SECONDARY)
560     {
561         pointparticles(EFFECT_ELECTRO_BALLEXPLODE, org2, '0 0 0', 1);
562         if(!w_issilent)
563             sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, 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(EFFECT_ELECTRO_COMBO, org2, '0 0 0', 1);
571             if(!w_issilent)
572                 sound(self, CH_SHOTS, SND_ELECTRO_IMPACT_COMBO, VOL_BASE, ATTEN_NORM);
573         }
574         else
575         {
576             pointparticles(EFFECT_ELECTRO_IMPACT, org2, '0 0 0', 1);
577             if(!w_issilent)
578                 sound(self, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTEN_NORM);
579         }
580     }
581 }
582
583 #endif
584 #endif