Пример #1
0
        public Vector3 orbwalkerGoodPos(Obj_AI_Base target)
        {
            var aRc                = new Util.Circle(Player.Instance.ServerPosition.To2D(), 350).ToClipperPath();
            var cursorPos          = Game.CursorPos;
            var targetPosition     = target.ServerPosition;
            var pList              = new List <Vector3>();
            var additionalDistance = (0.106 + Game.Ping / 2000f) * target.MoveSpeed;

            foreach (var v3 in aRc.Select(p => new Vector2(p.X, p.Y).To3D()))
            {
                if (target.IsFacing(Player.Instance))
                {
                    if (v3.Distance(targetPosition) < 350)
                    {
                        pList.Add(v3);
                    }
                }
                else
                {
                    if (v3.Distance(targetPosition) < 350 - additionalDistance)
                    {
                        pList.Add(v3);
                    }
                }
            }
            return(pList.Count > 1 ? pList.OrderByDescending(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero);
        }
Пример #2
0
 public Vector3 orbwalkerGoodPos(Obj_AI_Base target)
 {
     var aRc = new Util.Circle(Player.Instance.ServerPosition.To2D(), 350).ToClipperPath();
     var cursorPos = Game.CursorPos;
     var targetPosition = target.ServerPosition;
     var pList = new List<Vector3>();
     var additionalDistance = (0.106 + Game.Ping / 2000f) * target.MoveSpeed;
     foreach (var v3 in aRc.Select(p => new Vector2(p.X, p.Y).To3D()))
     {
         if (target.IsFacing(Player.Instance))
         {
             if (v3.Distance(targetPosition) < 350) pList.Add(v3);
         }
         else
         {
             if (v3.Distance(targetPosition) < 350 - additionalDistance) pList.Add(v3);
         }
     }
     return pList.Count > 1 ? pList.OrderByDescending(el => el.Distance(cursorPos)).FirstOrDefault() : Vector3.Zero;
 }