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