Example #1
0
        public static void Interceptiontest(Obj_AI_Hero Enemy, float delay, float Range, float varRange)
        {
            Geometry.Polygon.Circle Qspellpoly = new Geometry.Polygon.Circle(LastQCastpos, Q.Width);
            Qspellpoly.Draw(System.Drawing.Color.Khaki);

            Paths subjs = new Paths();

            foreach (var Waypoint in WPPolygon(Enemy, delay).ToPolygons())
            {
                subjs.Add(Waypoint.ToClipperPath());
            }

            Paths clips = new Paths(1);

            clips.Add(Qspellpoly.ToClipperPath());

            Paths   solution = new Paths();
            Clipper c        = new Clipper();

            c.AddPaths(subjs, PolyType.ptSubject, true);
            c.AddPaths(clips, PolyType.ptClip, true);
            c.Execute(ClipType.ctIntersection, solution);

            foreach (var bli in solution.ToPolygons())
            {
                bli.Draw(System.Drawing.Color.Blue);
            }
        }
Example #2
0
        private static void InterceptionQ(Obj_AI_Hero Enemy)
        {
            Geometry.Polygon.Circle Qspellpoly = new Geometry.Polygon.Circle(PreCastPos(Enemy, 0.6f), 130f);

            Paths subjs = new Paths();

            foreach (var bla in WPPolygon(Enemy).ToPolygons())
            {
                subjs.Add(bla.ToClipperPath());
            }

            Paths clips = new Paths(1);

            clips.Add(Qspellpoly.ToClipperPath());

            Paths   solution = new Paths();
            Clipper c        = new Clipper();

            c.AddPaths(subjs, PolyType.ptSubject, true);
            c.AddPaths(clips, PolyType.ptClip, true);
            c.Execute(ClipType.ctIntersection, solution);

            foreach (var bli in solution.ToPolygons())
            {
                bli.Draw(System.Drawing.Color.Blue);
            }
        }
Example #3
0
        public static Paths WPPolygon(Obj_AI_Hero Hero, float delay)
        {
            List <Vector2Time> HeroPath = Hero.GetWaypointsWithTime();
            Vector2            myPath;
            Paths WPPaths = new Paths();

            for (var i = 0; i < HeroPath.Count() - 1; i++)
            {
                if (HeroPath.ElementAt <Vector2Time>(i + 1).Time <= delay)
                {
                    Geometry.Polygon.Rectangle WPRectangle = new Geometry.Polygon.Rectangle(HeroPath.ElementAt <Vector2Time>(i).Position, HeroPath.ElementAt <Vector2Time>(i + 1).Position, Hero.BoundingRadius);
                    Geometry.Polygon.Circle    Box         = new Geometry.Polygon.Circle(HeroPath.ElementAt <Vector2Time>(i).Position, Hero.BoundingRadius);
                    WPPaths.Add(Box.ToClipperPath());
                    WPPaths.Add(WPRectangle.ToClipperPath());
                }
                else
                {
                    myPath = PositionAfter(Hero, delay, Hero.MoveSpeed);
                    Geometry.Polygon.Rectangle WPRectangle = new Geometry.Polygon.Rectangle(HeroPath.ElementAt <Vector2Time>(i).Position, myPath, Hero.BoundingRadius);
                    Geometry.Polygon.Circle    Box         = new Geometry.Polygon.Circle(myPath, Hero.BoundingRadius);
                    WPPaths.Add(Box.ToClipperPath());
                    WPPaths.Add(WPRectangle.ToClipperPath());
                    break;
                }
            }
            Geometry.Polygon.Circle WPFirstBox = new Geometry.Polygon.Circle(HeroPath.First <Vector2Time>().Position, Hero.BoundingRadius);
            WPPaths.Add(WPFirstBox.ToClipperPath());
            return(WPPaths);
        }
Example #4
0
        public static void Interceptiontest(AIHeroClient Enemy, float delay, float Range)
        {
            Geometry.Polygon.Circle Qspellpoly = new Geometry.Polygon.Circle(PreCastPos(Enemy, Range, delay), 130f);
            Qspellpoly.Draw(System.Drawing.Color.Khaki);

            Paths subjs = new Paths();

            foreach (var bla in WPPolygon(Enemy, delay).ToPolygons())
            {
                subjs.Add(bla.ToClipperPath());
            }

            Paths clips = new Paths(1);

            clips.Add(Qspellpoly.ToClipperPath());

            Paths   solution = new Paths();
            Clipper c        = new Clipper();

            c.AddPaths(subjs, PolyType.ptSubject, true);
            c.AddPaths(clips, PolyType.ptClip, true);
            c.Execute(ClipType.ctIntersection, solution);

            foreach (var bli in solution.ToPolygons())
            {
                bli.Draw(System.Drawing.Color.Blue);
            }
        }