Advertisement
Matsilagi

RPG outputs.lua

Jun 10th, 2014
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1.  
  2. ENT.Sound = {}
  3. ENT.Sound.Explode = "BaseGrenade.Explode"
  4.  
  5. // Nice helper function, this does all the work.
  6.  
  7. /*---------------------------------------------------------
  8. Name: DoExplodeEffect
  9. ---------------------------------------------------------*/
  10. function ENT:DoExplodeEffect()
  11.  
  12. local info = EffectData();
  13. info:SetEntity( self.Entity );
  14. info:SetOrigin( self.Entity:GetPos() );
  15.  
  16. util.Effect( "Explosion", info );
  17.  
  18. end
  19.  
  20. /*---------------------------------------------------------
  21. Name: OnExplode
  22. Desc: The grenade has just exploded.
  23. ---------------------------------------------------------*/
  24. function ENT:OnExplode( pTrace )
  25.  
  26. if ((pTrace.Entity != game.GetWorld()) || (pTrace.HitBox != 0)) then
  27. // non-world needs smaller decals
  28. if( pTrace.Entity && !pTrace.Entity:IsNPC() ) then
  29. util.Decal( "SmallScorch", pTrace.HitPos + pTrace.HitNormal, pTrace.HitPos - pTrace.HitNormal );
  30. end
  31. else
  32. util.Decal( "Scorch", pTrace.HitPos + pTrace.HitNormal, pTrace.HitPos - pTrace.HitNormal );
  33. end
  34.  
  35. end
  36.  
  37. /*---------------------------------------------------------
  38. Name: OnInitialize
  39. ---------------------------------------------------------*/
  40. function ENT:OnInitialize()
  41. end
  42.  
  43. /*---------------------------------------------------------
  44. Name: StartTouch
  45. ---------------------------------------------------------*/
  46. function ENT:StartTouch( entity )
  47. end
  48.  
  49. /*---------------------------------------------------------
  50. Name: EndTouch
  51. ---------------------------------------------------------*/
  52. function ENT:EndTouch( entity )
  53. end
  54.  
  55. function ENT:Touch( pOther )
  56.  
  57. assert( pOther );
  58. if ( pOther:GetSolid() == SOLID_NONE ) then
  59. return;
  60. end
  61.  
  62. // If I'm live go ahead and blow up
  63. if (self.m_bIsLive) then
  64. self:Detonate();
  65. else
  66. // If I'm not live, only blow up if I'm hitting an chacter that
  67. // is not the owner of the weapon
  68. local pBCC = pOther;
  69. if (pBCC && self.Entity:GetOwner() != pBCC) then
  70. self.m_bIsLive = true;
  71. self:Detonate();
  72. end
  73. end
  74.  
  75. end
  76.  
  77. /*---------------------------------------------------------
  78. Name: OnThink
  79. ---------------------------------------------------------*/
  80. function ENT:OnThink()
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement