1 float checkrules_firstblood;
5 float damage_gooddamage;
9 float IsDifferentTeam(entity a, entity b)
24 float IsFlying(entity a)
26 if(a.flags & FL_ONGROUND)
30 traceline(a.origin, a.origin - '0 0 48', MOVE_NORMAL, a);
31 if(trace_fraction < 1)
36 void UpdateFrags(entity player, float f)
38 PlayerTeamScore_AddScore(player, f);
41 // NOTE: f=0 means still count as a (positive) kill, but count no frags for it
42 void GiveFrags (entity attacker, entity targ, float f)
44 // TODO route through PlayerScores instead
52 PlayerScore_Add(attacker, SP_SUICIDES, 1);
57 PlayerScore_Add(attacker, SP_KILLS, -1); // or maybe add a teamkills field?
63 PlayerScore_Add(attacker, SP_KILLS, 1);
66 PlayerScore_Add(targ, SP_DEATHS, 1);
69 if(cvar("g_arena_roundbased"))
72 // FIXME fix the mess this is (we have REAL points now!)
75 f = RunematchHandleFrags(attacker, targ, f);
79 f = kh_HandleFrags(attacker, targ, f);
85 tl = PlayerScore_Add(targ, SP_LMS_LIVES, -1);
86 if(tl < lms_lowest_lives)
87 lms_lowest_lives = tl;
91 lms_next_place = player_count;
92 PlayerScore_Add(targ, SP_LMS_RANK, lms_next_place); // won't ever spawn again
99 if(g_ctf_ignore_frags)
103 attacker.totalfrags += f;
106 UpdateFrags(attacker, f);
109 string AppendItemcodes(string s, entity player)
114 // w = player.switchweapon;
116 w = player.cnt; // previous weapon!
117 s = strcat(s, ftos(w));
118 if(time < player.strength_finished)
120 if(time < player.invincible_finished)
122 if(player.flagcarried != world)
124 if(player.BUTTON_CHAT)
129 s = strcat(s, "|", ftos(player.runes));
133 void LogDeath(string mode, float deathtype, entity killer, entity killed)
136 if(!cvar("sv_eventlog"))
138 s = strcat(":kill:", mode);
139 s = strcat(s, ":", ftos(killer.playerid));
140 s = strcat(s, ":", ftos(killed.playerid));
141 s = strcat(s, ":type=", ftos(deathtype));
142 s = strcat(s, ":items=");
143 s = AppendItemcodes(s, killer);
146 s = strcat(s, ":victimitems=");
147 s = AppendItemcodes(s, killed);
152 void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
157 if (targ.classname == "player" || targ.classname == "corpse")
159 if (targ.classname == "corpse")
163 a = attacker.netname;
165 if (targ == attacker)
167 if (deathtype == DEATH_TEAMCHANGE) {
168 centerprint(targ, strcat("You are now on: ", ColoredTeamName(targ.team)));
169 } else if (deathtype == DEATH_AUTOTEAMCHANGE) {
170 centerprint(targ, strcat("You have been moved into a different team to improve team balance\nYou are now on: ", ColoredTeamName(targ.team)));
172 } else if (deathtype == DEATH_CAMP) {
174 centerprint(targ, "^1Reconsider your tactics, camper!\n\n\n");
176 centerprint(targ, "^1Die camper!\n\n\n");
177 } else if (deathtype == DEATH_NOAMMO) {
179 centerprint(targ, "^1You are reinserted into the game for running out of ammo...\n\n\n");
181 centerprint(targ, "^1You were killed for running out of ammo...\n\n\n");
182 } else if (deathtype == DEATH_ROT) {
184 centerprint(targ, "^1You need to preserve your health\n\n\n");
186 centerprint(targ, "^1You grew too old without taking your medicine\n\n\n");
187 } else if (deathtype == DEATH_MIRRORDAMAGE) {
189 centerprint(targ, "^1Don't go against team mates!\n\n\n");
191 centerprint(targ, "^1Don't shoot your team mates!\n\n\n");
194 centerprint(targ, "^1You need to be more careful!\n\n\n");
196 centerprint(targ, "^1You killed your own dumb self!\n\n\n");
200 if (deathtype == DEATH_CAMP)
201 bprint ("^1",s, "^1 thought he found a nice camping ground\n");
202 else if (deathtype == DEATH_MIRRORDAMAGE)
203 bprint ("^1",s, "^1 didn't become friends with the Lord of Teamplay\n");
205 bprint ("^1",s, "^1 will be reinserted into the game due to his own actions\n");
207 if(deathtype != DEATH_TEAMCHANGE)
209 LogDeath("suicide", deathtype, targ, targ);
210 GiveFrags(attacker, targ, -1);
212 if (targ.killcount > 2)
213 bprint ("^1",s,"^1 ended it all with a ",ftos(targ.killcount)," scoring spree\n");
215 if(deathtype < DEATH_SPECIAL_START && deathtype & DEATH_WEAPONMASK >= WEP_FIRST && deathtype & DEATH_WEAPONMASK <= WEP_LAST)
217 w_deathtypestring = "couldn't resist the urge to self-destruct";
218 w_deathtype = deathtype;
219 weapon_action(deathtype & DEATH_WEAPONMASK, WR_SUICIDEMESSAGE);
220 bprint("^1", s, "^1 ", w_deathtypestring, "\n");
222 else if (deathtype == DEATH_KILL)
223 bprint ("^1",s, "^1 couldn't take it anymore\n");
224 else if (deathtype == DEATH_ROT)
225 bprint ("^1",s, "^1 died\n");
226 else if (deathtype == DEATH_NOAMMO)
228 bprint ("^7",s, " ^7committed suicide. What's the point of living without ammo?\n");
230 else if (deathtype == DEATH_CAMP)
231 bprint ("^1",s, "^1 thought he found a nice camping ground\n");
232 else if (deathtype == DEATH_MIRRORDAMAGE)
233 bprint ("^1",s, "^1 didn't become friends with the Lord of Teamplay\n");
234 else if (deathtype != DEATH_TEAMCHANGE)
235 bprint ("^1",s, "^1 couldn't resist the urge to self-destruct\n");
237 if(deathtype != DEATH_TEAMCHANGE)
239 LogDeath("suicide", deathtype, targ, targ);
240 GiveFrags(attacker, targ, -1);
242 if (targ.killcount > 2)
243 bprint ("^1",s,"^1 ended it all with a ",ftos(targ.killcount)," kill spree\n");
246 else if (attacker.classname == "player" || attacker.classname == "gib")
248 if(teamplay && attacker.team == targ.team)
251 centerprint(attacker, "^1Moron! You went against a teammate!\n\n\n");
252 bprint ("^1", a, "^1 took action against a teammate\n");
254 centerprint(attacker, "^1Moron! You fragged a teammate!\n\n\n");
255 bprint ("^1", a, "^1 mows down a teammate\n");
257 GiveFrags(attacker, targ, -1);
258 if (targ.killcount > 2) {
260 bprint ("^1",s,"'s ^1",ftos(targ.killcount)," scoring spree was ended by a teammate!\n");
262 bprint ("^1",s,"'s ^1",ftos(targ.killcount)," kill spree was ended by a teammate!\n");
264 if (attacker.killcount > 2) {
266 bprint ("^1",a,"^1 ended a ",ftos(attacker.killcount)," scoring spree by going against a teammate\n");
268 bprint ("^1",a,"^1 ended a ",ftos(attacker.killcount)," kill spree by killing a teammate\n");
270 attacker.killcount = 0;
272 LogDeath("tk", deathtype, attacker, targ);
276 if (!checkrules_firstblood)
278 checkrules_firstblood = TRUE;
280 bprint("^1",a, "^1 was the first to score", "\n");
282 bprint("^1",a, "^1 drew first blood", "\n");
286 centerprint(attacker, strcat("^4You scored against ^7", s, "\n\n\n"));
287 centerprint(targ, strcat(a,"^1 scored against you ^7\n\n\n"));
289 centerprint(attacker, strcat("^4You fragged ^7", s, "\n\n\n"));
290 centerprint(targ, strcat("^1You were fragged by ^7", a, "\n\n\n"));
294 bprint ("^1",s, "^1 needs a restart thanks to ", a, "\n");
296 if(deathtype < DEATH_SPECIAL_START && deathtype & DEATH_WEAPONMASK >= WEP_FIRST && deathtype & DEATH_WEAPONMASK <= WEP_LAST)
298 w_deathtypestring = "was blasted by";
299 w_deathtype = deathtype;
300 weapon_action(deathtype & DEATH_WEAPONMASK, WR_KILLMESSAGE);
301 p = strstrofs(w_deathtypestring, "#", 0);
303 bprint("^1", s, "^1 ", w_deathtypestring, " ", a, "\n");
305 bprint("^1", s, "^1 ", substring(w_deathtypestring, 0, p), a, "^1", substring(w_deathtypestring, p+1, strlen(w_deathtypestring) - (p+1)), "\n");
307 else if (deathtype == DEATH_TELEFRAG)
308 bprint ("^1",s, "^1 was telefragged by ", a, "\n");
309 else if (deathtype == DEATH_DROWN)
310 bprint ("^1",s, "^1 was drowned by ", a, "\n");
311 else if (deathtype == DEATH_SLIME)
312 bprint ("^1",s, "^1 was slimed by ", a, "\n");
313 else if (deathtype == DEATH_LAVA)
314 bprint ("^1",s, "^1 was cooked by ", a, "\n");
315 else if (deathtype == DEATH_FALL)
316 bprint ("^1",s, "^1 was grounded by ", a, "\n");
317 else if (deathtype == DEATH_SHOOTING_STAR)
318 bprint ("^1",s, "^1 was shot into space by ", a, "\n");
319 else if (deathtype == DEATH_SWAMP)
320 bprint ("^1",s, "^1 was conserved by ", a, "\n");
321 else if (deathtype == DEATH_HURTTRIGGER && attacker.message2 != "")
323 p = strstrofs(inflictor.message2, "#", 0);
325 bprint("^1", s, "^1 ", inflictor.message2, " ", a, "\n");
327 bprint("^1", s, "^1 ", substring(inflictor.message2, 0, p), a, "^1", substring(inflictor.message2, p+1, strlen(inflictor.message2) - (p+1)), "\n");
329 else if(deathtype == DEATH_TURRET)
330 bprint ("^1",s, "^1 was pushed into the line of fire by ^1", a, "\n");
332 bprint ("^1",s, "^1 was fragged by ", a, "\n");
334 if(g_ctf && targ.flagcarried)
336 UpdateFrags(attacker, ctf_score_value("score_kill"));
337 PlayerScore_Add(attacker, SP_CTF_FCKILLS, 1);
338 GiveFrags(attacker, targ, 0); // for logging
341 GiveFrags(attacker, targ, 1);
342 if (targ.killcount > 2) {
344 bprint ("^1",s,"'s ^1", ftos(targ.killcount), " scoring spree was ended by ", a, "\n");
346 bprint ("^1",s,"'s ^1", ftos(targ.killcount), " kill spree was ended by ", a, "\n");
348 attacker.killcount = attacker.killcount + 1;
349 if (attacker.killcount > 2) {
351 bprint ("^1",a,"^1 made ",ftos(attacker.killcount)," scores in a row\n");
353 bprint ("^1",a,"^1 has ",ftos(attacker.killcount)," frags in a row\n");
356 LogDeath("frag", deathtype, attacker, targ);
358 if (attacker.killcount == 3)
361 bprint (a,"^7 made a ^1TRIPLE SCORE\n");
363 bprint (a,"^7 made a ^1TRIPLE FRAG\n");
364 announce(attacker, "announcer/male/03kills.ogg");
367 else if (attacker.killcount == 5)
370 bprint (a,"^7 unleashes ^1SCORING RAGE\n");
372 bprint (a,"^7 unleashes ^1RAGE\n");
373 announce(attacker, "announcer/male/05kills.ogg");
376 else if (attacker.killcount == 10)
379 bprint (a,"^7 made ^1TEN SCORES IN A ROW!\n");
381 bprint (a,"^7 starts the ^1MASSACRE!\n");
382 announce(attacker, "announcer/male/10kills.ogg");
385 else if (attacker.killcount == 15)
388 bprint (a,"^7 made ^1FIFTEEN SCORES IN A ROW!\n");
390 bprint (a,"^7 executes ^1MAYHEM!\n");
391 announce(attacker, "announcer/male/15kills.ogg");
394 else if (attacker.killcount == 20)
397 bprint (a,"^7 made ^1TWENTY SCORES IN A ROW!\n");
399 bprint (a,"^7 is a ^1BERSERKER!\n");
400 announce(attacker, "announcer/male/20kills.ogg");
403 else if (attacker.killcount == 25)
406 bprint (a,"^7 made ^1TWENTY FIFE SCORES IN A ROW!\n");
408 bprint (a,"^7 inflicts ^1CARNAGE!\n");
409 announce(attacker, "announcer/male/25kills.ogg");
412 else if (attacker.killcount == 30)
415 bprint (a,"^7 made ^1THIRTY SCORES IN A ROW!\n");
417 bprint (a,"^7 unleashes ^1ARMAGEDDON!\n");
418 announce(attacker, "announcer/male/30kills.ogg");
425 centerprint(targ, "^1Watch your step!\n\n\n");
426 if (deathtype == DEATH_HURTTRIGGER && attacker.message != "")
427 bprint ("^1",s, "^1 ", attacker.message, "\n");
428 else if (deathtype == DEATH_DROWN)
430 bprint ("^1",s, "^1 was in the water for too long\n");
432 bprint ("^1",s, "^1 drowned\n");
433 else if (deathtype == DEATH_SLIME)
434 bprint ("^1",s, "^1 was slimed\n");
435 else if (deathtype == DEATH_LAVA)
437 bprint ("^1",s, "^1 found a hot place\n");
439 bprint ("^1",s, "^1 turned into hot slag\n");
440 else if (deathtype == DEATH_FALL)
442 bprint ("^1",s, "^1 tested gravity (and it worked)\n");
444 bprint ("^1",s, "^1 hit the ground with a crunch\n");
445 else if (deathtype == DEATH_SHOOTING_STAR)
446 bprint ("^1",s, "^1 became a shooting star\n");
447 else if (deathtype == DEATH_SWAMP)
449 bprint ("^1",s, "^1 discovered a swamp\n");
451 bprint ("^1",s, "^1 is now conserved for centuries to come\n");
452 else if(deathtype == DEATH_TURRET)
453 bprint ("^1",s, "^1 was mowed down by a turret \n");
456 bprint ("^1",s, "^1 needs a restart\n");
458 bprint ("^1",s, "^1 died\n");
459 GiveFrags(targ, targ, -1);
460 if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) {
461 announce(targ, "announcer/male/botlike.ogg");
464 if (targ.killcount > 2)
466 bprint ("^1",s,"^1 needs a restart after a ",ftos(targ.killcount)," scoring spree\n");
468 bprint ("^1",s,"^1 died with a ",ftos(targ.killcount)," kill spree\n");
470 LogDeath("accident", deathtype, targ, targ);
472 targ.death_origin = targ.origin;
474 targ.killer_origin = attacker.origin;
475 // FIXME: this should go in PutClientInServer
481 // these are updated by each Damage call for use in button triggering and such
483 entity damage_inflictor;
484 entity damage_attacker;
486 void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
490 entity attacker_save;
494 if (gameover || targ.killcount == -666)
497 local entity oldself;
501 damage_inflictor = inflictor;
502 damage_attacker = attacker;
503 attacker_save = attacker;
505 if(deathtype == DEATH_KILL || deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
507 // These are ALWAYS lethal
508 // No damage modification here
509 // Instead, prepare the victim for his death...
511 targ.spawnshieldtime = 0;
512 targ.health = 0.9; // this is < 1
513 targ.flags -= targ.flags & FL_GODMODE;
516 else if(deathtype == DEATH_MIRRORDAMAGE)
522 if (targ.classname == "player")
523 if (attacker.classname == "player")
526 damage = damage * bound(0.1, (skill + 5) * 0.1, 1);
528 // nullify damage if teamplay is on
529 if(deathtype != DEATH_TELEFRAG)
530 if(attacker.classname == "player")
532 if(targ.classname == "player" && targ != attacker && (IS_INDEPENDENT_PLAYER(attacker) || IS_INDEPENDENT_PLAYER(targ)))
537 else if(attacker.team == targ.team)
541 else if(attacker != targ)
545 else if(teamplay == 4)
547 if(targ.classname == "player" && targ.deadflag == DEAD_NO)
549 mirrordamage = cvar("g_mirrordamage") * damage;
550 mirrorforce = cvar("g_mirrordamage") * vlen(force);
553 if(cvar("g_friendlyfire") == 0)
557 damage = cvar("g_friendlyfire") * damage;
558 // mirrordamage will be used LATER
567 if(targ.classname == "player")
568 if(attacker.classname == "player")
571 targ.lms_traveled_distance = cvar("g_lms_campcheck_distance");
572 attacker.lms_traveled_distance = cvar("g_lms_campcheck_distance");
578 if(targ.classname == "player")
580 attacker.hitsound += 1;
584 if ((deathtype == DEATH_FALL) ||
585 (deathtype == DEATH_DROWN) ||
586 (deathtype == DEATH_SLIME) ||
587 (deathtype == DEATH_LAVA))
592 if (targ.armorvalue && (deathtype == WEP_MINSTANEX) && damage)
594 targ.armorvalue -= 1;
595 centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.armorvalue),"\n"));
599 if (deathtype == WEP_LASER)
602 if (targ != attacker)
604 if (targ.classname == "player")
605 centerprint(attacker, "Secondary fire inflicts no damage!\n");
615 // apply strength multiplier
616 if (attacker.items & IT_STRENGTH && !g_minstagib)
620 damage = damage * cvar("g_balance_powerup_strength_selfdamage");
621 force = force * cvar("g_balance_powerup_strength_selfforce");
625 damage = damage * cvar("g_balance_powerup_strength_damage");
626 force = force * cvar("g_balance_powerup_strength_force");
630 // apply invincibility multiplier
631 if (targ.items & IT_INVINCIBLE && !g_minstagib)
632 damage = damage * cvar("g_balance_powerup_invincible_takedamage");
634 if (targ == attacker)
635 damage = damage * cvar("g_balance_selfdamagepercent"); // Partial damage if the attacker hits himself
637 // CTF: reduce damage/force
642 damage = damage * cvar("g_ctf_flagcarrier_selfdamage");
643 force = force * cvar("g_ctf_flagcarrier_selfforce");
648 // apply strength rune
649 if (attacker.runes & RUNE_STRENGTH)
651 if(attacker.runes & CURSE_WEAK) // have both curse & rune
653 damage = damage * cvar("g_balance_rune_strength_combo_damage");
654 force = force * cvar("g_balance_rune_strength_combo_force");
658 damage = damage * cvar("g_balance_rune_strength_damage");
659 force = force * cvar("g_balance_rune_strength_force");
662 else if (attacker.runes & CURSE_WEAK)
664 damage = damage * cvar("g_balance_curse_weak_damage");
665 force = force * cvar("g_balance_curse_weak_force");
668 // apply defense rune
669 if (targ.runes & RUNE_DEFENSE)
671 if (targ.runes & CURSE_VULNER) // have both curse & rune
672 damage = damage * cvar("g_balance_rune_defense_combo_takedamage");
674 damage = damage * cvar("g_balance_rune_defense_takedamage");
676 else if (targ.runes & CURSE_VULNER)
677 damage = damage * cvar("g_balance_curse_vulner_takedamage");
681 if(IsDifferentTeam(targ, attacker))
683 if(targ.takedamage == DAMAGE_AIM)
686 damage_goodhits += 1;
687 damage_gooddamage += damage;
694 if(targ.items & IT_STRENGTH)
698 // find height of hit on player axis
699 // if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot
700 vector headmins, headmaxs;
701 headmins = targ.origin + '0.5 0 0' * targ.mins_x + '0 0.5 0' * targ.mins_y + '0 0 1' * targ.view_ofs_z;
702 headmaxs = targ.origin + '0.5 0 0' * targ.maxs_x + '0 0.5 0' * targ.maxs_y + '0 0 1' * targ.maxs_z;
703 if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs))
709 if (self.damageforcescale)
712 self.velocity = self.velocity + self.damageforcescale * force;
713 self.flags = self.flags - (self.flags & FL_ONGROUND);
717 if (self.event_damage)
718 self.event_damage (inflictor, attacker, damage, deathtype, hitloc, force);
721 if(targ.classname == "player" && attacker.classname == "player" && attacker != targ && attacker.health > 2)
723 // Savage: vampire mode
726 if (time > self.spawnshieldtime)
728 attacker.health += damage;
732 if (attacker.runes & RUNE_VAMPIRE)
734 // apply vampire rune
735 if (attacker.runes & CURSE_EMPATHY) // have the curse too
737 //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb");
738 attacker.health = bound(
739 cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 40
740 attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb"),
741 cvar("g_balance_rune_vampire_maxhealth")); // LA: was 1000, now 500
745 //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_absorb");
746 attacker.health = bound(
747 attacker.health, // LA: was 3, but changed so that you can't lose health
748 // empathy won't let you gain health in the same way...
749 attacker.health + damage * cvar("g_balance_rune_vampire_absorb"),
750 cvar("g_balance_rune_vampire_maxhealth")); // LA: was 1000, now 500
753 // apply empathy curse
754 else if (attacker.runes & CURSE_EMPATHY)
756 attacker.health = bound(
757 cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 20
758 attacker.health + damage * cvar("g_balance_curse_empathy_takedamage"),
764 // apply mirror damage if any
765 if(mirrordamage > 0 || mirrorforce > 0)
767 attacker = attacker_save;
771 // just lose extra LIVES, don't kill the player for mirror damage
772 if(attacker.armorvalue > 0)
774 attacker.armorvalue = attacker.armorvalue - 1;
775 centerprint(attacker, strcat("^3Remaining extra lives: ",ftos(attacker.armorvalue),"\n"));
776 attacker.hitsound += 1;
780 force = normalize(attacker.origin + attacker.view_ofs - hitloc) * mirrorforce;
781 Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE, attacker.origin, force);
785 vector NearestPointOnBox(entity box, vector org)
787 vector m1, m2, nearest;
789 m1 = box.mins + box.origin;
790 m2 = box.maxs + box.origin;
792 nearest_x = bound(m1_x, org_x, m2_x);
793 nearest_y = bound(m1_y, org_y, m2_y);
794 nearest_z = bound(m1_z, org_z, m2_z);
799 float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype, entity directhitentity)
800 // Returns total damage applies to creatures
810 float total_damage_to_creatures;
812 blastorigin = (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5);
813 total_damage_to_creatures = 0;
815 targ = findradius (blastorigin, rad);
818 if (targ != inflictor)
821 // LordHavoc: measure distance to nearest point on target (not origin)
822 // (this guarentees 100% damage on a touch impact)
823 nearest = NearestPointOnBox(targ, blastorigin);
824 diff = nearest - blastorigin;
825 // round up a little on the damage to ensure full damage on impacts
826 // and turn the distance into a fraction of the radius
827 power = 1 - ((vlen (diff) - 2) / rad);
829 //bprint(ftos(power));
834 finaldmg = coredamage * power + edgedamage * (1 - power);
837 center = targ.origin + (targ.mins + targ.maxs) * 0.5;
838 // if it's a player, use the view origin as reference
839 if (targ.classname == "player")
840 center = targ.origin + targ.view_ofs;
841 force = normalize(center - blastorigin) * (finaldmg / coredamage) * forceintensity;
842 // test line of sight to multiple positions on box,
843 // and do damage if any of them hit
845 c = ceil(finaldmg / 10);
851 traceline(blastorigin, nearest, TRUE, inflictor);
852 if (trace_fraction == 1 || trace_ent == targ
853 || cvar("g_throughfloor"))
856 total_damage_to_creatures += finaldmg;
857 if(targ == directhitentity)
858 Damage (targ, inflictor, attacker, finaldmg, deathtype, nearest, force);
860 Damage (targ, inflictor, attacker, finaldmg, deathtype | HITTYPE_SPLASH, nearest, force);
863 nearest_x = targ.mins_x + random() * targ.size_x;
864 nearest_y = targ.mins_y + random() * targ.size_y;
865 nearest_z = targ.mins_z + random() * targ.size_z;
873 return total_damage_to_creatures;