WeltEnSTurm

Untitled

Sep 13th, 2010
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1.  
  2. AddCSLuaFile("cl_init.lua")
  3. AddCSLuaFile("shared.lua")
  4. include("shared.lua")
  5.  
  6. ENT.Range=2000
  7. ENT.Damage=200
  8. ENT.BulletSpeed=1000
  9. ENT.BulletWeight=100
  10. ENT.BulletRadius=30
  11. ENT.FireRate=5
  12. ENT.Speed=7
  13. ENT.Height=10
  14. ENT.Turnspeed=10
  15. ENT.Maxturnspeed=50
  16.  
  17. ENT.FireSound="WAC/tank/T98_cannon_3p.wav"
  18. ENT.FireSoundLevel=100
  19.  
  20. ENT.Model="models/WeltEnSTurm/RTS/tanks/tank03_body.mdl"
  21. ENT.Mass=100
  22.  
  23. ENT.TopParts={
  24.     turret={
  25.         model="models/WeltEnSTurm/RTS/tanks/tank03_turret.mdl",
  26.         pos=Vector(0,0,5.5),
  27.     },
  28.     gun={
  29.         model="models/WeltEnSTurm/RTS/tanks/tank03_gun.mdl",
  30.         pos=Vector(0,4.5,7),
  31.     }
  32. }
  33.  
  34. local x=CreateConVar("wacrts_x",1,{FCVAR_REPLICATED})
  35. local y=CreateConVar("wacrts_y",50,{FCVAR_REPLICATED})
  36.  
  37. function ENT:CalculateTravel(vTarget,vVelocity)
  38.     if vVelocity then
  39.         vTarget=vTarget+vVelocity*3
  40.     end
  41.     local dist=vTarget:Distance(self.Gun:GetPos())
  42.     local fwd=(vTarget-self:GetPos()):Normalize()
  43.     local ang=fwd:Angle()
  44.     ang.p=-90+math.asin(dist*0.01905*10/self.BulletSpeed*0.01905^2+dist^3/210000000000000)*360*700
  45.     return self:GetPos()+ang:Forward()*self.Range
  46. end
  47.  
  48. function ENT:CalculateRange()
  49.     return self.BulletSpeed*0.01905^2/10*math.sin(2*45)*45000
  50. end
  51.  
  52. function ENT:CalculateIdleTarget()
  53.     return self:GetPos()+self:GetForward()*999999
  54. end
Add Comment
Please, Sign In to add comment