home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / sgqcver3 / head.qc < prev    next >
Encoding:
Text File  |  1996-08-21  |  1.7 KB  |  60 lines

  1. /*This is basically AsmodeusB's solid corpse code changed a little
  2. bit to be more accomodating to solid gibbed heads
  3. */
  4.  
  5. void() HeadPain =
  6. {
  7.  SpawnMeatSpray (self.origin, crandom() * 100 * v_right);
  8. };
  9.  
  10. void() HeadMove = 
  11. {
  12.  local float dir;
  13.  
  14.  if(other.takedamage != DAMAGE_AIM)     // not living
  15.    return;
  16.  
  17.  self.origin_z = self.origin_z + 2;             // lift off of the ground
  18.  self.velocity_x = other.velocity_x;
  19.  self.velocity_y = other.velocity_y;
  20.  // no z or we can push the head into the ground
  21.  
  22.  self.velocity = self.velocity + '0 0 7';    // add lift
  23.  
  24.  if(self.flags & FL_ONGROUND)
  25.    self.flags = self.flags - FL_ONGROUND;
  26. };
  27.  
  28. void() HeadDie =
  29. {
  30.      if (damage_attacker.classname == "teledeath")
  31.              sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  32.      else if (damage_attacker.classname == "teledeath2")
  33.              sound (self, CHAN_VOICE, "player/teledth1.wav", 1, ATTN_NONE);
  34.      else
  35.          sound (self, CHAN_AUTO, "player/udeath.wav", 1, ATTN_NORM);
  36.      ThrowGib ("progs/zom_gib.mdl", self.health);
  37.      ThrowGib ("progs/zom_gib.mdl", self.health);
  38.      ThrowGib ("progs/zom_gib.mdl", self.health);
  39.      remove(self);
  40. };
  41.  
  42. void() MakeSolidHead =
  43. {
  44.         self.health = 10;
  45. // DAMAGE_AIM so that grenades don't bounce off like they do for DAMAGE_YES
  46.         self.movetype = MOVETYPE_STEP;
  47.     self.takedamage = DAMAGE_AIM;
  48.     self.solid = SOLID_BBOX;
  49.     self.flags = self.flags & (!FL_MONSTER);
  50.         self.touch = HeadMove;
  51.     setsize (self, '-16 -16 0', '16 16 56');
  52.     self.th_stand = SUB_Null;
  53.     self.th_walk = SUB_Null;
  54.     self.th_run = SUB_Null;
  55.         self.th_pain = HeadPain;
  56.     self.th_melee = SUB_Null;
  57.     self.th_missile = SUB_Null;
  58.         self.th_die = HeadDie;
  59. };
  60.