home *** CD-ROM | disk | FTP | other *** search
/ PC/CD Gamer UK 46 / PCGAMER46.bin / Quake / QuakeC / Collect / COLLECT.EXE / SOURCES.ZIP / PLAYDEAD.QC < prev    next >
Encoding:
Text File  |  1997-01-16  |  2.5 KB  |  86 lines

  1. /*
  2. ==============================================================================
  3.  
  4. Secondary Impulse Command Checker
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. void() player_stand1;
  10. void() player_diea1;
  11. void() player_dieb1;
  12. void() player_diec1;
  13.  
  14. //=============================================================
  15. // PlayDead  -  Simulates player death
  16. //=============================================================
  17. void () PlayDead =
  18. {
  19.         local float i;
  20.  
  21.         self.play_dead = 1;
  22.  
  23.      // Turn off bonus.
  24.         self.invisible_finished = 0;    // don't die as eyes
  25.         self.invincible_finished = 0;
  26.         self.super_damage_finished = 0;
  27.         self.radsuit_finished = 0;
  28.      // Chages vision.
  29.         self.view_ofs = '0 0 -8';
  30.  
  31.      // Commented for now ( trying to decide... )
  32.      /* Changes move to TOSS
  33.         self.movetype = MOVETYPE_TOSS;
  34.         if (self.velocity_z < 10)
  35.             self.velocity_z = self.velocity_z + random()*300;
  36.      */
  37.      
  38.      // Change weapon to shotgun
  39.         self.play_dead_weapon = self.weapon;
  40.         self.weapon = IT_SHOTGUN;
  41.         self.currentammo = self.ammo_shells;
  42.         self.weaponmodel = "progs/v_shot.mdl";
  43.         self.weaponframe = 0;
  44.         self.items = self.items | IT_SHELLS;
  45.  
  46.      // Play death frames
  47.         i = 1 + floor(random()*3);
  48.         if (i == 1) player_diea1();
  49.         else if (i == 2) player_dieb1();
  50.         else player_diec1();
  51.  
  52.         bprint ("SOMEONE IS PLAYING DEAD...\n");
  53. };
  54.  
  55. //=============================================================
  56. // Awake  -  Returns player to normal
  57. //=============================================================
  58. void () Awake =
  59. {
  60.         self.view_ofs = '0 0 22';
  61.  
  62.      // Back to normal movement
  63.      //     self.movetype = MOVETYPE_WALK;
  64.  
  65.      // Restore weapons
  66.         self.weapon = self.play_dead_weapon;
  67.         W_SetCurrentAmmo();
  68.  
  69.         self.play_dead = 0;
  70.         player_stand1();
  71. };
  72.  
  73. //=============================================================
  74. // CheckSecondaryImpulseCommands - Called by weapons.qc before
  75. // processing impulses
  76. // Later it will include an autogib routine to kill permanent
  77. // users of the playdead routine.
  78. //=============================================================
  79. void () CheckSecondaryImpulseCommands =
  80. {
  81.           if (self.impulse == 100)
  82.                 PlayDead ();
  83.           else if (self.impulse == 101)
  84.                 Awake ();
  85. };
  86.