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