private static Paths WPPolygon(Obj_AI_Hero Hero) { 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 <= 0.6f) { 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, 0.6f, 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; }
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); } }
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); } }