]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/gamec/g_damage.c
Logging: now also logs the weapon number if out of ammo.
[divverent/nexuiz.git] / data / qcsrc / server / gamec / g_damage.c
1
2 float checkrules_firstblood;
3
4 void GiveFrags (entity attacker, entity targ, float f)
5 {
6
7         if(gameover) return;
8
9         if(f > 0 && cvar("g_domination") && cvar("g_domination_disable_frags"))
10                 return;
11         else if(f > 0 && cvar("g_runematch"))
12                 f = RunematchHandleFrags(attacker, targ, f);
13         else if(cvar("g_lms"))
14         {
15                 // count remaining lives, not frags in lms
16                 targ.frags -= 1;
17                 // keep track of the worst players lives
18                 if(targ.frags < lms_lowest_lives)
19                         lms_lowest_lives = targ.frags;
20                 // player has no more lives left
21                 if (!targ.frags)
22                         lms_dead_count += 1;
23                 return;
24         }
25
26         if(f)
27                 attacker.frags = attacker.frags + f;
28 }
29
30 string AppendItemcodes(string s, entity player)
31 {
32         float w;
33         w = player.weapon;
34         if(w == 0)
35                 w = player.switchweapon;
36         if(w == 0)
37                 w = player.cnt; // previous weapon!
38         s = strcat(s, ftos(weapon_translateindextoflag(w)));
39         if(time < player.strength_finished)
40                 s = strcat(s, "S");
41         if(time < player.invincible_finished)
42                 s = strcat(s, "I");
43         if(player.flagcarried != world)
44                 s = strcat(s, "F");
45         if(player.runes)
46                 s = strcat(s, "|", ftos(player.runes));
47         return s;
48 }
49
50 void LogDeath(string mode, float deathtype, entity killer, entity killed)
51 {
52         string s;
53         if(!cvar("sv_eventlog"))
54                 return;
55         s = strcat(":kill:", mode);
56         s = strcat(s, ":", ftos(killer.playerid));
57         s = strcat(s, ":", ftos(killed.playerid));
58         s = strcat(s, ":type=", ftos(deathtype));
59         s = strcat(s, ":items=");
60         s = AppendItemcodes(s, killer);
61         if(killed != killer)
62         {
63                 s = strcat(s, ":victimitems=");
64                 s = AppendItemcodes(s, killed);
65         }
66         GameLogEcho(s, FALSE);
67 }
68
69 void Obituary (entity attacker, entity targ, float deathtype)
70 {
71         string  s, m;
72
73         if (targ.classname == "player" || targ.classname == "corpse")
74         {
75                 if (targ.classname == "corpse")
76                         s = "A corpse";
77                 else
78                         s = targ.netname;
79
80                 if (targ == attacker)
81                 {
82                         if (deathtype == DEATH_NOAMMO)
83                                 centerprint(targ, strcat("^1You were killed for running out of ammo...\n\n\n"));
84                         if (deathtype == DEATH_TEAMCHANGE)
85                         {
86                                 m = "You are now on: ";
87                                 if (targ.team == 5)
88                                         m = strcat(m, "^1Red Team");
89                                 else if (targ.team == 14)
90                                         m = strcat(m, "^4Blue Team");
91                                 else if (targ.team == 10)
92                                         m = strcat(m, "^6Pink Team");
93                                 else if (targ.team == 13)
94                                         m = strcat(m, "^3Yellow Team");
95                                 centerprint(targ, m);
96                         }
97                         else if (deathtype == DEATH_AUTOTEAMCHANGE)
98                         {
99                                 m = "You have been moved into a different team to improve team balance\nYou are now on: ";
100                                 if (targ.team == 5)
101                                         m = strcat(m, "^1Red Team");
102                                 else if (targ.team == 14)
103                                         m = strcat(m, "^4Blue Team");
104                                 else if (targ.team == 10)
105                                         m = strcat(m, "^6Pink Team");
106                                 else if (targ.team == 13)
107                                         m = strcat(m, "^3Yellow Team");
108                                 centerprint(targ, m);
109                                 return;
110                         }
111                         else if (deathtype == DEATH_CAMP)
112                                 centerprint(targ, strcat("^1Die camper!\n\n\n"));
113                         else
114                                 centerprint(targ, strcat("^1You killed your own dumb self!\n\n\n"));
115
116                         if (deathtype == IT_GRENADE_LAUNCHER)
117                                 bprint ("^1",s, "^1 detonated\n");
118                         else if (deathtype == IT_ELECTRO)
119                                 bprint ("^1",s, "^1 played with plasma\n");
120                         else if (deathtype == IT_ROCKET_LAUNCHER)
121                                 bprint ("^1",s, "^1 exploded\n");
122                         else if (deathtype == DEATH_KILL)
123                                 bprint ("^1",s, "^1 couldn't take it anymore\n");
124                         else if (deathtype == DEATH_NOAMMO)
125                         {
126                                 bprint ("^7",s, " ^7committed suicide. What's the point of living without ammo?\n");
127                                 //sound (self, CHAN_BODY, "minstagib/mockery.ogg", 1, ATTN_NONE);
128                         }
129                         else if (deathtype == DEATH_CAMP)
130                                 bprint ("^1",s, "^1 thought he found a nice camping ground\n");
131                         else if (deathtype != DEATH_TEAMCHANGE)
132                                 bprint ("^1",s, "^1 couldn't resist the urge to self-destruct\n");
133
134                         if(deathtype != DEATH_TEAMCHANGE)
135                                 LogDeath("suicide", deathtype, targ, targ);
136
137                         GiveFrags(attacker, targ, -1);
138                         //targ.frags = targ.frags - 1;
139                         if (targ.killcount > 2)
140                                 bprint ("^1",s,"^1 ended it all with a ",ftos(targ.killcount)," kill spree\n");
141                 }
142                 else if (teamplay && attacker.team == targ.team)
143                 {
144                         centerprint(attacker, strcat("^1Moron! You fragged a teammate!\n\n\n"));
145                         bprint ("^1", attacker.netname, "^1 mows down a teammate\n");
146                         GiveFrags(attacker, targ, -1);
147                         //attacker.frags = attacker.frags - 1;
148                         if (targ.killcount > 2)
149                                 bprint ("^1",s,"'s ^1",ftos(targ.killcount)," kill spree was endeded by a teammate!\n");
150                         if (attacker.killcount > 2)
151                                 bprint ("^1",attacker.netname,"^1 ended a ",ftos(attacker.killcount)," kill spree by killing a teammate\n");
152                         attacker.killcount = 0;
153
154                         LogDeath("tk", deathtype, attacker, targ);
155                 }
156                 else if (attacker.classname == "player" || attacker.classname == "gib")
157                 {
158                         if (!checkrules_firstblood)
159                         {
160                                 checkrules_firstblood = TRUE;
161                                 //sound(world, CHAN_AUTO, "announcer/firstblood.wav", 1, ATTN_NONE);
162                                 //if (cvar("g_minstagib"))
163                                         //sound(world, CHAN_AUTO, "announce/male/mapkill1.ogg", 1, ATTN_NONE);
164                                 bprint("^1",attacker.netname, "^1 drew first blood", "\n");
165                         }
166
167                         centerprint(attacker, strcat("^4You fragged ^7", s, "\n\n\n"));
168                         centerprint(targ, strcat("^1You were fragged by ^7", attacker.netname, "\n\n\n"));
169
170                         if (deathtype == IT_LASER)
171                                 bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
172                         else if (deathtype == IT_UZI)
173                                 bprint ("^1",s, "^1 was riddled full of holes by ", attacker.netname, "\n");
174                         else if (deathtype == IT_SHOTGUN)
175                                 bprint ("^1",s, "^1 was gunned by ", attacker.netname, "\n");
176                         else if (deathtype == IT_GRENADE_LAUNCHER)
177                                 bprint ("^1", s, "^1 was blasted by ", attacker.netname, "\n");
178                         else if (deathtype == IT_ELECTRO)
179                                 bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
180                         else if (deathtype == IT_CRYLINK)
181                                 bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
182                         else if (deathtype == IT_NEX)
183                                 bprint ("^1",s, "^1 has been vaporized by ", attacker.netname, "\n");
184                         else if (deathtype == IT_HAGAR)
185                                 bprint ("^1",s, "^1 was pummeled by ", attacker.netname, "\n");
186                         else if (deathtype == IT_ROCKET_LAUNCHER)
187                                 bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
188                         else if (deathtype == DEATH_TELEFRAG)
189                                 bprint ("^1",s, "^1 was telefragged by ", attacker.netname, "\n");
190                         else if (deathtype == DEATH_DROWN)
191                                 bprint ("^1",s, "^1 was drowned by ", attacker.netname, "\n");
192                         else if (deathtype == DEATH_SLIME)
193                                 bprint ("^1",s, "^1 was slimed by ", attacker.netname, "\n");
194                         else if (deathtype == DEATH_LAVA)
195                                 bprint ("^1",s, "^1 was cooked by ", attacker.netname, "\n");
196                         else if (deathtype == DEATH_FALL)
197                                 bprint ("^1",s, "^1 was grounded by ", attacker.netname, "\n");
198                         else if (deathtype == DEATH_SWAMP)
199                                 bprint ("^1",s, "^1 was conserved by ", attacker.netname, "\n");
200                         else if (deathtype == DEATH_HURTTRIGGER)
201                                 bprint ("^1",s, "^1 was thrown into a world of hurt by ", attacker.netname, "\n");
202                         else
203                                 bprint ("^1",s, "^1 was fragged by ", attacker.netname, "\n");
204
205                         GiveFrags(attacker, targ, 1);
206                         //attacker.frags = attacker.frags + 1;
207                         if (targ.killcount > 2)
208                                 bprint ("^1",s,"'s ^1", ftos(targ.killcount), " kill spree was ended by ", attacker.netname, "\n");
209                         attacker.killcount = attacker.killcount + 1;
210                         if (attacker.killcount > 2)
211                                 bprint ("^1",attacker.netname,"^1 has ",ftos(attacker.killcount)," frags in a row\n");
212
213                         LogDeath("frag", deathtype, attacker, targ);
214
215                         if (attacker.killcount == 3)
216                         {
217                                 bprint (attacker.netname,"^7 made a ^1TRIPLE FRAG\n");
218                                 stuffcmd(attacker, "play2 announcer/male/03kills.ogg\n");
219                         }
220                         else if (attacker.killcount == 5)
221                         {
222                                 bprint (attacker.netname,"^7 made a ^1FIVE FRAG COMBO\n");
223                                 stuffcmd(attacker, "play2 announcer/male/05kills.ogg\n");
224                         }
225                         else if (attacker.killcount == 10)
226                         {
227                                 bprint (attacker.netname,"^7 is on a ^1RAGE\n");
228                                 stuffcmd(attacker, "play2 announcer/male/10kills.ogg\n");
229                         }
230                         else if (attacker.killcount == 15)
231                         {
232                                 bprint (attacker.netname,"^7 has done a ^1MASSACRE!\n");
233                                 stuffcmd(attacker, "play2 announcer/male/15kills.ogg\n");
234                         }
235                         else if (attacker.killcount == 20)
236                         {
237                                 bprint (attacker.netname,"^7 is ^1UNHUMAN!\n");
238                                 stuffcmd(attacker, "play2 announcer/male/20kills.ogg\n");
239                         }
240                         else if (attacker.killcount == 25)
241                         {
242                                 bprint (attacker.netname,"^7 is a ^1DEATH INCARNATION!\n");
243                                 stuffcmd(attacker, "play2 announcer/male/25kills.ogg\n");
244                         }
245                         else if (attacker.killcount == 30)
246                         {
247                                 bprint (attacker.netname,"^7 is maybe a ^1AIMBOTTER?!\n");
248                                 stuffcmd(attacker, "play2 announcer/male/30kills.ogg\n");
249                         }
250                 }
251                 else
252                 {
253                         centerprint(targ, strcat("^1Watch your step!\n\n\n"));
254                         if (deathtype == DEATH_HURTTRIGGER && attacker.message != "")
255                                 bprint ("^1",s, "^1 ", attacker.message, "\n");
256                         else if (deathtype == DEATH_DROWN)
257                                 bprint ("^1",s, "^1 drowned\n");
258                         else if (deathtype == DEATH_SLIME)
259                                 bprint ("^1",s, "^1 was slimed\n");
260                         else if (deathtype == DEATH_LAVA)
261                                 bprint ("^1",s, "^1 turned into hot slag\n");
262                         else if (deathtype == DEATH_FALL)
263                                 bprint ("^1",s, "^1 hit the ground with a crunch\n");
264                         else if (deathtype == DEATH_SWAMP)
265                                 bprint ("^1",s, "^1 is now conserved for centuries to come\n");
266                         else
267                                 bprint ("^1",s, "^1 died\n");
268                         GiveFrags(targ, targ, -1);
269                         if(targ.frags == -5) {
270                                 stuffcmd(targ, "play2 announcer/male/botlike.ogg\n");
271                         }
272
273                         //targ.frags = targ.frags - 1;
274                         if (targ.killcount > 2)
275                                 bprint ("^1",s,"^1 died with a ",ftos(targ.killcount)," kill spree\n");
276
277                         LogDeath("accident", deathtype, targ, targ);
278                 }
279                 // FIXME: this should go in PutClientInServer
280                 if (targ.killcount)
281                         targ.killcount = 0;
282         }
283 }
284
285 // these are updated by each Damage call for use in button triggering and such
286 entity damage_targ;
287 entity damage_inflictor;
288 entity damage_attacker;
289
290 void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
291 {
292         if (gameover || targ.killcount == -666)
293                 return;
294
295         local entity oldself;
296         oldself = self;
297         self = targ;
298         damage_targ = targ;
299         damage_inflictor = inflictor;
300         damage_attacker = attacker;
301         // nullify damage if teamplay is on
302         if (teamplay)
303         if (attacker.team)
304         if (attacker.team == targ.team)
305         if ((teamplay == 1 || teamplay == 3) && attacker != targ)
306                 damage = 0;
307
308         if(cvar("g_lms"))
309         if(targ.classname == "player")
310         if(attacker.classname == "player")
311         if(attacker != targ)
312         {
313                 targ.lms_traveled_distance = cvar("g_lms_campcheck_distance");
314                 attacker.lms_traveled_distance = cvar("g_lms_campcheck_distance");
315         }
316
317         if(damage > 0 && targ != attacker && clienttype(attacker) == CLIENTTYPE_REAL && targ.classname == "player")
318                 stuffcmd(attacker, "play2 misc/hit.wav\n");
319
320         if (cvar("g_minstagib"))
321         {
322                 if ((deathtype == DEATH_FALL)  ||
323                     (deathtype == DEATH_DROWN) ||
324                     (deathtype == DEATH_SLIME) ||
325                     (deathtype == DEATH_LAVA))
326                         return;
327                 if (targ.extralives && (deathtype == IT_NEX) && damage)
328                 {
329                         targ.extralives -= 1;
330                         centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.extralives),"\n"));
331                         damage = 0;
332                         targ.armorvalue = targ.extralives;
333                         if(clienttype(targ) == CLIENTTYPE_REAL) stuffcmd(targ, "play2 misc/hit.wav\n");
334                         //stuffcmd(attacker, "play2 misc/hit.wav\n");
335                 }
336                 else if (deathtype == IT_NEX && targ.items & IT_STRENGTH)
337                 {
338                         if(clienttype(attacker) == CLIENTTYPE_REAL) stuffcmd(attacker, "play2 announcer/male/yoda.ogg\n");
339                 }
340                 if (deathtype == IT_LASER)
341                 {
342                         damage = 0;
343                         if (targ != attacker)
344                         {
345                                 if (targ.classname == "player")
346                                         centerprint(attacker, "Secondary fire inflicts no damage!\n");
347                                 damage = 0;
348                                 force = '0 0 0';
349                                 attacker = targ;
350                         }
351                 }
352         } else {
353                 if (deathtype == IT_NEX && !(attacker.flags & FL_ONGROUND) && !(targ.flags & FL_ONGROUND) && attacker.waterlevel < 2 && targ.waterlevel < 2 && attacker.killcount != 3 && attacker.killcount != 5 && attacker.killcount != 10 && attacker.killcount != 15 && attacker.killcount != 20 && attacker.killcount != 25 && attacker.killcount != 30)
354                 {
355                         if(clienttype(attacker) == CLIENTTYPE_REAL)  stuffcmd(attacker, "play2 announcer/male/yoda.ogg\n");
356                 }
357         }
358
359         // apply strength multiplier
360         if (attacker.items & IT_STRENGTH && !cvar("g_minstagib"))
361         {
362                 damage = damage * cvar("g_balance_powerup_strength_damage");
363                 force = force * cvar("g_balance_powerup_strength_force");
364         }
365         // apply invincibility multiplier
366         if (targ.items & IT_INVINCIBLE && !cvar("g_minstagib"))
367                 damage = damage * cvar("g_balance_powerup_invincible_takedamage");
368
369
370         if(cvar("g_runematch"))
371         {
372                 // apply strength rune
373                 if (attacker.runes & RUNE_STRENGTH)
374                 {
375                         if(attacker.runes & CURSE_WEAK) // have both curse & rune
376                         {
377                                 damage = damage * cvar("g_balance_rune_strength_combo_damage");
378                                 force = force * cvar("g_balance_rune_strength_combo_force");
379                         }
380                         else
381                         {
382                                 damage = damage * cvar("g_balance_rune_strength_damage");
383                                 force = force * cvar("g_balance_rune_strength_force");
384                         }
385                 }
386                 else if (attacker.runes & CURSE_WEAK)
387                 {
388                         damage = damage * cvar("g_balance_curse_weak_damage");
389                         force = force * cvar("g_balance_curse_weak_force");
390                 }
391
392                 // apply defense rune
393                 if (targ.runes & RUNE_DEFENSE)
394                 {
395                         if (targ.runes & CURSE_VULNER) // have both curse & rune
396                                 damage = damage * cvar("g_balance_rune_defense_combo_takedamage");
397                         else
398                                 damage = damage * cvar("g_balance_rune_defense_takedamage");
399                 }
400                 else if (targ.runes & CURSE_VULNER)
401                         damage = damage * cvar("g_balance_curse_vulner_takedamage");
402         }
403
404         // apply push
405         if (self.damageforcescale)
406         {
407                 self.velocity = self.velocity + self.damageforcescale * force;
408                 self.flags = self.flags - (self.flags & FL_ONGROUND);
409         }
410         // apply damage
411         if (self.event_damage)
412                 self.event_damage (inflictor, attacker, damage, deathtype, hitloc, force);
413         self = oldself;
414
415         if(targ.classname == "player" && attacker.classname == "player" && attacker != targ && attacker.health > 2)
416         {
417                 // Savage: vampire mode
418                 if(cvar("g_vampire") && !cvar("g_minstagib"))
419                 {
420                         attacker.health += damage;
421                 }
422                 if(cvar("g_runematch"))
423                 {
424                         if (attacker.runes & RUNE_VAMPIRE)
425                         {
426                         // apply vampire rune
427                                 if (attacker.runes & CURSE_EMPATHY) // have the curse too
428                                 {
429                                         //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb");
430                                         attacker.health = bound(
431                                                 cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 40
432                                                 attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb"),
433                                                 cvar("g_balance_rune_vampire_maxhealth"));      // LA: was 1000, now 500
434                                 }
435                                 else
436                                 {
437                                         //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_absorb");
438                                         attacker.health = bound(
439                                                 attacker.health,        // LA: was 3, but changed so that you can't lose health
440                                                                                         // empathy won't let you gain health in the same way...
441                                                 attacker.health + damage * cvar("g_balance_rune_vampire_absorb"),
442                                                 cvar("g_balance_rune_vampire_maxhealth"));      // LA: was 1000, now 500
443                                         }
444                         }
445                         // apply empathy curse
446                         else if (attacker.runes & CURSE_EMPATHY)
447                         {
448                                 attacker.health = bound(
449                                         cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 20
450                                         attacker.health + damage * cvar("g_balance_curse_empathy_takedamage"),
451                                         attacker.health);
452                         }
453                 }
454         }
455 }
456
457 void RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype)
458 {
459         entity  targ;
460         float   finaldmg;
461         float   power;
462         vector  blastorigin;
463         vector  force;
464         vector  m1;
465         vector  m2;
466         vector  nearest;
467         vector  diff;
468
469         blastorigin = (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5);
470
471         targ = findradius (blastorigin, rad);
472         while (targ)
473         {
474                 if (targ != inflictor)
475                         if (ignore != targ)
476                         {
477                                 // LordHavoc: measure distance to nearest point on target (not origin)
478                                 // (this guarentees 100% damage on a touch impact)
479                                 nearest = blastorigin;
480                                 m1 = targ.origin + targ.mins;
481                                 m2 = targ.origin + targ.maxs;
482                                 if (nearest_x < m1_x) nearest_x = m1_x;
483                                 if (nearest_y < m1_y) nearest_y = m1_y;
484                                 if (nearest_z < m1_z) nearest_z = m1_z;
485                                 if (nearest_x > m2_x) nearest_x = m2_x;
486                                 if (nearest_y > m2_y) nearest_y = m2_y;
487                                 if (nearest_z > m2_z) nearest_z = m2_z;
488                                 diff = nearest - blastorigin;
489                                 // round up a little on the damage to ensure full damage on impacts
490                                 // and turn the distance into a fraction of the radius
491                                 power = 1 - ((vlen (diff) - 2) / rad);
492                                 //bprint(" ");
493                                 //bprint(ftos(power));
494                                 if (power > 0)
495                                 {
496                                         if (power > 1)
497                                                 power = 1;
498                                         finaldmg = coredamage * power + edgedamage * (1 - power);
499                                         if (finaldmg > 0)
500                                         {
501                                                 force = normalize((m1 + m2) * 0.5 - blastorigin) * (finaldmg / coredamage) * forceintensity;
502                                                 if (targ == attacker)
503                                                         finaldmg = finaldmg * cvar("g_balance_selfdamagepercent");      // Partial damage if the attacker hits himself
504                                                 Damage (targ, inflictor, attacker, finaldmg, deathtype, nearest, force);
505                                         }
506                                 }
507                         }
508                 targ = targ.chain;
509         }
510 }
511
512 /*
513 entity  multi_ent;
514 float   multi_damage;
515 vector  multi_force;
516
517 void ClearMultiDamage (void)
518 {
519         multi_ent = world;
520         multi_damage = 0;
521         multi_force = '0 0 0';
522 }
523
524 void ApplyMultiDamage (void)
525 {
526         if (!multi_ent)
527                 return;
528
529         Damage (self, multi_ent.origin, multi_ent, 0, multi_damage, multi_force);
530 }
531
532 void AddMultiDamage (entity hit, float damage, vector force)
533 {
534         if (!hit)
535                 return;
536
537         if (hit != multi_ent)
538         {
539                 ApplyMultiDamage ();
540                 ClearMultiDamage ();
541                 multi_ent = hit;
542         }
543         multi_damage = multi_damage + damage;
544         multi_force = multi_force + force;
545 }
546
547 void FireBullets (float shotcount, vector dir, vector spread, float deathtype)
548 {
549         vector  direction;
550         vector  source;
551         vector  vel;
552         vector  org;
553
554         makevectors (self.v_angle);
555
556         source = self.origin + v_forward * 10;  // FIXME
557         source_x = self.absmin_z + self.size_z * 0.7;   // ??? whaddabout view_ofs
558
559         // LordHavoc: better to use normal damage
560         //ClearMultiDamage ();
561         while (shotcount > 0)
562         {
563                 direction = dir + crandom () * spread_x * v_right + crandom () * spread_y * v_up;
564
565                 traceline (source, source + direction * 2048, FALSE, self);
566                 if (trace_fraction != 1.0)
567                 {
568                         vel = normalize (direction + v_up * crandom () + v_right * crandom ());
569                         vel = vel + 2 * trace_plane_normal;
570                         vel = vel * 200;
571
572                         org = trace_endpos - direction * 4;
573
574                         if (!trace_ent.takedamage)
575                                 te_gunshot (org);
576                         // LordHavoc: better to use normal damage
577                         //AddMultiDamage (trace_ent, 4, direction * 4);
578                         Damage (trace_ent, self, self, 4, deathtype, trace_endpos, direction * 4);
579                 }
580
581                 shotcount = shotcount + 1;
582         }
583
584         // LordHavoc: better to use normal damage
585         //ApplyMultiDamage ();
586 }
587 */
588
589
590