home *** CD-ROM | disk | FTP | other *** search
/ Hráč 1997 February / Hrac_09_1997-02_cd.bin / UTILS / QUAKE / EXTRA / KILLER90.ZIP / SRC / PLAYER.QC < prev    next >
Text File  |  1996-12-06  |  22KB  |  773 lines

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