home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / fragrock / shrapnel.qc < prev    next >
Encoding:
Text File  |  1996-08-08  |  705 b   |  35 lines

  1. void(entity targ,entity inflictor,entity attacker,float dmg) T_Damage;
  2. void(float dmg) spawn_touchblood;
  3.  
  4. float(float a, float b) min = {
  5.     if (a>b) 
  6.         return b; 
  7.     else 
  8.         return a;
  9. };
  10.  
  11. void() ShrapnelTouch = 
  12. {
  13.     if (other.solid == SOLID_TRIGGER)
  14.         return;
  15.     if (pointcontents(self.origin) == CONTENT_SKY)
  16.     {
  17.         remove(self);
  18.         return;
  19.     }
  20.     if (other.takedamage)
  21.     {
  22.         spawn_touchblood(20);
  23.         T_Damage(other,self,self.owner,20);
  24.     }
  25.     else
  26.     {
  27.         WriteByte(MSG_BROADCAST,SVC_TEMPENTITY);
  28.         WriteByte(MSG_BROADCAST,TE_SUPERSPIKE);
  29.         WriteCoord(MSG_BROADCAST,self.origin_x);
  30.         WriteCoord(MSG_BROADCAST,self.origin_y);
  31.         WriteCoord(MSG_BROADCAST,self.origin_z);
  32.     }
  33.     remove(self);
  34. };
  35.