home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / qwiz12 / shocking.qc < prev    next >
Encoding:
Text File  |  1996-08-16  |  1.5 KB  |  65 lines

  1. /*
  2.  
  3. ==============================================================================
  4.  
  5. Shocking Grasp
  6.  
  7. ==============================================================================
  8.  
  9. */
  10.  
  11.  
  12. float Kick_em = 0;        // ==1, when touched, kicks that player/monster
  13.  
  14. //--------------------------------------------------------------------
  15. // Fire Shock
  16. //--------------------------------------------------------------------
  17.  
  18. void() PlayerTouch =
  19. {
  20.  if(other.takedamage != DAMAGE_AIM)
  21.    return;
  22.  if(!Kick_em)
  23.    return;
  24.    
  25.  // boot them in the rear!
  26.  if(other.classname == "player")    // only advertise player kicking
  27.  {
  28.   bprint(self.netname);
  29.   bprint(" gives ");
  30.   bprint(other.netname);
  31.   bprint(" the boot.\n");
  32.  }
  33.  other.velocity_x = other.velocity_x + self.velocity_x;
  34.  other.velocity_y = other.velocity_y + self.velocity_y;
  35.  
  36.  other.velocity_z = other.velocity_z + 100;    // add lift
  37.  
  38.  if(other.flags & FL_ONGROUND)
  39.    other.flags = other.flags - FL_ONGROUND;
  40. };
  41.  
  42.  
  43.  
  44. //--------------------------------------------------------------------
  45. // Checks if Shock can be fired
  46. //--------------------------------------------------------------------
  47. void() ShockingC = 
  48. {
  49.     Kick_em = 1;
  50. //    else
  51. //      Kick_em = 0;
  52. //    return;
  53.  
  54.     if (self.ammo_cells < 10)
  55.     {
  56.         sprint(self,"cells are low\n");
  57.         return;
  58.     }
  59.       self.currentammo = self.ammo_cells = self.ammo_cells - 10;
  60.     W_SetCurrentAmmo();
  61.  
  62.     sound (self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM);
  63.  
  64. };
  65.