Advertisement
Guest User

Untitled

a guest
Dec 16th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. void() R_MissileTouch =
  2. {
  3. local float damg;
  4.  
  5. if (other == self.owner)
  6. return; // don't explode on owner
  7.  
  8. if (pointcontents(self.origin) == CONTENT_SKY)
  9. {
  10. remove(self);
  11. return;
  12. }
  13.  
  14. damg = 15;
  15.  
  16. if (other.health)
  17. {
  18. if (other.classname == "monster_shambler")
  19. damg = damg * 0.5; // mostly immune
  20. T_Damage (other, self, self.owner, damg );
  21. }
  22.  
  23. // don't do radius damage to the other, because all the damage
  24. // was done in the impact
  25. T_RadiusDamage (self, self.owner, 5, other);
  26.  
  27. sound (self, CHAN_WEAPON, "rocktman/expld.wav", 1, ATTN_NORM);
  28. self.origin = self.origin - 8*normalize(self.velocity);
  29.  
  30. WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  31. WriteByte (MSG_BROADCAST, TE_EXPLOSION);
  32. WriteCoord (MSG_BROADCAST, self.origin_x);
  33. WriteCoord (MSG_BROADCAST, self.origin_y);
  34. WriteCoord (MSG_BROADCAST, self.origin_z);
  35.  
  36. BecomeExplosion ();
  37. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement