Exemplo n.º 1
0
 private Geometry.Polygon.Sector GetSimplePolygon(bool predictPosition = false)
 {
     var basePos = predictPosition ? SpellManager.Q.GetPrediction(Target).UnitPosition : Target.ServerPosition;
     var pos = basePos + GetPassiveOffset();
     var r = Passive == PassiveType.UltPassive ? 400 : PolygonRadius;
     var sector = new Geometry.Polygon.Sector(basePos, pos, Geometry.DegreeToRadian(PolygonAngle), r);
     sector.UpdatePolygon();
     return sector;
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Called when the game draws itself.
        /// </summary>
        /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
        private static void OnDraw(EventArgs args)
        {
            try
            {
                if (Player.IsDead)
                {
                    return;
                }

                if (IsActive("GFUELTalon.Draw.W") && W.IsReady())
                {
                    var target = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);

                    if (target.IsValidTarget() == false)
                    {
                        return;
                    }

                    var polygon = new Geometry.Polygon.Sector(
                        ObjectManager.Player.Position,
                        target.Position,
                        54 * (float)Math.PI / 180,
                        700);
                    polygon.UpdatePolygon();
                    polygon.Draw(Color.Aqua);
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Exemplo n.º 3
0
        private Geometry.Polygon GetFilledPolygon(bool predictPosition = false)
        {
            var basePos = predictPosition ? SpellManager.Q.GetPrediction(Target).UnitPosition : Target.ServerPosition;
            var pos = basePos + GetPassiveOffset();
            //var polygons = new List<Geometry.Polygon>();
            var list = new List<Vector2>();
            var r = Passive == PassiveType.UltPassive ? 400 : PolygonRadius;
            var angle = Geometry.DegreeToRadian(PolygonAngle);

            for (var i = 100; i < r; i += 10)
            {
                if (i > r)
                {
                    break;
                }

                var sector = new Geometry.Polygon.Sector(basePos, pos, angle, i);
                sector.UpdatePolygon();
                list.AddRange(sector.Points);
                //polygons.Add(sector);
            }

            return new Geometry.Polygon { Points = list.Distinct().ToList() };
            //return polygons.JoinPolygons().FirstOrDefault();
        }
Exemplo n.º 4
0
        private Geometry.Polygon GetFilledPolygon(bool predictPosition = false)
        {
            var basePos = predictPosition ? SpellManager.Q.GetPrediction(Target).UnitPosition : Target.ServerPosition;
            var pos = basePos + GetPassiveOffset();
            var points = new List<Vector2>();
            for (var i = 100; i < PolygonRadius; i += 10)
            {
                if (i > PolygonRadius)
                {
                    break;
                }

                var calcRads = PolygonAngle; //PolygonRadius - i < 50 ? PolygonAngle - 20 : PolygonAngle;
                var sector = new Geometry.Polygon.Sector(basePos, pos, Geometry.DegreeToRadian(calcRads), i, 30);
                sector.UpdatePolygon();
                points.AddRange(sector.Points);
            }

            points.RemoveAll(p => p.Distance(basePos) < 100);
            return new Geometry.Polygon { Points = points.Distinct().ToList() };
        }