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