home *** CD-ROM | disk | FTP | other *** search
/ Qu-ake / Qu-ake.iso / qu_ke / patches / 023 / CLIENT.QC next >
Encoding:
Text File  |  1996-09-21  |  33.7 KB  |  1,464 lines

  1.  
  2. // prototypes
  3. void () W_WeaponFrame;
  4. void() W_SetCurrentAmmo;
  5. void() player_pain;
  6. void() player_stand1;
  7. void (vector org) spawn_tfog;
  8. void (vector org, entity death_owner) spawn_tdeath;
  9.  
  10. float   modelindex_eyes, modelindex_player;
  11.  
  12. //
  13. //FragReport mod
  14. // extern FragReport function declarations
  15. void(entity c) FragReportRegister;
  16. void(entity attacker, entity target) FragReportUpdate;
  17. void(entity c) FragReportLeave;
  18.  
  19. /*
  20. =============================================================================
  21.  
  22.                 LEVEL CHANGING / INTERMISSION
  23.  
  24. =============================================================================
  25. */
  26.  
  27. float   intermission_running;
  28. float   intermission_exittime;
  29.  
  30. /*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16)
  31. This is the camera point for the intermission.
  32. Use mangle instead of angle, so you can set pitch or roll as well as yaw.  'pitch roll yaw'
  33. */
  34. void() info_intermission =
  35. {
  36. };
  37.  
  38.  
  39.  
  40. void() SetChangeParms =
  41. {
  42. // remove items
  43.     self.items = self.items - (self.items & 
  44.     (IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
  45.     
  46. // cap super health
  47.     if (self.health > 100)
  48.         self.health = 100;
  49.     if (self.health < 50)
  50.         self.health = 50;
  51.     parm1 = self.items;
  52.     parm2 = self.health;
  53.     parm3 = self.armorvalue;
  54.     if (self.ammo_shells < 25)
  55.         parm4 = 25;
  56.     else
  57.         parm4 = self.ammo_shells;
  58.     parm5 = self.ammo_nails;
  59.     parm6 = self.ammo_rockets;
  60.     parm7 = self.ammo_cells;
  61.     parm8 = self.weapon;
  62.     parm9 = self.armortype * 100;
  63. };
  64.  
  65. void() SetNewParms =
  66. {
  67.     parm1 = IT_SHOTGUN | IT_AXE;
  68.     parm2 = 100;
  69.     parm3 = 0;
  70.     parm4 = 25;
  71.     parm5 = 0;
  72.     parm6 = 0;
  73.     parm6 = 0;
  74.     parm8 = 1;
  75.     parm9 = 0;
  76. };
  77.  
  78. void() DecodeLevelParms =
  79. {
  80.     if (serverflags)
  81.     {
  82.         if (world.model == "maps/start.bsp")
  83.             SetNewParms ();         // take away all stuff on starting new episode
  84.     }
  85.     
  86.     self.items = parm1;
  87.     self.health = parm2;
  88.     self.armorvalue = parm3;
  89.     self.ammo_shells = parm4;
  90.     self.ammo_nails = parm5;
  91.     self.ammo_rockets = parm6;
  92.     self.ammo_cells = parm7;
  93.     self.weapon = parm8;
  94.     self.armortype = parm9 * 0.01;
  95. };
  96.  
  97. /*
  98. ============
  99. FindIntermission
  100.  
  101. Returns the entity to view from
  102. ============
  103. */
  104. entity() FindIntermission =
  105. {
  106.     local   entity spot;
  107.     local   float cyc;
  108.  
  109. // look for info_intermission first
  110.     spot = find (world, classname, "info_intermission");
  111.     if (spot)
  112.     {       // pick a random one
  113.         cyc = random() * 4;
  114.         while (cyc > 1)
  115.         {
  116.             spot = find (spot, classname, "info_intermission");
  117.             if (!spot)
  118.                 spot = find (spot, classname, "info_intermission");
  119.             cyc = cyc - 1;
  120.         }
  121.         return spot;
  122.     }
  123.  
  124. // then look for the start position
  125.     spot = find (world, classname, "info_player_start");
  126.     if (spot)
  127.         return spot;
  128.     
  129. // testinfo_player_start is only found in regioned levels
  130.     spot = find (world, classname, "testplayerstart");
  131.     if (spot)
  132.         return spot;
  133.     
  134.     objerror ("FindIntermission: no spot");
  135. };
  136.  
  137.  
  138. string nextmap;
  139. void() GotoNextMap =
  140. {
  141.     if (cvar("samelevel"))  // if samelevel is set, stay on same level
  142.         changelevel (mapname);
  143.     else
  144.         changelevel (nextmap);
  145. };
  146.  
  147.  
  148. void() ExitIntermission =
  149. {
  150. // skip any text in deathmatch
  151.     if (deathmatch)
  152.     {
  153.         GotoNextMap ();
  154.         return;
  155.     }
  156.     
  157.     intermission_exittime = time + 1;
  158.     intermission_running = intermission_running + 1;
  159.  
  160. //
  161. // run some text if at the end of an episode
  162. //
  163.     if (intermission_running == 2)
  164.     {
  165.         if (world.model == "maps/e1m7.bsp")
  166.         {
  167.             WriteByte (MSG_ALL, SVC_CDTRACK);
  168.             WriteByte (MSG_ALL, 2);
  169.             WriteByte (MSG_ALL, 3);
  170.             if (!cvar("registered"))
  171.             {
  172.                 WriteByte (MSG_ALL, SVC_FINALE);
  173.                 WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task in the other three\nhaunted lands of Quake. Or are you? If\nyou don't register Quake, you'll never\nknow what awaits you in the Realm of\nBlack Magic, the Netherworld, and the\nElder World!");
  174.             }
  175.             else
  176.             {
  177.                 WriteByte (MSG_ALL, SVC_FINALE);
  178.                 WriteString (MSG_ALL, "As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task. A Rune of magic\npower lies at the end of each haunted\nland of Quake. Go forth, seek the\ntotality of the four Runes!");
  179.             }
  180.             return;
  181.         }
  182.         else if (world.model == "maps/e2m6.bsp")
  183.         {
  184.             WriteByte (MSG_ALL, SVC_CDTRACK);
  185.             WriteByte (MSG_ALL, 2);
  186.             WriteByte (MSG_ALL, 3);
  187.  
  188.             WriteByte (MSG_ALL, SVC_FINALE);
  189.             WriteString (MSG_ALL, "The Rune of Black Magic throbs evilly in\nyour hand and whispers dark thoughts\ninto your brain. You learn the inmost\nlore of the Hell-Mother; Shub-Niggurath!\nYou now know that she is behind all the\nterrible plotting which has led to so\nmuch death and horror. But she is not\ninviolate! Armed with this Rune, you\nrealize that once all four Runes are\ncombined, the gate to Shub-Niggurath's\nPit will open, and you can face the\nWitch-Goddess herself in her frightful\notherworld cathedral.");
  190.             return;
  191.         }
  192.         else if (world.model == "maps/e3m6.bsp")
  193.         {
  194.             WriteByte (MSG_ALL, SVC_CDTRACK);
  195.             WriteByte (MSG_ALL, 2);
  196.             WriteByte (MSG_ALL, 3);
  197.  
  198.             WriteByte (MSG_ALL, SVC_FINALE);
  199.             WriteString (MSG_ALL, "The charred viscera of diabolic horrors\nbubble viscously as you seize the Rune\nof Hell Magic. Its heat scorches your\nhand, and its terrible secrets blight\nyour mind. Gathering the shreds of your\ncourage, you shake the devil's shackles\nfrom your soul, and become ever more\nhard and determined to destroy the\nhideous creatures whose mere existence\nthreatens the souls and psyches of all\nthe population of Earth.");
  200.             return;
  201.         }
  202.         else if (world.model == "maps/e4m7.bsp")
  203.         {
  204.             WriteByte (MSG_ALL, SVC_CDTRACK);
  205.             WriteByte (MSG_ALL, 2);
  206.             WriteByte (MSG_ALL, 3);
  207.  
  208.             WriteByte (MSG_ALL, SVC_FINALE);
  209.             WriteString (MSG_ALL, "Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import. Patient and\npotent, the Elder Being Shub-Niggurath\nweaves her dire plans to clear off all\nlife from the Earth, and bring her own\nfoul offspring to our world! For all the\ndwellers in these nightmare dimensions\nare her descendants! Once all Runes of\nmagic power are united, the energy\nbehind them will blast open the Gateway\nto Shub-Niggurath, and you can travel\nthere to foil the Hell-Mother's plots\nin person.");
  210.             return;
  211.         }
  212.  
  213.         GotoNextMap();
  214.     }
  215.     
  216.     if (intermission_running == 3)
  217.     {
  218.         if (!cvar("registered"))
  219.         {       // shareware episode has been completed, go to sell screen
  220.             WriteByte (MSG_ALL, SVC_SELLSCREEN);
  221.             return;
  222.         }
  223.         
  224.         if ( (serverflags&15) == 15)
  225.         {
  226.             WriteByte (MSG_ALL, SVC_FINALE);
  227.             WriteString (MSG_ALL, "Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront her as an avatar of avenging\nEarth-life. If you defeat her, you will\nbe remembered forever as the savior of\nthe planet. If she conquers, it will be\nas if you had never been born.");
  228.             return;
  229.         }
  230.         
  231.     }
  232.  
  233.     GotoNextMap();
  234. };
  235.  
  236. /*
  237. ============
  238. IntermissionThink
  239.  
  240. When the player presses attack or jump, change to the next level
  241. ============
  242. */
  243. void() IntermissionThink =
  244. {
  245.     if (time < intermission_exittime)
  246.         return;
  247.  
  248.     if (!self.button0 && !self.button1 && !self.button2)
  249.         return;
  250.     
  251.     ExitIntermission ();
  252. };
  253.  
  254. void() execute_changelevel =
  255. {
  256.     local entity    pos;
  257.  
  258.     intermission_running = 1;
  259.     
  260. // enforce a wait time before allowing changelevel
  261.     if (deathmatch)
  262.         intermission_exittime = time + 5;
  263.     else
  264.         intermission_exittime = time + 2;
  265.  
  266.     WriteByte (MSG_ALL, SVC_CDTRACK);
  267.     WriteByte (MSG_ALL, 3);
  268.     WriteByte (MSG_ALL, 3);
  269.     
  270.     pos = FindIntermission ();
  271.  
  272.     other = find (world, classname, "player");
  273.     while (other != world)
  274.     {
  275.         other.view_ofs = '0 0 0';
  276.         other.angles = other.v_angle = pos.mangle;
  277.         other.fixangle = TRUE;          // turn this way immediately
  278.         other.nextthink = time + 0.5;
  279.         other.takedamage = DAMAGE_NO;
  280.         other.solid = SOLID_NOT;
  281.         other.movetype = MOVETYPE_NONE;
  282.         other.modelindex = 0;
  283.         setorigin (other, pos.origin);
  284.         other = find (other, classname, "player");
  285.     }       
  286.  
  287.     WriteByte (MSG_ALL, SVC_INTERMISSION);
  288. };
  289.  
  290.  
  291. void() changelevel_touch =
  292. {
  293.     local entity    pos;
  294.  
  295.     if (other.classname != "player")
  296.         return;
  297.  
  298.     if (cvar("noexit"))
  299.     {
  300.         T_Damage (other, self, self, 50000);
  301.         return;
  302.     }
  303.     bprint (other.netname);
  304.     bprint (" exited the level\n");
  305.     
  306.     nextmap = self.map;
  307.  
  308.     SUB_UseTargets ();
  309.  
  310.     if ( (self.spawnflags & 1) && (deathmatch == 0) )
  311.     {       // NO_INTERMISSION
  312.         GotoNextMap();
  313.         return;
  314.     }
  315.     
  316.     self.touch = SUB_Null;
  317.  
  318. // we can't move people right now, because touch functions are called
  319. // in the middle of C movement code, so set a think time to do it
  320.     self.think = execute_changelevel;
  321.     self.nextthink = time + 0.1;
  322. };
  323.  
  324. /*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION
  325. When the player touches this, he gets sent to the map listed in the "map" variable.  Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats.
  326. */
  327. void() trigger_changelevel =
  328. {
  329.     if (!self.map)
  330.         objerror ("chagnelevel trigger doesn't have map");
  331.     
  332.     InitTrigger ();
  333.     self.touch = changelevel_touch;
  334. };
  335.  
  336.  
  337. /*
  338. =============================================================================
  339.  
  340.                 PLAYER GAME EDGE FUNCTIONS
  341.  
  342. =============================================================================
  343. */
  344.  
  345. void() set_suicide_frame;
  346.  
  347. // called by ClientKill and DeadThink
  348. void() respawn =
  349. {
  350.     if (coop)
  351.     {
  352.         // make a copy of the dead body for appearances sake
  353.         CopyToBodyQue (self);
  354.         // get the spawn parms as they were at level start
  355.         setspawnparms (self);
  356.         // respawn              
  357.         PutClientInServer ();
  358.     }
  359.     else if (deathmatch)
  360.     {
  361.         // make a copy of the dead body for appearances sake
  362.         CopyToBodyQue (self);
  363.         // set default spawn parms
  364.         SetNewParms ();
  365.         // respawn              
  366.         PutClientInServer ();
  367.     }
  368.     else
  369.     {       // restart the entire server
  370.         localcmd ("restart\n");
  371.     }
  372. };
  373.  
  374.  
  375. /*
  376. ============
  377. ClientKill
  378.  
  379. Player entered the suicide command
  380. ============
  381. */
  382. void() ClientKill =
  383. {
  384.     bprint (self.netname);
  385.     bprint (" suicides\n");
  386.     set_suicide_frame ();
  387.     self.modelindex = modelindex_player;
  388.     self.frags = self.frags - 2;    // extra penalty
  389.     respawn ();
  390. };
  391.  
  392. float(vector v) CheckSpawnPoint =
  393. {
  394.     return FALSE;
  395. };
  396.  
  397. /*
  398. ============
  399. SelectSpawnPoint
  400.  
  401. Returns the entity to spawn at
  402. ============
  403. */
  404. entity() SelectSpawnPoint =
  405. {
  406.     local   entity spot;
  407.     
  408. // testinfo_player_start is only found in regioned levels
  409.     spot = find (world, classname, "testplayerstart");
  410.     if (spot)
  411.         return spot;
  412.         
  413. // choose a info_player_deathmatch point
  414.     if (coop)
  415.     {
  416.         lastspawn = find(lastspawn, classname, "info_player_coop");
  417.         if (lastspawn == world)
  418.             lastspawn = find (lastspawn, classname, "info_player_start");
  419.         if (lastspawn != world)
  420.             return lastspawn;
  421.     }
  422.     else if (deathmatch)
  423.     {
  424.         lastspawn = find(lastspawn, classname, "info_player_deathmatch");
  425.         if (lastspawn == world)
  426.             lastspawn = find (lastspawn, classname, "info_player_deathmatch");
  427.         if (lastspawn != world)
  428.             return lastspawn;
  429.     }
  430.  
  431.     if (serverflags)
  432.     {       // return with a rune to start
  433.         spot = find (world, classname, "info_player_start2");
  434.         if (spot)
  435.             return spot;
  436.     }
  437.     
  438.     spot = find (world, classname, "info_player_start");
  439.     if (!spot)
  440.         error ("PutClientInServer: no info_player_start on level");
  441.     
  442.     return spot;
  443. };
  444.  
  445. /*
  446. ===========
  447. PutClientInServer
  448.  
  449. called each time a player is spawned
  450. ============
  451. */
  452. void() DecodeLevelParms;
  453. void() PlayerDie;
  454.  
  455.  
  456. void() PutClientInServer =
  457. {
  458.     local   entity spot;
  459.  
  460.     self.classname = "player";
  461.     self.health = 100;
  462.     self.takedamage = DAMAGE_AIM;
  463.     self.solid = SOLID_SLIDEBOX;
  464.     self.movetype = MOVETYPE_WALK;
  465.     self.show_hostile = 0;
  466.     self.max_health = 100;
  467.     self.flags = FL_CLIENT;
  468.     self.air_finished = time + 12;
  469.     self.dmg = 2;                   // initial water damage
  470.     self.super_damage_finished = 0;
  471.     self.radsuit_finished = 0;
  472.     self.invisible_finished = 0;
  473.     self.invincible_finished = 0;
  474.     self.effects = 0;
  475.     self.invincible_time = 0;
  476.  
  477.     DecodeLevelParms ();
  478.     
  479.     W_SetCurrentAmmo ();
  480.  
  481.     self.attack_finished = time;
  482.     self.th_pain = player_pain;
  483.     self.th_die = PlayerDie;
  484.     
  485.     self.deadflag = DEAD_NO;
  486. // paustime is set by teleporters to keep the player from moving a while
  487.     self.pausetime = 0;
  488.     
  489.     spot = SelectSpawnPoint ();
  490.  
  491.     self.origin = spot.origin + '0 0 1';
  492.     self.angles = spot.angles;
  493.     self.fixangle = TRUE;           // turn this way immediately
  494.  
  495. // oh, this is a hack!
  496.     setmodel (self, "progs/eyes.mdl");
  497.     modelindex_eyes = self.modelindex;
  498.  
  499.     setmodel (self, "progs/player.mdl");
  500.     modelindex_player = self.modelindex;
  501.  
  502.     setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  503.     
  504.     self.view_ofs = '0 0 22';
  505.  
  506.     player_stand1 ();
  507.     
  508.     if (deathmatch || coop)
  509.     {
  510.         makevectors(self.angles);
  511.         spawn_tfog (self.origin + v_forward*20);
  512.     }
  513.  
  514.     spawn_tdeath (self.origin, self);
  515. };
  516.  
  517.  
  518. /*
  519. =============================================================================
  520.  
  521.                 QUAKED FUNCTIONS
  522.  
  523. =============================================================================
  524. */
  525.  
  526.  
  527. /*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24)
  528. The normal starting point for a level.
  529. */
  530. void() info_player_start =
  531. {
  532. };
  533.  
  534.  
  535. /*QUAKED info_player_start2 (1 0 0) (-16 -16 -24) (16 16 24)
  536. Only used on start map for the return point from an episode.
  537. */
  538. void() info_player_start2 =
  539. {
  540. };
  541.  
  542.  
  543. /*
  544. saved out by quaked in region mode
  545. */
  546. void() testplayerstart =
  547. {
  548. };
  549.  
  550. /*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24)
  551. potential spawning position for deathmatch games
  552. */
  553. void() info_player_deathmatch =
  554. {
  555. };
  556.  
  557. /*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24)
  558. potential spawning position for coop games
  559. */
  560. void() info_player_coop =
  561. {
  562. };
  563.  
  564. /*
  565. ===============================================================================
  566.  
  567. RULES
  568.  
  569. ===============================================================================
  570. */
  571.  
  572. void(entity c) PrintClientScore =
  573. {
  574.     if (c.frags > -10 && c.frags < 0)
  575.         bprint (" ");
  576.     else if (c.frags >= 0)
  577.     {
  578.         if (c.frags < 100)
  579.             bprint (" ");
  580.         if (c.frags < 10)
  581.             bprint (" ");
  582.     }
  583.     bprint (ftos(c.frags));
  584.     bprint (" ");
  585.     bprint (c.netname);
  586.     bprint ("\n");
  587. };
  588.  
  589. void() DumpScore =
  590. {
  591.     local entity    e, sort, walk;
  592.  
  593.     if (world.chain)
  594.         error ("DumpScore: world.chain is set");
  595.  
  596. // build a sorted lis
  597.     e = find(world, classname, "player");
  598.     sort = world;
  599.     while (e)
  600.     {
  601.         if (!sort)
  602.         {
  603.             sort = e;
  604.             e.chain = world;
  605.         }
  606.         else
  607.         {
  608.             if (e.frags > sort.frags)
  609.             {
  610.                 e.chain = sort;
  611.                 sort = e;
  612.             }
  613.             else
  614.             {
  615.                 walk = sort;
  616.                 do
  617.                 {
  618.                     if (!walk.chain)
  619.                     {
  620.                         e.chain = world;
  621.                         walk.chain = e;
  622.                     }
  623.                     else if (walk.chain.frags < e.frags)
  624.                     {
  625.                         e.chain = walk.chain;
  626.                         walk.chain = e;
  627.                     }
  628.                     else
  629.                         walk = walk.chain;
  630.                 } while (walk.chain != e);
  631.             }
  632.         }
  633.         
  634.         e = find(e, classname, "player");
  635.     }
  636.  
  637. // print the list
  638.     
  639.     bprint ("\n");  
  640.     while (sort)
  641.     {
  642.         PrintClientScore (sort);
  643.         sort = sort.chain;
  644.     }
  645.     bprint ("\n");
  646. };
  647.  
  648. /*
  649. go to the next level for deathmatch
  650. */
  651. void() NextLevel =
  652. {
  653.     local entity o;
  654.  
  655. // find a trigger changelevel
  656.     o = find(world, classname, "trigger_changelevel");
  657.     if (!o || mapname == "start")
  658.     {       // go back to same map if no trigger_changelevel
  659.         o = spawn();
  660.         o.map = mapname;
  661.     }
  662.  
  663.     nextmap = o.map;
  664.     
  665.     if (o.nextthink < time)
  666.     {
  667.         o.think = execute_changelevel;
  668.         o.nextthink = time + 0.1;
  669.     }
  670. };
  671.  
  672. /*
  673. ============
  674. CheckRules
  675.  
  676. Exit deathmatch games upon conditions
  677. ============
  678. */
  679. void() CheckRules =
  680. {
  681.     local   float           timelimit;
  682.     local   float           fraglimit;
  683.     
  684.     if (gameover)   // someone else quit the game already
  685.         return;
  686.         
  687.     timelimit = cvar("timelimit") * 60;
  688.     fraglimit = cvar("fraglimit");
  689.     
  690.     if (timelimit && time >= timelimit)
  691.     {
  692. NextLevel ();
  693. /*
  694.         gameover = TRUE;
  695.         bprint ("\n\n\n==============================\n");
  696.         bprint ("game exited after ");
  697.         bprint (ftos(timelimit/60));
  698.         bprint (" minutes\n");
  699.         DumpScore ();
  700.         localcmd ("killserver\n");
  701. */
  702.         return;
  703.     }
  704.     
  705.     if (fraglimit && self.frags >= fraglimit)
  706.     {
  707. NextLevel ();
  708. /*
  709.         gameover = TRUE;
  710.         bprint ("\n\n\n==============================\n");
  711.         bprint ("game exited after ");
  712.         bprint (ftos(self.frags));
  713.         bprint (" frags\n");
  714.         DumpScore ();
  715.         localcmd ("killserver\n");
  716. */
  717.         return;
  718.     }       
  719. };
  720.  
  721. //============================================================================
  722.  
  723. void() PlayerDeathThink =
  724. {
  725.     local entity    old_self;
  726.     local float             forward;
  727.  
  728.     if ((self.flags & FL_ONGROUND))
  729.     {
  730.         forward = vlen (self.velocity);
  731.         forward = forward - 20;
  732.         if (forward <= 0)
  733.             self.velocity = '0 0 0';
  734.         else    
  735.             self.velocity = forward * normalize(self.velocity);
  736.     }
  737.  
  738. // wait for all buttons released
  739.     if (self.deadflag == DEAD_DEAD)
  740.     {
  741.         if (self.button2 || self.button1 || self.button0)
  742.             return;
  743.         self.deadflag = DEAD_RESPAWNABLE;
  744.         return;
  745.     }
  746.  
  747. // wait for any button down
  748.     if (!self.button2 && !self.button1 && !self.button0)
  749.         return;
  750.  
  751.     self.button0 = 0;
  752.     self.button1 = 0;
  753.     self.button2 = 0;
  754.     respawn();
  755. };
  756.  
  757.  
  758. void() PlayerJump =
  759. {
  760.     local vector start, end;
  761.     
  762.     if (self.flags & FL_WATERJUMP)
  763.         return;
  764.     
  765.     if (self.waterlevel >= 2)
  766.     {
  767.         if (self.watertype == CONTENT_WATER)
  768.             self.velocity_z = 100;
  769.         else if (self.watertype == CONTENT_SLIME)
  770.             self.velocity_z = 80;
  771.         else
  772.             self.velocity_z = 50;
  773.  
  774. // play swiming sound
  775.         if (self.swim_flag < time)
  776.         {
  777.             self.swim_flag = time + 1;
  778.             if (random() < 0.5)
  779.                 sound (self, CHAN_BODY, "misc/water1.wav", 1, ATTN_NORM);
  780.             else
  781.                 sound (self, CHAN_BODY, "misc/water2.wav", 1, ATTN_NORM);
  782.         }
  783.  
  784.         return;
  785.     }
  786.  
  787.     if (!(self.flags & FL_ONGROUND))
  788.         return;
  789.  
  790.     if ( !(self.flags & FL_JUMPRELEASED) )
  791.         return;         // don't pogo stick
  792.  
  793.     self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
  794.  
  795.     self.flags = self.flags - FL_ONGROUND;  // don't stairwalk
  796.     
  797.     self.button2 = 0;
  798. // player jumping sound
  799.     sound (self, CHAN_BODY, "player/plyrjmp8.wav", 1, ATTN_NORM);
  800.     self.velocity_z = self.velocity_z + 270;
  801. };
  802.  
  803.  
  804. /*
  805. ===========
  806. WaterMove
  807.  
  808. ============
  809. */
  810. .float  dmgtime;
  811.  
  812. void() WaterMove =
  813. {
  814. //dprint (ftos(self.waterlevel));
  815.     if (self.movetype == MOVETYPE_NOCLIP)
  816.         return;
  817.     if (self.health < 0)
  818.         return;
  819.  
  820.     if (self.waterlevel != 3)
  821.     {
  822.         if (self.air_finished < time)
  823.             sound (self, CHAN_VOICE, "player/gasp2.wav", 1, ATTN_NORM);
  824.         else if (self.air_finished < time + 9)
  825.             sound (self, CHAN_VOICE, "player/gasp1.wav", 1, ATTN_NORM);
  826.         self.air_finished = time + 12;
  827.         self.dmg = 2;
  828.     }
  829.     else if (self.air_finished < time)
  830.     {       // drown!
  831.         if (self.pain_finished < time)
  832.         {
  833.             self.dmg = self.dmg + 2;
  834.             if (self.dmg > 15)
  835.                 self.dmg = 10;
  836.             T_Damage (self, world, world, self.dmg);
  837.             self.pain_finished = time + 1;
  838.         }
  839.     }
  840.     
  841.     if (!self.waterlevel)
  842.     {
  843.         if (self.flags & FL_INWATER)
  844.         {       
  845.             // play leave water sound
  846.             sound (self, CHAN_BODY, "misc/outwater.wav", 1, ATTN_NORM);
  847.             self.flags = self.flags - FL_INWATER;
  848.         }
  849.         return;
  850.     }
  851.  
  852.     if (self.watertype == CONTENT_LAVA)
  853.     {       // do damage
  854.         if (self.dmgtime < time)
  855.         {
  856.             if (self.radsuit_finished > time)
  857.                 self.dmgtime = time + 1;
  858.             else
  859.                 self.dmgtime = time + 0.2;
  860.  
  861.             T_Damage (self, world, world, 10*self.waterlevel);
  862.         }
  863.     }
  864.     else if (self.watertype == CONTENT_SLIME)
  865.     {       // do damage
  866.         if (self.dmgtime < time && self.radsuit_finished < time)
  867.         {
  868.             self.dmgtime = time + 1;
  869.             T_Damage (self, world, world, 4*self.waterlevel);
  870.         }
  871.     }
  872.     
  873.     if ( !(self.flags & FL_INWATER) )
  874.     {       
  875.  
  876. // player enter water sound
  877.  
  878.         if (self.watertype == CONTENT_LAVA)
  879.             sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM);
  880.         if (self.watertype == CONTENT_WATER)
  881.             sound (self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM);
  882.         if (self.watertype == CONTENT_SLIME)
  883.             sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM);
  884.  
  885.         self.flags = self.flags + FL_INWATER;
  886.         self.dmgtime = 0;
  887.     }
  888.     
  889.     if (! (self.flags & FL_WATERJUMP) )
  890.         self.velocity = self.velocity - 0.8*self.waterlevel*frametime*self.velocity;
  891. };
  892.  
  893. void() CheckWaterJump =
  894. {
  895.     local vector start, end;
  896.  
  897. // check for a jump-out-of-water
  898.     makevectors (self.angles);
  899.     start = self.origin;
  900.     start_z = start_z + 8; 
  901.     v_forward_z = 0;
  902.     normalize(v_forward);
  903.     end = start + v_forward*24;
  904.     traceline (start, end, TRUE, self);
  905.     if (trace_fraction < 1)
  906.     {       // solid at waist
  907.         start_z = start_z + self.maxs_z - 8;
  908.         end = start + v_forward*24;
  909.         self.movedir = trace_plane_normal * -50;
  910.         traceline (start, end, TRUE, self);
  911.         if (trace_fraction == 1)
  912.         {       // open at eye level
  913.             self.flags = self.flags | FL_WATERJUMP;
  914.             self.velocity_z = 225;
  915.             self.flags = self.flags - (self.flags & FL_JUMPRELEASED);
  916.             self.teleport_time = time + 2;  // safety net
  917.             return;
  918.         }
  919.     }
  920. };
  921.  
  922.  
  923. /*
  924. ================
  925. PlayerPreThink
  926.  
  927. Called every frame before physics are run
  928. ================
  929. */
  930. void() PlayerPreThink =
  931. {
  932.     local   float   mspeed, aspeed;
  933.     local   float   r;
  934.  
  935.     if (intermission_running)
  936.     {
  937.         IntermissionThink ();   // otherwise a button could be missed between
  938.         return;                                 // the think tics
  939.     }
  940.  
  941.     if (self.view_ofs == '0 0 0')
  942.         return;         // intermission or finale
  943.  
  944.     makevectors (self.v_angle);             // is this still used
  945.  
  946.     CheckRules ();
  947.     WaterMove ();
  948.  
  949.     if (self.waterlevel == 2)
  950.         CheckWaterJump ();
  951.  
  952.     if (self.deadflag >= DEAD_DEAD)
  953.     {
  954.         PlayerDeathThink ();
  955.         return;
  956.     }
  957.     
  958.     if (self.deadflag == DEAD_DYING)
  959.         return; // dying, so do nothing
  960.  
  961.     if (self.button2)
  962.     {
  963.         PlayerJump ();
  964.     }
  965.     else
  966.         self.flags = self.flags | FL_JUMPRELEASED;
  967.  
  968. // teleporters can force a non-moving pause time        
  969.     if (time < self.pausetime)
  970.         self.velocity = '0 0 0';
  971. };
  972.     
  973. /*
  974. ================
  975. CheckPowerups
  976.  
  977. Check for turning off powerups
  978. ================
  979. */
  980. void() CheckPowerups =
  981. {
  982.     if (self.health <= 0)
  983.         return;
  984.  
  985. // invisibility
  986.     if (self.invisible_finished)
  987.     {
  988. // sound and screen flash when items starts to run out
  989.         if (self.invisible_sound < time)
  990.         {
  991.             sound (self, CHAN_AUTO, "items/inv3.wav", 0.5, ATTN_IDLE);
  992.             self.invisible_sound = time + ((random() * 3) + 1);
  993.         }
  994.  
  995.  
  996.         if (self.invisible_finished < time + 3)
  997.         {
  998.             if (self.invisible_time == 1)
  999.             {
  1000.                 sprint (self, "Ring of Shadows magic is fading\n");
  1001.                 stuffcmd (self, "bf\n");
  1002.                 sound (self, CHAN_AUTO, "items/inv2.wav", 1, ATTN_NORM);
  1003.                 self.invisible_time = time + 1;
  1004.             }
  1005.             
  1006.             if (self.invisible_time < time)
  1007.             {
  1008.                 self.invisible_time = time + 1;
  1009.                 stuffcmd (self, "bf\n");
  1010.             }
  1011.         }
  1012.  
  1013.         if (self.invisible_finished < time)
  1014.         {       // just stopped
  1015.             self.items = self.items - IT_INVISIBILITY;
  1016.             self.invisible_finished = 0;
  1017.             self.invisible_time = 0;
  1018.         }
  1019.         
  1020.     // use the eyes
  1021.         self.frame = 0;
  1022.         self.modelindex = modelindex_eyes;
  1023.     }
  1024.     else
  1025.         self.modelindex = modelindex_player;    // don't use eyes
  1026.  
  1027. // invincibility
  1028.     if (self.invincible_finished)
  1029.     {
  1030. // sound and screen flash when items starts to run out
  1031.         if (self.invincible_finished < time + 3)
  1032.         {
  1033.             if (self.invincible_time == 1)
  1034.             {
  1035.                 sprint (self, "Protection is almost burned out\n");
  1036.                 stuffcmd (self, "bf\n");
  1037.                 sound (self, CHAN_AUTO, "items/protect2.wav", 1, ATTN_NORM);
  1038.                 self.invincible_time = time + 1;
  1039.             }
  1040.             
  1041.             if (self.invincible_time < time)
  1042.             {
  1043.                 self.invincible_time = time + 1;
  1044.                 stuffcmd (self, "bf\n");
  1045.             }
  1046.         }
  1047.         
  1048.         if (self.invincible_finished < time)
  1049.         {       // just stopped
  1050.             self.items = self.items - IT_INVULNERABILITY;
  1051.             self.invincible_time = 0;
  1052.             self.invincible_finished = 0;
  1053.         }
  1054.         if (self.invincible_finished > time)
  1055.             self.effects = self.effects | EF_DIMLIGHT;
  1056.         else
  1057.             self.effects = self.effects - (self.effects & EF_DIMLIGHT);
  1058.     }
  1059.  
  1060. // super damage
  1061.     if (self.super_damage_finished)
  1062.     {
  1063.  
  1064. // sound and screen flash when items starts to run out
  1065.  
  1066.         if (self.super_damage_finished < time + 3)
  1067.         {
  1068.             if (self.super_time == 1)
  1069.             {
  1070.                 sprint (self, "Quad Damage is wearing off\n");
  1071.                 stuffcmd (self, "bf\n");
  1072.                 sound (self, CHAN_AUTO, "items/damage2.wav", 1, ATTN_NORM);
  1073.                 self.super_time = time + 1;
  1074.             }         
  1075.             
  1076.             if (self.super_time < time)
  1077.             {
  1078.                 self.super_time = time + 1;
  1079.                 stuffcmd (self, "bf\n");
  1080.             }
  1081.         }
  1082.  
  1083.         if (self.super_damage_finished < time)
  1084.         {       // just stopped
  1085.             self.items = self.items - IT_QUAD;
  1086.             self.super_damage_finished = 0;
  1087.             self.super_time = 0;
  1088.         }
  1089.         if (self.super_damage_finished > time)
  1090.             self.effects = self.effects | EF_DIMLIGHT;
  1091.         else
  1092.             self.effects = self.effects - (self.effects & EF_DIMLIGHT);
  1093.     }       
  1094.  
  1095. // suit 
  1096.     if (self.radsuit_finished)
  1097.     {
  1098.         self.air_finished = time + 12;          // don't drown
  1099.  
  1100. // sound and screen flash when items starts to run out
  1101.         if (self.radsuit_finished < time + 3)
  1102.         {
  1103.             if (self.rad_time == 1)
  1104.             {
  1105.                 sprint (self, "Air supply in Biosuit expiring\n");
  1106.                 stuffcmd (self, "bf\n");
  1107.                 sound (self, CHAN_AUTO, "items/suit2.wav", 1, ATTN_NORM);
  1108.                 self.rad_time = time + 1;
  1109.             }
  1110.             
  1111.             if (self.rad_time < time)
  1112.             {
  1113.                 self.rad_time = time + 1;
  1114.                 stuffcmd (self, "bf\n");
  1115.             }
  1116.         }
  1117.  
  1118.         if (self.radsuit_finished < time)
  1119.         {       // just stopped
  1120.             self.items = self.items - IT_SUIT;
  1121.             self.rad_time = 0;
  1122.             self.radsuit_finished = 0;
  1123.         }
  1124.     }       
  1125.  
  1126. };
  1127.  
  1128.  
  1129. /*
  1130. ================
  1131. PlayerPostThink
  1132.  
  1133. Called every frame after physics are run
  1134. ================
  1135. */
  1136. void() PlayerPostThink =
  1137. {
  1138.     local   float   mspeed, aspeed;
  1139.     local   float   r;
  1140.  
  1141.     if (self.view_ofs == '0 0 0')
  1142.         return;         // intermission or finale
  1143.     if (self.deadflag)
  1144.         return;
  1145.         
  1146. // do weapon stuff
  1147.  
  1148.     W_WeaponFrame ();
  1149.  
  1150. // check to see if player landed and play landing sound 
  1151.     if ((self.jump_flag < -300) && (self.flags & FL_ONGROUND) && (self.health > 0))
  1152.     {
  1153.         if (self.watertype == CONTENT_WATER)
  1154.             sound (self, CHAN_BODY, "player/h2ojump.wav", 1, ATTN_NORM);
  1155.         else if (self.jump_flag < -650)
  1156.         {
  1157.             T_Damage (self, world, world, 5); 
  1158.             sound (self, CHAN_VOICE, "player/land2.wav", 1, ATTN_NORM);
  1159.             self.deathtype = "falling";
  1160.         }
  1161.         else
  1162.             sound (self, CHAN_VOICE, "player/land.wav", 1, ATTN_NORM);
  1163.  
  1164.         self.jump_flag = 0;
  1165.     }
  1166.  
  1167.     if (!(self.flags & FL_ONGROUND))
  1168.         self.jump_flag = self.velocity_z;
  1169.  
  1170.     CheckPowerups ();
  1171. };
  1172.  
  1173.  
  1174. /*
  1175. ===========
  1176. ClientConnect
  1177.  
  1178. called when a player connects to a server
  1179. ============
  1180. */
  1181. void() ClientConnect =
  1182. {
  1183.     bprint (self.netname);
  1184.     bprint (" entered the game\n");
  1185.  
  1186.     //
  1187.     //FragReport mod
  1188.     // Register player in FragReport matrix
  1189.     //      
  1190.     FragReportRegister(self);
  1191.  
  1192. // a client connecting during an intermission can cause problems
  1193.     if (intermission_running)
  1194.         ExitIntermission ();
  1195. };
  1196.  
  1197.  
  1198. /*
  1199. ===========
  1200. ClientDisconnect
  1201.  
  1202. called when a player disconnects from a server
  1203. ============
  1204. */
  1205. void() ClientDisconnect =
  1206. {
  1207.     if (gameover)
  1208.         return;
  1209.     // if the level end trigger has been activated, just return
  1210.     // since they aren't *really* leaving
  1211.  
  1212.     //
  1213.     //FragReport mod
  1214.     // Erase player from FragReport matrix
  1215.     //
  1216.     FragReportLeave(self);
  1217.  
  1218.     // let everyone else know
  1219.     bprint (self.netname);
  1220.     bprint (" left the game with ");
  1221.     bprint (ftos(self.frags));
  1222.     bprint (" frags\n");
  1223.     sound (self, CHAN_BODY, "player/tornoff2.wav", 1, ATTN_NONE);
  1224.     set_suicide_frame ();
  1225. };
  1226.  
  1227. /*
  1228. ===========
  1229. ClientObituary
  1230.  
  1231. called when a player dies
  1232. ============
  1233. */
  1234. void(entity targ, entity attacker) ClientObituary =
  1235. {
  1236.     local   float rnum;
  1237.     local   string deathstring, deathstring2;
  1238.     rnum = random();
  1239.  
  1240.     //
  1241.     //FragReport mod
  1242.     // Record frag in FragReport matrix
  1243.     //
  1244.     FragReportUpdate( attacker, targ );
  1245.  
  1246.     if (targ.classname == "player")
  1247.     {
  1248.         if (attacker.classname == "teledeath")
  1249.         {
  1250.             bprint (targ.netname);
  1251.             bprint (" was telefragged by ");
  1252.             bprint (attacker.owner.netname);
  1253.             bprint ("\n");
  1254.  
  1255.             attacker.owner.frags = attacker.owner.frags + 1;
  1256.             return;
  1257.         }
  1258.  
  1259.         if (attacker.classname == "teledeath2")
  1260.         {
  1261.             bprint ("Satan's power deflects ");
  1262.             bprint (targ.netname);
  1263.             bprint ("'s telefrag\n");
  1264.  
  1265.             targ.frags = targ.frags - 1;
  1266.             return;
  1267.         }
  1268.  
  1269.         if (attacker.classname == "player")
  1270.         {
  1271.             if (targ == attacker)
  1272.             {
  1273.                 // killed self
  1274.                 attacker.frags = attacker.frags - 1;
  1275.                 bprint (targ.netname);
  1276.                 
  1277.                 if (targ.weapon == 64 && targ.waterlevel > 1)
  1278.                 {
  1279.                     bprint (" discharges into the water.\n");
  1280.                     return;
  1281.                 }
  1282.                 if (targ.weapon == 16)
  1283.                     bprint (" tries to put the pin back in\n");
  1284.                 else if (rnum)
  1285.                     bprint (" becomes bored with life\n");
  1286.                 else
  1287.                     bprint (" checks if his weapon is loaded\n");
  1288.                 return;
  1289.             }
  1290.             else
  1291.             {
  1292.                 attacker.frags = attacker.frags + 1;
  1293.  
  1294.                 rnum = attacker.weapon;
  1295.                 if (rnum == IT_AXE)
  1296.                 {
  1297.                     deathstring = " was ax-murdered by ";
  1298.                     deathstring2 = "\n";
  1299.                 }
  1300.                 if (rnum == IT_SHOTGUN)
  1301.                 {
  1302.                     deathstring = " chewed on ";
  1303.                     deathstring2 = "'s boomstick\n";
  1304.                 }
  1305.                 if (rnum == IT_SUPER_SHOTGUN)
  1306.                 {
  1307.                     deathstring = " ate 2 loads of ";
  1308.                     deathstring2 = "'s buckshot\n";
  1309.                 }
  1310.                 if (rnum == IT_NAILGUN)
  1311.                 {
  1312.                     deathstring = " was nailed by ";
  1313.                     deathstring2 = "\n";
  1314.                 }
  1315.                 if (rnum == IT_SUPER_NAILGUN)
  1316.                 {
  1317.                     deathstring = " was punctured by ";
  1318.                     deathstring2 = "\n";
  1319.                 }
  1320.                 if (rnum == IT_GRENADE_LAUNCHER)
  1321.                 {
  1322.                     deathstring = " eats ";
  1323.                     deathstring2 = "'s pineapple\n";
  1324.                     if (targ.health < -40)
  1325.                     {
  1326.                         deathstring = " was gibbed by ";
  1327.                         deathstring2 = "'s grenade\n";
  1328.                     }
  1329.                 }
  1330.                 if (rnum == IT_ROCKET_LAUNCHER)
  1331.                 {
  1332.                     deathstring = " rides ";
  1333.                     deathstring2 = "'s rocket\n";
  1334.                     if (targ.health < -40)
  1335.                     {
  1336.                         deathstring = " was gibbed by ";
  1337.                         deathstring2 = "'s rocket\n" ;
  1338.                     }
  1339.                 }
  1340.                 if (rnum == IT_LIGHTNING)
  1341.                 {
  1342.                     deathstring = " accepts ";
  1343.                     if (attacker.waterlevel > 1)
  1344.                         deathstring2 = "'s discharge\n";
  1345.                     else
  1346.                         deathstring2 = "'s shaft\n";
  1347.                 }
  1348.                 bprint (targ.netname);
  1349.                 bprint (deathstring);
  1350.                 bprint (attacker.netname);
  1351.                 bprint (deathstring2);
  1352.             }
  1353.             return;
  1354.         }
  1355.         else
  1356.         {
  1357.             targ.frags = targ.frags - 1;            // killed self
  1358.             rnum = targ.watertype;
  1359.  
  1360.             bprint (targ.netname);
  1361.             if (rnum == -3)
  1362.             {
  1363.                 if (random() < 0.5)
  1364.                     bprint (" sleeps with the fishes\n");
  1365.                 else
  1366.                     bprint (" sucks it down\n");
  1367.                 return;
  1368.             }
  1369.             else if (rnum == -4)
  1370.             {
  1371.                 if (random() < 0.5)
  1372.                     bprint (" gulped a load of slime\n");
  1373.                 else
  1374.                     bprint (" can't exist on slime alone\n");
  1375.                 return;
  1376.             }
  1377.             else if (rnum == -5)
  1378.             {
  1379.                 if (targ.health < -15)
  1380.                 {
  1381.                     bprint (" burst into flames\n");
  1382.                     return;
  1383.                 }
  1384.                 if (random() < 0.5)
  1385.                     bprint (" turned into hot slag\n");
  1386.                 else
  1387.                     bprint (" visits the Volcano God\n");
  1388.                 return;
  1389.             }
  1390.  
  1391.             if (attacker.flags & FL_MONSTER)
  1392.             {
  1393.                 if (attacker.classname == "monster_army")
  1394.                     bprint (" was shot by a Grunt\n");
  1395.                 if (attacker.classname == "monster_demon1")
  1396.                     bprint (" was eviscerated by a Fiend\n");
  1397.                 if (attacker.classname == "monster_dog")
  1398.                     bprint (" was mauled by a Rottweiler\n");
  1399.                 if (attacker.classname == "monster_dragon")
  1400.                     bprint (" was fried by a Dragon\n");
  1401.                 if (attacker.classname == "monster_enforcer")
  1402.                     bprint (" was blasted by an Enforcer\n");
  1403.                 if (attacker.classname == "monster_fish")
  1404.                     bprint (" was fed to the Rotfish\n");
  1405.                 if (attacker.classname == "monster_hell_knight")
  1406.                     bprint (" was slain by a Death Knight\n");
  1407.                 if (attacker.classname == "monster_knight")
  1408.                     bprint (" was slashed by a Knight\n");
  1409.                 if (attacker.classname == "monster_ogre")
  1410.                     bprint (" was destroyed by an Ogre\n");
  1411.                 if (attacker.classname == "monster_oldone")
  1412.                     bprint (" became one with Shub-Niggurath\n");
  1413.                 if (attacker.classname == "monster_shalrath")
  1414.                     bprint (" was exploded by a Vore\n");
  1415.                 if (attacker.classname == "monster_shambler")
  1416.                     bprint (" was smashed by a Shambler\n");
  1417.                 if (attacker.classname == "monster_tarbaby")
  1418.                     bprint (" was slimed by a Spawn\n");
  1419.                 if (attacker.classname == "monster_vomit")
  1420.                     bprint (" was vomited on by a Vomitus\n");
  1421.                 if (attacker.classname == "monster_wizard")
  1422.                     bprint (" was scragged by a Scrag\n");
  1423.                 if (attacker.classname == "monster_zombie")
  1424.                     bprint (" joins the Zombies\n");
  1425.  
  1426.                 return;
  1427.             }
  1428.             if (attacker.classname == "explo_box")
  1429.             {
  1430.                 bprint (" blew up\n");
  1431.                 return;
  1432.             }
  1433.             if (attacker.solid == SOLID_BSP && attacker != world)
  1434.             {       
  1435.                 bprint (" was squished\n");
  1436.                 return;
  1437.             }
  1438.             if (targ.deathtype == "falling")
  1439.             {
  1440.                 targ.deathtype = "";
  1441.                 bprint (" fell to his death\n");
  1442.                 return;
  1443.             }
  1444.             if (attacker.classname == "trap_shooter" || attacker.classname == "trap_spikeshooter")
  1445.             {
  1446.                 bprint (" was spiked\n");
  1447.                 return;
  1448.             }
  1449.             if (attacker.classname == "fireball")
  1450.             {
  1451.                 bprint (" ate a lavaball\n");
  1452.                 return;
  1453.             }
  1454.             if (attacker.classname == "trigger_changelevel")
  1455.             {
  1456.                 bprint (" tried to leave\n");
  1457.                 return;
  1458.             }
  1459.  
  1460.             bprint (" died\n");
  1461.         }
  1462.     }
  1463. };
  1464.