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