2 float checkrules_firstblood;
6 void announce(entity player, string msg)
8 if(time > player.announcetime)
9 if(clienttype(player) == CLIENTTYPE_REAL)
11 player.announcetime = time + 0.3;
16 float IsDifferentTeam(entity a, entity b)
31 float IsFlying(entity a)
33 if(a.flags & FL_ONGROUND)
37 traceline(a.origin, a.origin - '0 0 48', MOVE_NORMAL, a);
38 if(trace_fraction < 1)
43 void UpdateFrags(entity player, float f)
45 PlayerTeamScore_AddScore(player, f);
48 void GiveFrags (entity attacker, entity targ, float f)
50 // TODO route through PlayerScores instead
54 if(cvar("g_arena_roundbased"))
57 // FIXME fix the mess this is (we have REAL points now!)
60 if(cvar("g_domination_disable_frags"))
67 f = RunematchHandleFrags(attacker, targ, f);
71 f = kh_HandleFrags(attacker, targ, f);
75 // FIXME fix LMS mode for new scoreboard
76 // count remaining lives, not frags in lms
78 // keep track of the worst players lives
79 if(targ.frags < lms_lowest_lives)
80 lms_lowest_lives = targ.frags;
81 // player has no more lives left
85 lms_next_place = player_count;
86 targ.frags = -lms_next_place;
93 UpdateFrags(attacker, f);
96 string AppendItemcodes(string s, entity player)
101 // w = player.switchweapon;
103 w = player.cnt; // previous weapon!
104 s = strcat(s, ftos(W_ItemCode(w)));
105 if(time < player.strength_finished)
107 if(time < player.invincible_finished)
109 if(player.flagcarried != world)
111 if(player.BUTTON_CHAT)
116 s = strcat(s, "|", ftos(player.runes));
120 void LogDeath(string mode, float deathtype, entity killer, entity killed)
123 if(!cvar("sv_eventlog"))
125 s = strcat(":kill:", mode);
126 s = strcat(s, ":", ftos(killer.playerid));
127 s = strcat(s, ":", ftos(killed.playerid));
128 s = strcat(s, ":type=", ftos(deathtype));
129 s = strcat(s, ":items=");
130 s = AppendItemcodes(s, killer);
133 s = strcat(s, ":victimitems=");
134 s = AppendItemcodes(s, killed);
136 GameLogEcho(s, FALSE);
139 void Obituary (entity attacker, entity targ, float deathtype)
143 if (targ.classname == "player" || targ.classname == "corpse")
145 if (targ.classname == "corpse")
149 a = attacker.netname;
151 if (targ == attacker)
153 if (deathtype == DEATH_TEAMCHANGE) {
154 centerprint(targ, strcat("You are now on: ", ColoredTeamName(targ.team)));
155 } else if (deathtype == DEATH_AUTOTEAMCHANGE) {
156 centerprint(targ, strcat("You have been moved into a different team to improve team balance\nYou are now on: ", ColoredTeamName(targ.team)));
158 } else if (deathtype == DEATH_CAMP) {
160 centerprint(targ, "^1Reconsider your tactics, camper!\n\n\n");
162 centerprint(targ, "^1Die camper!\n\n\n");
163 } else if (deathtype == DEATH_NOAMMO) {
165 centerprint(targ, "^1You are reinserted into the game for running out of ammo...\n\n\n");
167 centerprint(targ, "^1You were killed for running out of ammo...\n\n\n");
168 } else if (deathtype == DEATH_ROT) {
170 centerprint(targ, "^1You need to preserve your health\n\n\n");
172 centerprint(targ, "^1You grew too old without taking your medicine\n\n\n");
173 } else if (deathtype == DEATH_MIRRORDAMAGE) {
175 centerprint(targ, "^1Don't go against team mates!\n\n\n");
177 centerprint(targ, "^1Don't shoot your team mates!\n\n\n");
180 centerprint(targ, "^1You need to be more careful!\n\n\n");
182 centerprint(targ, "^1You killed your own dumb self!\n\n\n");
186 if (deathtype == DEATH_CAMP)
187 bprint ("^1",s, "^1 thought he found a nice camping ground\n");
188 else if (deathtype == DEATH_MIRRORDAMAGE)
189 bprint ("^1",s, "^1 didn't become friends with the Lord of Teamplay\n");
191 bprint ("^1",s, "^1 will be reinserted into the game due to his own actions\n");
193 if(deathtype != DEATH_TEAMCHANGE)
195 LogDeath("suicide", deathtype, targ, targ);
196 PlayerScore_Add(attacker, SP_SUICIDES, 1);
197 PlayerScore_Add(attacker, SP_DEATHS, 1);
198 GiveFrags(attacker, targ, -1);
200 if (targ.killcount > 2)
201 bprint ("^1",s,"^1 ended it all with a ",ftos(targ.killcount)," scoring spree\n");
204 if (deathtype == IT_GRENADE_LAUNCHER)
205 bprint ("^1",s, "^1 detonated\n");
206 else if (deathtype == IT_ELECTRO)
207 bprint ("^1",s, "^1 played with plasma\n");
208 else if (deathtype == IT_ROCKET_LAUNCHER)
209 bprint ("^1",s, "^1 exploded\n");
210 else if (deathtype == DEATH_KILL)
211 bprint ("^1",s, "^1 couldn't take it anymore\n");
212 else if (deathtype == DEATH_ROT)
213 bprint ("^1",s, "^1 died\n");
214 else if (deathtype == DEATH_NOAMMO)
216 bprint ("^7",s, " ^7committed suicide. What's the point of living without ammo?\n");
217 //sound (self, CHAN_BODY, "minstagib/mockery.wav", 1, ATTN_NONE);
219 else if (deathtype == DEATH_CAMP)
220 bprint ("^1",s, "^1 thought he found a nice camping ground\n");
221 else if (deathtype == DEATH_MIRRORDAMAGE)
222 bprint ("^1",s, "^1 didn't become friends with the Lord of Teamplay\n");
223 else if (deathtype != DEATH_TEAMCHANGE)
224 bprint ("^1",s, "^1 couldn't resist the urge to self-destruct\n");
226 if(deathtype != DEATH_TEAMCHANGE)
228 LogDeath("suicide", deathtype, targ, targ);
229 PlayerScore_Add(targ, SP_SUICIDES, 1);
230 PlayerScore_Add(targ, SP_DEATHS, 1);
231 GiveFrags(attacker, targ, -1);
233 if (targ.killcount > 2)
234 bprint ("^1",s,"^1 ended it all with a ",ftos(targ.killcount)," kill spree\n");
237 else if (attacker.classname == "player" || attacker.classname == "gib")
239 if(teamplay && attacker.team == targ.team)
242 centerprint(attacker, "^1Moron! You went against a teammate!\n\n\n");
243 bprint ("^1", a, "^1 took action against a teammate\n");
245 centerprint(attacker, "^1Moron! You fragged a teammate!\n\n\n");
246 bprint ("^1", a, "^1 mows down a teammate\n");
248 GiveFrags(attacker, targ, -1);
249 PlayerScore_Add(attacker, SP_KILLS, -1); // teamkills DO cound as -1 kill right? or make separate teamkill counter?
250 if (targ.killcount > 2) {
252 bprint ("^1",s,"'s ^1",ftos(targ.killcount)," scoring spree was ended by a teammate!\n");
254 bprint ("^1",s,"'s ^1",ftos(targ.killcount)," kill spree was ended by a teammate!\n");
256 if (attacker.killcount > 2) {
258 bprint ("^1",a,"^1 ended a ",ftos(attacker.killcount)," scoring spree by going against a teammate\n");
260 bprint ("^1",a,"^1 ended a ",ftos(attacker.killcount)," kill spree by killing a teammate\n");
262 attacker.killcount = 0;
264 LogDeath("tk", deathtype, attacker, targ);
268 if (!checkrules_firstblood)
270 checkrules_firstblood = TRUE;
271 //sound(world, CHAN_AUTO, "announcer/firstblood.wav", 1, ATTN_NONE);
273 //sound(world, CHAN_AUTO, "announce/male/mapkill1.wav", 1, ATTN_NONE);
275 bprint("^1",a, "^1 was the first to score", "\n");
277 bprint("^1",a, "^1 drew first blood", "\n");
281 centerprint(attacker, strcat("^4You scored against ^7", s, "\n\n\n"));
282 centerprint(targ, strcat(a,"^1 scored against you ^7\n\n\n"));
284 centerprint(attacker, strcat("^4You fragged ^7", s, "\n\n\n"));
285 centerprint(targ, strcat("^1You were fragged by ^7", a, "\n\n\n"));
289 bprint ("^1",s, "^1 needs a restart thanks to ", a, "\n");
291 if (deathtype == IT_LASER)
292 bprint ("^1",s, "^1 was blasted by ", a, "\n");
293 else if (deathtype == IT_UZI)
294 bprint ("^1",s, "^1 was riddled full of holes by ", a, "\n");
295 else if (deathtype == IT_SHOTGUN)
296 bprint ("^1",s, "^1 was gunned by ", a, "\n");
297 else if (deathtype == IT_GRENADE_LAUNCHER)
298 bprint ("^1", s, "^1 was blasted by ", a, "\n");
299 else if (deathtype == IT_ELECTRO)
300 bprint ("^1",s, "^1 was blasted by ", a, "\n");
301 else if (deathtype == IT_CRYLINK)
302 bprint ("^1",s, "^1 was blasted by ", a, "\n");
303 else if (deathtype == IT_NEX)
304 bprint ("^1",s, "^1 has been vaporized by ", a, "\n");
305 else if (deathtype == IT_HAGAR)
306 bprint ("^1",s, "^1 was pummeled by ", a, "\n");
307 else if (deathtype == IT_ROCKET_LAUNCHER)
308 bprint ("^1",s, "^1 was blasted by ", a, "\n");
309 else if (deathtype == DEATH_TELEFRAG)
310 bprint ("^1",s, "^1 was telefragged by ", a, "\n");
311 else if (deathtype == DEATH_DROWN)
312 bprint ("^1",s, "^1 was drowned by ", a, "\n");
313 else if (deathtype == DEATH_SLIME)
314 bprint ("^1",s, "^1 was slimed by ", a, "\n");
315 else if (deathtype == DEATH_LAVA)
316 bprint ("^1",s, "^1 was cooked by ", a, "\n");
317 else if (deathtype == DEATH_FALL)
318 bprint ("^1",s, "^1 was grounded by ", a, "\n");
319 else if (deathtype == DEATH_SHOOTING_STAR)
320 bprint ("^1",s, "^1 was shot into space by ", a, "\n");
321 else if (deathtype == DEATH_SWAMP)
322 bprint ("^1",s, "^1 was conserved by ", a, "\n");
323 else if (deathtype == DEATH_HURTTRIGGER)
324 bprint ("^1",s, "^1 was thrown into a world of hurt by ", a, "\n");
325 else if(deathtype == DEATH_TURRET)
326 bprint ("^1",s, "^1 was pushed into the line of fire by ^1", a, "\n");
328 bprint ("^1",s, "^1 was fragged by ", a, "\n");
330 if(g_ctf && targ.flagcarried)
332 GiveFrags(attacker, targ, cvar("g_ctf_flagscore_kill"));
333 PlayerScore_Add(attacker, SP_CTF_CARRIERKILLS, 1);
336 GiveFrags(attacker, targ, 1);
337 PlayerScore_Add(attacker, SP_KILLS, 1);
338 if (targ.killcount > 2) {
340 bprint ("^1",s,"'s ^1", ftos(targ.killcount), " scoring spree was ended by ", a, "\n");
342 bprint ("^1",s,"'s ^1", ftos(targ.killcount), " kill spree was ended by ", a, "\n");
344 attacker.killcount = attacker.killcount + 1;
345 if (attacker.killcount > 2) {
347 bprint ("^1",a,"^1 made ",ftos(attacker.killcount)," scores in a row\n");
349 bprint ("^1",a,"^1 has ",ftos(attacker.killcount)," frags in a row\n");
352 LogDeath("frag", deathtype, attacker, targ);
354 if (attacker.killcount == 3)
357 bprint (a,"^7 made a ^1TRIPLE SCORE\n");
359 bprint (a,"^7 made a ^1TRIPLE FRAG\n");
360 announce(attacker, "announcer/male/03kills.ogg");
363 else if (attacker.killcount == 5)
366 bprint (a,"^7 unleashes ^1SCORING RAGE\n");
368 bprint (a,"^7 unleashes ^1RAGE\n");
369 announce(attacker, "announcer/male/05kills.ogg");
372 else if (attacker.killcount == 10)
375 bprint (a,"^7 made ^1TEN SCORES IN A ROW!\n");
377 bprint (a,"^7 starts the ^1MASSACRE!\n");
378 announce(attacker, "announcer/male/10kills.ogg");
381 else if (attacker.killcount == 15)
384 bprint (a,"^7 made ^1FIFTEEN SCORES IN A ROW!\n");
386 bprint (a,"^7 executes ^1MAYHEM!\n");
387 announce(attacker, "announcer/male/15kills.ogg");
390 else if (attacker.killcount == 20)
393 bprint (a,"^7 made ^1TWENTY SCORES IN A ROW!\n");
395 bprint (a,"^7 is a ^1BERSERKER!\n");
396 announce(attacker, "announcer/male/20kills.ogg");
399 else if (attacker.killcount == 25)
402 bprint (a,"^7 made ^1TWENTY FIFE SCORES IN A ROW!\n");
404 bprint (a,"^7 inflicts ^1CARNAGE!\n");
405 announce(attacker, "announcer/male/25kills.ogg");
408 else if (attacker.killcount == 30)
411 bprint (a,"^7 made ^1THIRTY SCORES IN A ROW!\n");
413 bprint (a,"^7 unleashes ^1ARMAGEDDON!\n");
414 announce(attacker, "announcer/male/30kills.ogg");
421 centerprint(targ, "^1Watch your step!\n\n\n");
422 if (deathtype == DEATH_HURTTRIGGER && attacker.message != "")
423 bprint ("^1",s, "^1 ", attacker.message, "\n");
424 else if (deathtype == DEATH_DROWN)
426 bprint ("^1",s, "^1 was in the water for too long\n");
428 bprint ("^1",s, "^1 drowned\n");
429 else if (deathtype == DEATH_SLIME)
430 bprint ("^1",s, "^1 was slimed\n");
431 else if (deathtype == DEATH_LAVA)
433 bprint ("^1",s, "^1 found a hot place\n");
435 bprint ("^1",s, "^1 turned into hot slag\n");
436 else if (deathtype == DEATH_FALL)
438 bprint ("^1",s, "^1 tested gravity (and it worked)\n");
440 bprint ("^1",s, "^1 hit the ground with a crunch\n");
441 else if (deathtype == DEATH_SHOOTING_STAR)
442 bprint ("^1",s, "^1 became a shooting star\n");
443 else if (deathtype == DEATH_SWAMP)
445 bprint ("^1",s, "^1 discovered a swamp\n");
447 bprint ("^1",s, "^1 is now conserved for centuries to come\n");
448 else if(deathtype == DEATH_TURRET)
449 bprint ("^1",s, "^1 was mowed down by a turret \n");
452 bprint ("^1",s, "^1 needs a restart\n");
454 bprint ("^1",s, "^1 died\n");
455 GiveFrags(targ, targ, -1);
456 PlayerScore_Add(targ, SP_SUICIDES, 1);
457 PlayerScore_Add(targ, SP_DEATHS, 1);
458 // FIXME move this into winning condition checking? or allow READING of the scores?
459 if(targ.frags == -5) {
460 announce(targ, "announcer/male/botlike.ogg");
463 if (targ.killcount > 2)
465 bprint ("^1",s,"^1 needs a restart after a ",ftos(targ.killcount)," scoring spree\n");
467 bprint ("^1",s,"^1 died with a ",ftos(targ.killcount)," kill spree\n");
469 LogDeath("accident", deathtype, targ, targ);
471 targ.death_origin = targ.origin;
473 targ.killer_origin = attacker.origin;
474 // FIXME: this should go in PutClientInServer
480 // these are updated by each Damage call for use in button triggering and such
482 entity damage_inflictor;
483 entity damage_attacker;
485 void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
489 entity attacker_save;
493 if (gameover || targ.killcount == -666)
496 local entity oldself;
500 damage_inflictor = inflictor;
501 damage_attacker = attacker;
502 attacker_save = attacker;
504 if(deathtype == DEATH_KILL || deathtype == DEATH_TEAMCHANGE || deathtype == DEATH_AUTOTEAMCHANGE)
506 // These are ALWAYS lethal
507 // No damage modification here
508 // Instead, prepare the victim for his death...
510 targ.spawnshieldtime = 0;
511 targ.health = 0.9; // this is < 1
512 targ.flags -= targ.flags & FL_GODMODE;
517 if (targ.classname == "player")
518 if (attacker.classname == "player")
521 damage = damage * bound(0.1, (skill + 5) * 0.1, 1);
523 // nullify damage if teamplay is on
524 if(deathtype != DEATH_TELEFRAG)
525 if(attacker.team == targ.team)
526 if(attacker.classname == "player")
530 else if(attacker != targ)
534 else if(teamplay == 4)
536 if(targ.classname == "player" && targ.deadflag == DEAD_NO)
538 mirrordamage = cvar("g_mirrordamage") * damage;
539 mirrorforce = cvar("g_mirrordamage") * vlen(force);
542 if(cvar("g_friendlyfire") == 0)
546 damage = cvar("g_friendlyfire") * damage;
547 // mirrordamage will be used LATER
556 if(targ.classname == "player")
557 if(attacker.classname == "player")
560 targ.lms_traveled_distance = cvar("g_lms_campcheck_distance");
561 attacker.lms_traveled_distance = cvar("g_lms_campcheck_distance");
567 if(targ.classname == "player")
569 attacker.hitsound += 1;
573 if ((deathtype == DEATH_FALL) ||
574 (deathtype == DEATH_DROWN) ||
575 (deathtype == DEATH_SLIME) ||
576 (deathtype == DEATH_LAVA))
578 if (targ.armorvalue && (deathtype == IT_NEX) && damage)
580 targ.armorvalue -= 1;
581 centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.armorvalue),"\n"));
585 else if (deathtype == IT_NEX && targ.items & IT_STRENGTH)
587 if(clienttype(attacker) == CLIENTTYPE_REAL)
588 if(IsDifferentTeam(targ, attacker))
591 if (deathtype == IT_LASER)
594 if (targ != attacker)
596 if (targ.classname == "player")
597 centerprint(attacker, "Secondary fire inflicts no damage!\n");
607 if(targ.takedamage == DAMAGE_AIM)
609 if(IsDifferentTeam(targ, attacker))
613 // apply strength multiplier
614 if (attacker.items & IT_STRENGTH && !g_minstagib)
616 damage = damage * cvar("g_balance_powerup_strength_damage");
617 force = force * cvar("g_balance_powerup_strength_force");
619 // apply invincibility multiplier
620 if (targ.items & IT_INVINCIBLE && !g_minstagib)
621 damage = damage * cvar("g_balance_powerup_invincible_takedamage");
626 // apply strength rune
627 if (attacker.runes & RUNE_STRENGTH)
629 if(attacker.runes & CURSE_WEAK) // have both curse & rune
631 damage = damage * cvar("g_balance_rune_strength_combo_damage");
632 force = force * cvar("g_balance_rune_strength_combo_force");
636 damage = damage * cvar("g_balance_rune_strength_damage");
637 force = force * cvar("g_balance_rune_strength_force");
640 else if (attacker.runes & CURSE_WEAK)
642 damage = damage * cvar("g_balance_curse_weak_damage");
643 force = force * cvar("g_balance_curse_weak_force");
646 // apply defense rune
647 if (targ.runes & RUNE_DEFENSE)
649 if (targ.runes & CURSE_VULNER) // have both curse & rune
650 damage = damage * cvar("g_balance_rune_defense_combo_takedamage");
652 damage = damage * cvar("g_balance_rune_defense_takedamage");
654 else if (targ.runes & CURSE_VULNER)
655 damage = damage * cvar("g_balance_curse_vulner_takedamage");
660 if (self.damageforcescale)
663 self.velocity = self.velocity + self.damageforcescale * force;
664 self.flags = self.flags - (self.flags & FL_ONGROUND);
667 if (self.event_damage)
668 self.event_damage (inflictor, attacker, damage, deathtype, hitloc, force);
671 if(targ.classname == "player" && attacker.classname == "player" && attacker != targ && attacker.health > 2)
673 // Savage: vampire mode
677 if (time > self.spawnshieldtime)
679 attacker.health += damage;
683 if (attacker.runes & RUNE_VAMPIRE)
685 // apply vampire rune
686 if (attacker.runes & CURSE_EMPATHY) // have the curse too
688 //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb");
689 attacker.health = bound(
690 cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 40
691 attacker.health + damage * cvar("g_balance_rune_vampire_combo_absorb"),
692 cvar("g_balance_rune_vampire_maxhealth")); // LA: was 1000, now 500
696 //attacker.health = attacker.health + damage * cvar("g_balance_rune_vampire_absorb");
697 attacker.health = bound(
698 attacker.health, // LA: was 3, but changed so that you can't lose health
699 // empathy won't let you gain health in the same way...
700 attacker.health + damage * cvar("g_balance_rune_vampire_absorb"),
701 cvar("g_balance_rune_vampire_maxhealth")); // LA: was 1000, now 500
704 // apply empathy curse
705 else if (attacker.runes & CURSE_EMPATHY)
707 attacker.health = bound(
708 cvar("g_balance_curse_empathy_minhealth"), // LA: was 3, now 20
709 attacker.health + damage * cvar("g_balance_curse_empathy_takedamage"),
715 // apply mirror damage if any
716 if(mirrordamage > 0 || mirrorforce > 0)
718 attacker = attacker_save;
722 // just lose extra LIVES, don't kill the player for mirror damage
723 if(attacker.armorvalue > 0)
725 attacker.armorvalue = attacker.armorvalue - 1;
726 centerprint(attacker, strcat("^3Remaining extra lives: ",ftos(attacker.armorvalue),"\n"));
727 attacker.hitsound += 1;
731 force = normalize(attacker.origin + attacker.view_ofs - hitloc) * mirrorforce;
732 Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE, attacker.origin, force);
736 vector NearestPointOnBox(entity box, vector org)
738 vector m1, m2, nearest;
740 m1 = box.mins + box.origin;
741 m2 = box.maxs + box.origin;
743 nearest_x = bound(m1_x, org_x, m2_x);
744 nearest_y = bound(m1_y, org_y, m2_y);
745 nearest_z = bound(m1_z, org_z, m2_z);
750 float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype)
751 // Returns total damage applies to creatures
761 float total_damage_to_creatures;
763 blastorigin = (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5);
764 total_damage_to_creatures = 0;
766 targ = findradius (blastorigin, rad);
769 if (targ != inflictor)
772 // LordHavoc: measure distance to nearest point on target (not origin)
773 // (this guarentees 100% damage on a touch impact)
774 nearest = NearestPointOnBox(targ, blastorigin);
775 diff = nearest - blastorigin;
776 // round up a little on the damage to ensure full damage on impacts
777 // and turn the distance into a fraction of the radius
778 power = 1 - ((vlen (diff) - 2) / rad);
780 //bprint(ftos(power));
785 finaldmg = coredamage * power + edgedamage * (1 - power);
788 center = targ.origin + (targ.mins + targ.maxs) * 0.5;
789 // if it's a player, use the view origin as reference
790 if (targ.classname == "player")
791 center = targ.origin + targ.view_ofs;
792 force = normalize(center - blastorigin) * (finaldmg / coredamage) * forceintensity;
793 if (targ == attacker)
794 finaldmg = finaldmg * cvar("g_balance_selfdamagepercent"); // Partial damage if the attacker hits himself
795 // test line of sight to multiple positions on box,
796 // and do damage if any of them hit
798 c = ceil(finaldmg / 10);
804 traceline(blastorigin, nearest, TRUE, inflictor);
805 if (trace_fraction == 1 || trace_ent == targ
806 || cvar("g_throughfloor"))
809 total_damage_to_creatures += finaldmg;
810 Damage (targ, inflictor, attacker, finaldmg, deathtype, nearest, force);
813 nearest_x = targ.mins_x + random() * targ.size_x;
814 nearest_y = targ.mins_y + random() * targ.size_y;
815 nearest_z = targ.mins_z + random() * targ.size_z;
823 return total_damage_to_creatures;