home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer 3.2 / 1997-05_Disc_3.2.iso / QUAKECTF / SRC / CTF / PLAYER.QC < prev    next >
Text File  |  1997-01-30  |  20KB  |  770 lines

  1.  
  2. void() bubble_bob;
  3. void() W_FireChain;
  4. void() player_chain5;
  5. void() player_chain4;
  6.  
  7. /*
  8. ==============================================================================
  9.  
  10. PLAYER
  11.  
  12. ==============================================================================
  13. */
  14.  
  15. $cd id1/models/player_4
  16. $origin 0 -6 24
  17. $base base        
  18. $skin skin
  19.  
  20. //
  21. // running
  22. //
  23. $frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6
  24.  
  25. $frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6
  26.  
  27. //
  28. // standing
  29. //
  30. $frame stand1 stand2 stand3 stand4 stand5
  31.  
  32. $frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6
  33. $frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12
  34.  
  35.  
  36. //
  37. // pain
  38. //
  39. $frame axpain1 axpain2 axpain3 axpain4 axpain5 axpain6
  40.  
  41. $frame pain1 pain2 pain3 pain4 pain5 pain6
  42.  
  43.  
  44. //
  45. // death
  46. //
  47.  
  48. $frame axdeth1 axdeth2 axdeth3 axdeth4 axdeth5 axdeth6
  49. $frame axdeth7 axdeth8 axdeth9
  50.  
  51. $frame deatha1 deatha2 deatha3 deatha4 deatha5 deatha6 deatha7 deatha8
  52. $frame deatha9 deatha10 deatha11
  53.  
  54. $frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8
  55. $frame deathb9
  56.  
  57. $frame deathc1 deathc2 deathc3 deathc4 deathc5 deathc6 deathc7 deathc8
  58. $frame deathc9 deathc10 deathc11 deathc12 deathc13 deathc14 deathc15
  59.  
  60. $frame deathd1 deathd2 deathd3 deathd4 deathd5 deathd6 deathd7
  61. $frame deathd8 deathd9
  62.  
  63. $frame deathe1 deathe2 deathe3 deathe4 deathe5 deathe6 deathe7
  64. $frame deathe8 deathe9
  65.  
  66. //
  67. // attacks
  68. //
  69. $frame nailatt1 nailatt2
  70.  
  71. $frame light1 light2
  72.  
  73. $frame rockatt1 rockatt2 rockatt3 rockatt4 rockatt5 rockatt6
  74.  
  75. $frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6
  76.  
  77. $frame axatt1 axatt2 axatt3 axatt4 axatt5 axatt6
  78.  
  79. $frame axattb1 axattb2 axattb3 axattb4 axattb5 axattb6
  80.  
  81. $frame axattc1 axattc2 axattc3 axattc4 axattc5 axattc6
  82.  
  83. $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6
  84.  
  85. /*
  86. ==============================================================================
  87. PLAYER
  88. ==============================================================================
  89. */
  90.  
  91. void() player_run;
  92.  
  93. void()    player_stand1 =[    $axstnd1,    player_stand1    ]
  94. {
  95.     self.weaponframe=0;
  96.     if (self.velocity_x || self.velocity_y)
  97.     {
  98.         self.walkframe=0;
  99.         player_run();
  100.         return;
  101.     }
  102.  
  103.     if (self.weapon == IT_AXE || self.weapon == IT_HOOK)
  104.     {
  105.         if (self.walkframe >= 12)
  106.             self.walkframe = 0;
  107.         self.frame = $axstnd1 + self.walkframe;
  108.     }
  109.     else
  110.     {
  111.         if (self.walkframe >= 5)
  112.             self.walkframe = 0;
  113.         self.frame = $stand1 + self.walkframe;
  114.     }
  115.     self.walkframe = self.walkframe + 1;    
  116. };
  117.  
  118. void()    player_run =[    $rockrun1,    player_run    ]
  119. {
  120.     self.weaponframe=0;
  121.     if (!self.velocity_x && !self.velocity_y)
  122.     {
  123.         self.walkframe=0;
  124.  
  125.         player_stand1();
  126.         return;
  127.     }
  128.  
  129.     if (self.weapon == IT_AXE || self.weapon == IT_HOOK)
  130.     {
  131.         if (self.walkframe >= 6)        // CTFBOT EXTRAS bug fix made >= for "sliding" with hook?
  132.             self.walkframe = 0;
  133.         self.frame = $axrun1 + self.walkframe;
  134.     }
  135.     else
  136.     {
  137.         if (self.walkframe >= 6)        // CTFBOT EXTRAS bug fix made >= for "sliding" with hook?
  138.             self.walkframe = 0;
  139.         self.frame = $rockrun1 + self.walkframe;    // CTFBOT EXTRAS made $rockrun1 bug fix for "sliding" with hook?
  140.  
  141.     }
  142.     self.walkframe = self.walkframe + 1;
  143. };
  144.  
  145.  
  146. void()    player_shot1 =    [$shotatt1, player_shot2    ] {self.weaponframe=1;
  147. self.effects = self.effects | EF_MUZZLEFLASH;};
  148. void()    player_shot2 =    [$shotatt2, player_shot3    ] {self.weaponframe=2;};
  149. void()    player_shot3 =    [$shotatt3, player_shot4    ] {self.weaponframe=3;};
  150. void()    player_shot4 =    [$shotatt4, player_shot5    ] {self.weaponframe=4;};
  151. void()    player_shot5 =    [$shotatt5, player_shot6    ] {self.weaponframe=5;};
  152. void()    player_shot6 =    [$shotatt6, player_run    ] {self.weaponframe=6;};
  153.  
  154. void()    player_axe1 =    [$axatt1, player_axe2    ] {self.weaponframe=1;};
  155. void()    player_axe2 =    [$axatt2, player_axe3    ] {self.weaponframe=2;};
  156. void()    player_axe3 =    [$axatt3, player_axe4    ] {self.weaponframe=3;W_FireAxe();};
  157. void()    player_axe4 =    [$axatt4, player_run    ] {self.weaponframe=4;};
  158.  
  159. void()    player_axeb1 =    [$axattb1, player_axeb2    ] {self.weaponframe=5;};
  160. void()    player_axeb2 =    [$axattb2, player_axeb3    ] {self.weaponframe=6;};
  161. void()    player_axeb3 =    [$axattb3, player_axeb4    ] {self.weaponframe=7;W_FireAxe();};
  162. void()    player_axeb4 =    [$axattb4, player_run    ] {self.weaponframe=8;};
  163.  
  164. void()    player_axec1 =    [$axattc1, player_axec2    ] {self.weaponframe=1;};
  165. void()    player_axec2 =    [$axattc2, player_axec3    ] {self.weaponframe=2;};
  166. void()    player_axec3 =    [$axattc3, player_axec4    ] {self.weaponframe=3;W_FireAxe();};
  167. void()    player_axec4 =    [$axattc4, player_run    ] {self.weaponframe=4;};
  168.  
  169. void()    player_axed1 =    [$axattd1, player_axed2    ] {self.weaponframe=5;};
  170. void()    player_axed2 =    [$axattd2, player_axed3    ] {self.weaponframe=6;};
  171. void()    player_axed3 =    [$axattd3, player_axed4    ] {self.weaponframe=7;W_FireAxe();};
  172. void()    player_axed4 =    [$axattd4, player_run    ] {self.weaponframe=8;};
  173.  
  174. void()  player_chain1=  [$axattd1, player_chain2 ] {self.weaponframe=2;};
  175. void()  player_chain2=  [$axattd2, player_chain3 ] {self.weaponframe=3;W_FireChain();};
  176.  
  177. void()  player_chain3=  [$axattd3, player_chain3 ]
  178. {
  179.         self.weaponframe=3;
  180.         if (!self.hook_out)
  181.         {
  182.                 player_chain5();
  183.                 return;
  184.         }
  185.         if (vlen(self.velocity) >= 750)
  186.         {
  187.                 player_chain4();
  188.                 return;
  189.         }
  190. };
  191.  
  192. void() player_chain4=  [$deathc4, player_chain4 ]
  193. {
  194.         self.weaponframe=4;
  195.         if (!self.hook_out)
  196.         {
  197.                 player_chain5();
  198.                 return;
  199.         }
  200.         if (vlen(self.velocity) < 750)
  201.         {
  202.                 player_chain3();
  203.                 return;
  204.         }
  205. };
  206.  
  207. void()  player_chain5=  [$axattd4, player_run    ] {self.weaponframe=5;};
  208.  
  209.  
  210. //============================================================================
  211.  
  212. void() player_nail1   =[$nailatt1, player_nail2  ] 
  213. {
  214.     self.effects = self.effects | EF_MUZZLEFLASH;
  215.  
  216.     if (!self.button0)
  217.         {player_run ();return;}
  218.     self.weaponframe = self.weaponframe + 1;
  219.     if (self.weaponframe == 9)
  220.         self.weaponframe = 1;
  221.     SuperDamageSound();
  222.     W_FireSpikes (4);
  223.  
  224.     // CTFBOT [[[
  225.     // ??? for some reason, 0.2 makes bot fire too slowly?
  226.     // so make this 0.1 for bots, which seem right.
  227.     if (self.classname == "bot")
  228.         self.attack_finished = time + 0.1;
  229.     else
  230.         self.attack_finished = time + 0.2;
  231.     // CTFBOT ]]]
  232. };
  233. void() player_nail2   =[$nailatt2, player_nail1  ]
  234. {
  235.     self.effects = self.effects | EF_MUZZLEFLASH;
  236.  
  237.     if (!self.button0)
  238.         {player_run ();return;}
  239.     self.weaponframe = self.weaponframe + 1;
  240.     if (self.weaponframe == 9)
  241.         self.weaponframe = 1;
  242.     SuperDamageSound();
  243.     W_FireSpikes (-4);
  244.     
  245.     // CTFBOT [[[
  246.     // ??? for some reason, 0.2 makes bot fire too slowly?
  247.     // so make this 0.1 for bots, which seem right.
  248.     if (self.classname == "bot")
  249.         self.attack_finished = time + 0.1;
  250.     else
  251.         self.attack_finished = time + 0.2;
  252.     // CTFBOT ]]]
  253. };
  254.  
  255. //============================================================================
  256.  
  257. void() player_light1   =[$light1, player_light2  ] 
  258. {
  259.     self.effects = self.effects | EF_MUZZLEFLASH;
  260.  
  261.     if (!self.button0)
  262.         {player_run ();return;}
  263.     self.weaponframe = self.weaponframe + 1;
  264.     if (self.weaponframe == 5)
  265.         self.weaponframe = 1;
  266.     SuperDamageSound();
  267.     W_FireLightning();
  268.     self.attack_finished = time + 0.2;
  269. };
  270. void() player_light2   =[$light2, player_light1  ]
  271. {
  272.     self.effects = self.effects | EF_MUZZLEFLASH;
  273.  
  274.     if (!self.button0)
  275.         {player_run ();return;}
  276.     self.weaponframe = self.weaponframe + 1;
  277.     if (self.weaponframe == 5)
  278.         self.weaponframe = 1;
  279.     SuperDamageSound();
  280.     W_FireLightning();
  281.     self.attack_finished = time + 0.2;
  282. };
  283.  
  284. //============================================================================
  285.  
  286.  
  287. void() player_rocket1   =[$rockatt1, player_rocket2  ] {self.weaponframe=1;
  288. self.effects = self.effects | EF_MUZZLEFLASH;};
  289. void() player_rocket2   =[$rockatt2, player_rocket3  ] {self.weaponframe=2;};
  290. void() player_rocket3   =[$rockatt3, player_rocket4  ] {self.weaponframe=3;};
  291. void() player_rocket4   =[$rockatt4, player_rocket5  ] {self.weaponframe=4;};
  292. void() player_rocket5   =[$rockatt5, player_rocket6  ] {self.weaponframe=5;};
  293. void() player_rocket6   =[$rockatt6, player_run  ] {self.weaponframe=6;};
  294.  
  295.  
  296. void(float num_bubbles) DeathBubbles;
  297.  
  298.  
  299. void() PainSound =
  300. {
  301. local float        rs;
  302.  
  303.     if (self.health < 0)
  304.         return;
  305.  
  306.     if (damage_attacker.classname == "teledeath")
  307.     {
  308.         sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  309.         return;
  310.     }
  311.  
  312. // water pain sounds
  313.     if (self.watertype == CONTENT_WATER && self.waterlevel == 3)
  314.     {
  315.         DeathBubbles(1);
  316.         if (random() > 0.5)
  317.             sound (self, CHAN_VOICE, "player/drown1.wav", 1, ATTN_NORM);
  318.         else
  319.             sound (self, CHAN_VOICE, "player/drown2.wav", 1, ATTN_NORM);
  320.         return;
  321.     }
  322.  
  323. // slime pain sounds
  324.     if (self.watertype == CONTENT_SLIME)
  325.     {
  326. // FIX ME    put in some steam here
  327.         if (random() > 0.5)
  328.             sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
  329.         else
  330.             sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
  331.         return;
  332.     }
  333.  
  334.     if (self.watertype == CONTENT_LAVA)
  335.     {
  336.         if (random() > 0.5)
  337.             sound (self, CHAN_VOICE, "player/lburn1.wav", 1, ATTN_NORM);
  338.         else
  339.             sound (self, CHAN_VOICE, "player/lburn2.wav", 1, ATTN_NORM);
  340.         return;
  341.     }
  342.  
  343.     if (self.pain_finished > time)
  344.     {
  345.         self.axhitme = 0;
  346.         return;
  347.     }
  348.     self.pain_finished = time + 0.5;
  349.  
  350. // don't make multiple pain sounds right after each other
  351.  
  352. // ax pain sound
  353.     if (self.axhitme == 1)
  354.     {
  355.         self.axhitme = 0;
  356.         sound (self, CHAN_VOICE, "player/axhit1.wav", 1, ATTN_NORM);
  357.         return;
  358.     }
  359.     
  360.  
  361.     rs = rint((random() * 5) + 1);
  362.  
  363.     self.noise = "";
  364.     if (rs == 1)
  365.         self.noise = "player/pain1.wav";
  366.     else if (rs == 2)
  367.         self.noise = "player/pain2.wav";
  368.     else if (rs == 3)
  369.         self.noise = "player/pain3.wav";
  370.     else if (rs == 4)
  371.         self.noise = "player/pain4.wav";
  372.     else if (rs == 5)
  373.         self.noise = "player/pain5.wav";
  374.     else
  375.         self.noise = "player/pain6.wav";
  376.  
  377.     sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
  378.     return;
  379. };
  380.  
  381. void()    player_pain1 =    [    $pain1,    player_pain2    ] {PainSound();self.weaponframe=0;};
  382. void()    player_pain2 =    [    $pain2,    player_pain3    ] {};
  383. void()    player_pain3 =    [    $pain3,    player_pain4    ] {};
  384. void()    player_pain4 =    [    $pain4,    player_pain5    ] {};
  385. void()    player_pain5 =    [    $pain5,    player_pain6    ] {};
  386. void()    player_pain6 =    [    $pain6,    player_run    ] {};
  387.  
  388. void()    player_axpain1 =    [    $axpain1,    player_axpain2    ] {PainSound();self.weaponframe=0;};
  389. void()    player_axpain2 =    [    $axpain2,    player_axpain3    ] {};
  390. void()    player_axpain3 =    [    $axpain3,    player_axpain4    ] {};
  391. void()    player_axpain4 =    [    $axpain4,    player_axpain5    ] {};
  392. void()    player_axpain5 =    [    $axpain5,    player_axpain6    ] {};
  393. void()    player_axpain6 =    [    $axpain6,    player_run    ] {};
  394.  
  395. void() player_pain =
  396. {
  397.     if (self.weaponframe)
  398.         return;
  399.  
  400.     if (self.invisible_finished > time)
  401.         return;        // eyes don't have pain frames
  402.  
  403.     if (self.weapon == IT_AXE || self.weapon == IT_HOOK)
  404.         player_axpain1 ();
  405.     else
  406.         player_pain1 ();
  407. };
  408.  
  409. void() player_diea1;
  410. void() player_dieb1;
  411. void() player_diec1;
  412. void() player_died1;
  413. void() player_diee1;
  414. void() player_die_ax1;
  415.  
  416. void() DeathBubblesSpawn =
  417. {
  418. local entity    bubble;
  419.     if (self.owner.waterlevel != 3)
  420.         return;
  421.     bubble = spawn();
  422.     setmodel (bubble, "progs/s_bubble.spr");
  423.     setorigin (bubble, self.owner.origin + '0 0 24');
  424.     bubble.movetype = MOVETYPE_NOCLIP;
  425.     bubble.solid = SOLID_NOT;
  426.     bubble.velocity = '0 0 15';
  427.     bubble.nextthink = time + 0.5;
  428.     bubble.think = bubble_bob;
  429.     bubble.classname = "bubble";
  430.     bubble.frame = 0;
  431.     bubble.cnt = 0;
  432.     setsize (bubble, '-8 -8 -8', '8 8 8');
  433.     self.nextthink = time + 0.1;
  434.     self.think = DeathBubblesSpawn;
  435.     self.air_finished = self.air_finished + 1;
  436.     if (self.air_finished >= self.bubble_count)
  437.         remove(self);
  438. };
  439.  
  440. void(float num_bubbles) DeathBubbles =
  441. {
  442. local entity    bubble_spawner;
  443.     
  444.     bubble_spawner = spawn();
  445.     setorigin (bubble_spawner, self.origin);
  446.     bubble_spawner.movetype = MOVETYPE_NONE;
  447.     bubble_spawner.solid = SOLID_NOT;
  448.     bubble_spawner.nextthink = time + 0.1;
  449.     bubble_spawner.think = DeathBubblesSpawn;
  450.     bubble_spawner.air_finished = 0;
  451.     bubble_spawner.owner = self;
  452.     bubble_spawner.bubble_count = num_bubbles;
  453.     return;
  454. };
  455.  
  456.  
  457. void() DeathSound =
  458. {
  459. local float        rs;
  460.  
  461.     // water death sounds
  462.     if (self.waterlevel == 3)
  463.     {
  464.         DeathBubbles(20);
  465.         sound (self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NONE);
  466.         return;
  467.     }
  468.     
  469.     rs = rint ((random() * 4) + 1);
  470.     if (rs == 1)
  471.         self.noise = "player/death1.wav";
  472.     if (rs == 2)
  473.         self.noise = "player/death2.wav";
  474.     if (rs == 3)
  475.         self.noise = "player/death3.wav";
  476.     if (rs == 4)
  477.         self.noise = "player/death4.wav";
  478.     if (rs == 5)
  479.         self.noise = "player/death5.wav";
  480.  
  481.     sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE);
  482.     return;
  483. };
  484.  
  485.  
  486. void() PlayerDead =
  487. {
  488.     // CTFBOT [[[
  489.     // Allow bots to respawn
  490.     if (self.classname == "bot")
  491.     {
  492.         BotSelfDeActivate ();
  493.         return;
  494.     }
  495.     // CTFBOT ]]]
  496.  
  497.     self.nextthink = -1;
  498. // allow respawn after a certain time
  499.     self.deadflag = DEAD_DEAD;
  500. };
  501.  
  502. vector(float dm) VelocityForDamage =
  503. {
  504.     local vector v;
  505.  
  506.     v_x = 100 * crandom();
  507.     v_y = 100 * crandom();
  508.     v_z = 200 + 100 * random();
  509.  
  510.     if (dm > -50)
  511.     {
  512. //        dprint ("level 1\n");
  513.         v = v * 0.7;
  514.     }
  515.     else if (dm > -200)
  516.     {
  517. //        dprint ("level 3\n");
  518.         v = v * 2;
  519.     }
  520.     else
  521.         v = v * 10;
  522.  
  523.     return v;
  524. };
  525.  
  526. void(string gibname, float dm) ThrowGib =
  527. {
  528.     local    entity new;
  529.  
  530.     new = spawn();
  531.     new.origin = self.origin;
  532.     setmodel (new, gibname);
  533.     setsize (new, '0 0 0', '0 0 0');
  534.     
  535.     new.velocity = VelocityForDamage (dm);
  536.  
  537.     // CTFBOT EXTRAS [[[
  538.     /*
  539.     if (self.gib_velocity != '0 0 0')
  540.     {
  541.         new.velocity = self.gib_velocity;
  542.         new.velocity_x = ((random() * 2) - 1) * 30;
  543.         new.velocity_y = ((random() * 2) - 1) * 30;
  544.         new.velocity_z = ((random() * 2) - 1) * 30;
  545.     }
  546.     */
  547.     // CTFBOT EXTRAS ]]]
  548.     
  549.     new.movetype = MOVETYPE_BOUNCE;
  550.     new.solid = SOLID_NOT;
  551.     new.avelocity_x = random()*600;
  552.     new.avelocity_y = random()*600;
  553.     new.avelocity_z = random()*600;
  554.     new.think = SUB_Remove;
  555.     new.ltime = time;
  556.     new.nextthink = time + 10 + random()*10;
  557.     new.frame = 0;
  558.     new.flags = 0;
  559. };
  560.  
  561. void(string gibname, float dm) ThrowHead =
  562. {
  563.     setmodel (self, gibname);
  564.     self.frame = 0;
  565.     self.nextthink = -1;
  566.     self.movetype = MOVETYPE_BOUNCE;
  567.     self.takedamage = DAMAGE_NO;
  568.     self.solid = SOLID_NOT;
  569.     self.view_ofs = '0 0 8';
  570.     setsize (self, '-16 -16 0', '16 16 56');
  571.  
  572.     // CTFBOT EXTRAS [[[
  573.     /*
  574.     if (self.gib_velocity != '0 0 0')
  575.     {
  576.         self.velocity = self.gib_velocity;
  577.         self.velocity_x = ((random() * 2) - 1) * 30;
  578.         self.velocity_y = ((random() * 2) - 1) * 30;
  579.         self.velocity_z = ((random() * 2) - 1) * 30;
  580.     }
  581.     */
  582.     // CTFBOT EXTRAS ]]]
  583.  
  584.     self.velocity = VelocityForDamage (dm);
  585.     self.origin_z = self.origin_z - 24;
  586.     self.flags = self.flags - (self.flags & FL_ONGROUND);
  587.     self.avelocity = crandom() * '0 600 0';
  588. };
  589.  
  590.  
  591. void() GibPlayer =
  592. {
  593.     ThrowHead ("progs/h_player.mdl", self.health);
  594.     ThrowGib ("progs/gib1.mdl", self.health);
  595.     ThrowGib ("progs/gib2.mdl", self.health);
  596.     ThrowGib ("progs/gib3.mdl", self.health);
  597.  
  598.     self.deadflag = DEAD_DEAD;
  599.  
  600.     if (damage_attacker.classname == "teledeath")
  601.     {
  602.         self.staydeadtime = time + 2 + (random() * 3);
  603.         sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  604.         return;
  605.     }
  606.  
  607.     if (damage_attacker.classname == "teledeath2")
  608.     {
  609.         self.staydeadtime = time + 3 + (random() * 6);
  610.         sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  611.         return;
  612.     }
  613.         
  614.     if (random() < 0.5)
  615.         sound (self, CHAN_VOICE, "player/gib.wav", 1, ATTN_NONE);
  616.     else
  617.         sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NONE);
  618. };
  619.  
  620. void() PlayerDie =
  621. {
  622.     local    float    i;
  623.     
  624.     self.items = self.items - (self.items & IT_INVISIBILITY);
  625.     self.invisible_finished = 0;    // don't die as eyes
  626.     self.invincible_finished = 0;
  627.     self.super_damage_finished = 0;
  628.     self.radsuit_finished = 0;
  629.     self.modelindex = modelindex_player;    // don't use eyes
  630.  
  631.     if (deathmatch || coop) {
  632.         DropBackpack();
  633.         DropRune();
  634.         TeamCaptureDropFlagOfPlayer(self);
  635.     }
  636.     
  637.     if (self.killed == 2)
  638.         self.killed = 0;
  639.     else
  640.         self.killed = 1;
  641.     self.weaponmodel="";
  642.     self.view_ofs = '0 0 -8';
  643.     self.deadflag = DEAD_DYING;
  644.     self.solid = SOLID_NOT;
  645.     self.flags = self.flags - (self.flags & FL_ONGROUND);
  646.     self.movetype = MOVETYPE_TOSS;
  647.     if (self.velocity_z < 10)
  648.         self.velocity_z = self.velocity_z + random()*300;
  649.  
  650.     if (self.health < -40)
  651.     {
  652.         GibPlayer ();
  653.         self.gib_velocity = '0 0 0';        // CTFBOT EXTRAS
  654.         return;
  655.     }
  656.  
  657.     self.gib_velocity = '0 0 0';        // CTFBOT EXTRAS
  658.  
  659.     DeathSound();
  660.     
  661.     self.angles_x = 0;
  662.     self.angles_z = 0;
  663.     
  664.     if (self.weapon == IT_AXE || self.weapon == IT_HOOK)
  665.     {
  666.         player_die_ax1 ();
  667.         return;
  668.     }
  669.     
  670.     i = cvar("temp1");
  671.     if (!i)
  672.         i = 1 + floor(random()*6);
  673.     
  674.     if (i == 1)
  675.         player_diea1();
  676.     else if (i == 2)
  677.         player_dieb1();
  678.     else if (i == 3)
  679.         player_diec1();
  680.     else if (i == 4)
  681.         player_died1();
  682.     else
  683.         player_diee1();
  684.  
  685. };
  686.  
  687. void() set_suicide_frame =
  688. {    // used by klill command and diconnect command
  689. /*
  690.     if (self.model != "progs/player.mdl")
  691.         return;    // allready gibbed
  692. */
  693.     if (self.health <= 0)
  694.         return;
  695.     self.frame = $deatha11;
  696.     self.solid = SOLID_NOT;
  697.     self.movetype = MOVETYPE_TOSS;
  698.     self.deadflag = DEAD_DEAD;
  699.     self.nextthink = -1;
  700. };
  701.  
  702.  
  703. void()    player_diea1    =    [    $deatha1,    player_diea2    ] {};
  704. void()    player_diea2    =    [    $deatha2,    player_diea3    ] {};
  705. void()    player_diea3    =    [    $deatha3,    player_diea4    ] {};
  706. void()    player_diea4    =    [    $deatha4,    player_diea5    ] {};
  707. void()    player_diea5    =    [    $deatha5,    player_diea6    ] {};
  708. void()    player_diea6    =    [    $deatha6,    player_diea7    ] {};
  709. void()    player_diea7    =    [    $deatha7,    player_diea8    ] {};
  710. void()    player_diea8    =    [    $deatha8,    player_diea9    ] {};
  711. void()    player_diea9    =    [    $deatha9,    player_diea10    ] {};
  712. void()    player_diea10    =    [    $deatha10,    player_diea11    ] {};
  713. void()    player_diea11    =    [    $deatha11,    player_diea11 ] {PlayerDead();};
  714.  
  715. void()    player_dieb1    =    [    $deathb1,    player_dieb2    ] {};
  716. void()    player_dieb2    =    [    $deathb2,    player_dieb3    ] {};
  717. void()    player_dieb3    =    [    $deathb3,    player_dieb4    ] {};
  718. void()    player_dieb4    =    [    $deathb4,    player_dieb5    ] {};
  719. void()    player_dieb5    =    [    $deathb5,    player_dieb6    ] {};
  720. void()    player_dieb6    =    [    $deathb6,    player_dieb7    ] {};
  721. void()    player_dieb7    =    [    $deathb7,    player_dieb8    ] {};
  722. void()    player_dieb8    =    [    $deathb8,    player_dieb9    ] {};
  723. void()    player_dieb9    =    [    $deathb9,    player_dieb9    ] {PlayerDead();};
  724.  
  725. void()    player_diec1    =    [    $deathc1,    player_diec2    ] {};
  726. void()    player_diec2    =    [    $deathc2,    player_diec3    ] {};
  727. void()    player_diec3    =    [    $deathc3,    player_diec4    ] {};
  728. void()    player_diec4    =    [    $deathc4,    player_diec5    ] {};
  729. void()    player_diec5    =    [    $deathc5,    player_diec6    ] {};
  730. void()    player_diec6    =    [    $deathc6,    player_diec7    ] {};
  731. void()    player_diec7    =    [    $deathc7,    player_diec8    ] {};
  732. void()    player_diec8    =    [    $deathc8,    player_diec9    ] {};
  733. void()    player_diec9    =    [    $deathc9,    player_diec10    ] {};
  734. void()    player_diec10    =    [    $deathc10,    player_diec11    ] {};
  735. void()    player_diec11    =    [    $deathc11,    player_diec12    ] {};
  736. void()    player_diec12    =    [    $deathc12,    player_diec13    ] {};
  737. void()    player_diec13    =    [    $deathc13,    player_diec14    ] {};
  738. void()    player_diec14    =    [    $deathc14,    player_diec15    ] {};
  739. void()    player_diec15    =    [    $deathc15,    player_diec15 ] {PlayerDead();};
  740.  
  741. void()    player_died1    =    [    $deathd1,    player_died2    ] {};
  742. void()    player_died2    =    [    $deathd2,    player_died3    ] {};
  743. void()    player_died3    =    [    $deathd3,    player_died4    ] {};
  744. void()    player_died4    =    [    $deathd4,    player_died5    ] {};
  745. void()    player_died5    =    [    $deathd5,    player_died6    ] {};
  746. void()    player_died6    =    [    $deathd6,    player_died7    ] {};
  747. void()    player_died7    =    [    $deathd7,    player_died8    ] {};
  748. void()    player_died8    =    [    $deathd8,    player_died9    ] {};
  749. void()    player_died9    =    [    $deathd9,    player_died9    ] {PlayerDead();};
  750.  
  751. void()    player_diee1    =    [    $deathe1,    player_diee2    ] {};
  752. void()    player_diee2    =    [    $deathe2,    player_diee3    ] {};
  753. void()    player_diee3    =    [    $deathe3,    player_diee4    ] {};
  754. void()    player_diee4    =    [    $deathe4,    player_diee5    ] {};
  755. void()    player_diee5    =    [    $deathe5,    player_diee6    ] {};
  756. void()    player_diee6    =    [    $deathe6,    player_diee7    ] {};
  757. void()    player_diee7    =    [    $deathe7,    player_diee8    ] {};
  758. void()    player_diee8    =    [    $deathe8,    player_diee9    ] {};
  759. void()    player_diee9    =    [    $deathe9,    player_diee9    ] {PlayerDead();};
  760.  
  761. void()    player_die_ax1    =    [    $axdeth1,    player_die_ax2    ] {};
  762. void()    player_die_ax2    =    [    $axdeth2,    player_die_ax3    ] {};
  763. void()    player_die_ax3    =    [    $axdeth3,    player_die_ax4    ] {};
  764. void()    player_die_ax4    =    [    $axdeth4,    player_die_ax5    ] {};
  765. void()    player_die_ax5    =    [    $axdeth5,    player_die_ax6    ] {};
  766. void()    player_die_ax6    =    [    $axdeth6,    player_die_ax7    ] {};
  767. void()    player_die_ax7    =    [    $axdeth7,    player_die_ax8    ] {};
  768. void()    player_die_ax8    =    [    $axdeth8,    player_die_ax9    ] {};
  769. void()    player_die_ax9    =    [    $axdeth9,    player_die_ax9    ] {PlayerDead();};
  770.