예제 #1
0
        public static void CastE(Obj_AI_Base target, bool flash = false)
        {
            var canFlash = flash && SummonerSpells.IsValid(SummonerSpells.Flash) && target.Distance(Global.Player) > E.Range && target.Distance(Global.Player) < E.Range + 425;

            var pred = E.GetPrediction(target);

            BodySlam = new Geometry.Rectangle(
                canFlash ? Global.Player.ServerPosition.Extend(target.ServerPosition, 425 + E.Range - target.BoundingRadius).To2D() : Global.Player.ServerPosition.To2D(),
                Global.Player.ServerPosition.Extend(pred.CastPosition, E.Range).To2D(),
                EHitboxRadius);

            if (BodySlam.IsOutside(target.ServerPosition.To2D()))
            {
                return;
            }

            if (GameObjects.EnemyMinions.Any(x => BodySlam.IsInside(x.ServerPosition.To2D()) && x.Distance(BodySlam.Start) <= target.Distance(BodySlam.Start) &&
                                             x.Distance(target) >= Global.Player.BoundingRadius + 200))
            {
                return;
            }

            if (canFlash)
            {
                E.Cast(target.ServerPosition);
                DelayAction.Queue(300, () => SummonerSpells.Flash.Cast(target.ServerPosition), new CancellationToken(false));
                return;
            }

            E.Cast(target.ServerPosition);
        }
예제 #2
0
        public static void CastE(Obj_AI_Base target)
        {
            var rect = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), target.ServerPosition.To2D(), 80 + E.Width);

            if (target.IsValidTarget(E.Range) && !GameObjects.Enemy.OrderBy(x => x.Distance(Global.Player)).Any(x => x.NetworkId != target.NetworkId && rect.IsInside(x.ServerPosition.To2D()) && Global.Player.Distance(x) < Global.Player.Distance(target)))
            {
                E.Cast(target);
            }
        }
예제 #3
0
        public static Vector3 GeneratePaddleStarPrediction(Obj_AI_Base target, Spell spell)
        {
            if (PaddleStarPosition != Vector3.Zero)
            {
                return(Vector3.Zero);
            }

            var dir = target.Orientation.To2D();
            var pos = target.ServerPosition + (target.ServerPosition - Global.Player.ServerPosition).Normalized();

            for (var i = 0; i < 360; i += 10)
            {
                var angleRad = Maths.DegreeToRadian(i);
                var rotated  = (pos.To2D() + spell.Range * dir.Rotated((float)angleRad)).To3D();

                var rectBefore = new Geometry.Rectangle(Global.Player.ServerPosition.To2D(), rotated.To2D(), Q.Width + target.BoundingRadius);
                var rectAfter  = new Geometry.Rectangle(rotated.To2D(), Q.GetPrediction(target).CastPosition.To2D(), Q.Width + target.BoundingRadius + 100);

                if (GameObjects.Enemy.OrderBy(x => x.Distance(Global.Player)).
                    Where(x => x.NetworkId != target.NetworkId).
                    Any(x => x.MaxHealth > 20 && (rectAfter.IsInside(x.ServerPosition.To2D()) || rectBefore.IsInside(x.ServerPosition.To2D()))))
                {
                    continue;
                }

                if (GameObjects.Jungle.OrderBy(x => x.Distance(Global.Player)).
                    Where(x => x.NetworkId != target.NetworkId).
                    Any(x => x.MaxHealth > 20 && (rectAfter.IsInside(x.ServerPosition.To2D()) || rectBefore.IsInside(x.ServerPosition.To2D()))))
                {
                    continue;
                }

                if (rotated.Distance(target) < Global.Player.Distance(target) || rotated.Distance(Global.Player) > Q.Range + 200)
                {
                    continue;
                }

                return(rotated);
            }

            return(Vector3.Zero);
        }