예제 #1
0
파일: RangesBase.cs 프로젝트: riwalry1/AIO
        /// <summary>
        /// Draws the ally zone.
        /// </summary>
        public void DrawAllyZone()
        {
            var currentPath = GetAllyPoints().Select(v2 => new IntPoint(v2.X, v2.Y)).ToList();
            var currentPoly = Geometry.ToPolygon(currentPath);

            currentPoly.Draw(Color.Green);
        }
예제 #2
0
파일: RangesBase.cs 프로젝트: riwalry1/AIO
        /// <summary>
        /// Gets the ally points.
        /// </summary>
        /// <param name="dynamic">if set to <c>true</c> it will use a dynamic range.</param>
        /// <returns></returns>
        private List <Vector2> GetAllyPoints(bool dynamic = true)
        {
            var staticRange  = 360f;
            var polygonsList = Variables.AlliesClose.Select(enemy => new Geometry.Circle(enemy.ServerPosition.LSTo2D(), (dynamic ? (enemy.IsMelee ? enemy.AttackRange * 1.5f : enemy.AttackRange) : staticRange) + enemy.BoundingRadius + 20).ToPolygon()).ToList();
            var pathList     = Geometry.ClipPolygons(polygonsList);
            var pointList    = pathList.SelectMany(path => path, (path, point) => new Vector2(point.X, point.Y)).Where(currentPoint => !currentPoint.LSIsWall()).ToList();

            return(pointList);
        }