Пример #1
0
        public static Vector3 GetJungleSafeTumblePos(Obj_AI_Base target)
        {
            var cursorPos = Game.CursorPos;

            if (IsSafeTumblePos(cursorPos))
            {
                return(cursorPos);
            }

            if (!target.IsValidTarget())
            {
                return(Vector3.Zero);
            }

            var targetPosition = target.ServerPosition;

            var myTumbleRangeCircle =
                new QGeometry.Circle(ObjectManager.Player.ServerPosition.To2D(), 300).topolygon().ToClipperPath();

            var goodCandidates = from p in myTumbleRangeCircle
                                 select new Vector2(p.X, p.Y).To3D() into v3
                                 let dist = v3.Distance(targetPosition)
                                            where dist > MenuManager.ComboMenu["QDistance"].Cast <Slider>().CurrentValue&& dist < 500
                                            select v3;

            return(goodCandidates.OrderByDescending(candidate => candidate.Distance(cursorPos)).FirstOrDefault());
        }
Пример #2
0
        public static Vector3 GetSafeTumblePos(AIHeroClient target)
        {
            if (!target.IsValidTarget()) return Vector3.Zero;

            var targetPosition = target.ServerPosition;

            var myTumbleRangeCircle =
                new QGeometry.Circle(ObjectManager.Player.ServerPosition.To2D(), 300).topolygon().ToClipperPath();

            var goodCandidates = from p in myTumbleRangeCircle
                                 select new Vector2(p.X, p.Y).To3D() into v3
                                 let dist = v3.Distance(targetPosition)
                                 where dist > MenuManager.ComboMenu["QDistance"].Cast<Slider>().CurrentValue && dist < 500
                                 select v3;

            return goodCandidates.OrderBy(candidate => candidate.Distance(Game.CursorPos)).FirstOrDefault();
        }