Guest User

Untitled

a guest
Dec 1st, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. elseif bot:hasWeapon(weapon) and weapon == Weapon.Seeker and prevtarget ~= nil then
  2. -- Base the minimum angle to turn corners on the difficulty rating (more difficult, more likely to shoot around a corner)
  3. angle = (math.pi / 2.0) * difficulty
  4. -- Check if the angle between where we are firing and where the target is will be large enough for the seeker to navigate
  5. -- and whether the seeker will be able to find the target when it reaches the prevtarget
  6. if(math.abs(angleDifference(point.angleTo(bot:getPos(),obj:getPos()), dirToGo)) < angle and
  7. point.distSquared(prevtarget,obj:getPos()) < 160000) then
  8. bot:setAngle(dirToGo)
  9. bot:fireWeapon(weapon)
  10. end
  11. return(true)
Advertisement
Add Comment
Please, Sign In to add comment