Ejemplo n.º 1
0
        public static void CastEQ(List <Obj_AI_Base> dashEnemies, bool ks, bool goUnderEnemyTower, List <Obj_AI_Base> EQEnemies = null)
        {
            if (!Program.E.IsReady() || !YasuoCalcs.WillQBeReady() || didActionThisTick ||
                !dashEnemies.Any(a => a.IsInRange(Yasuo, Program.E.Range)) ||
                Yasuo.GetNearbyEnemies(Program.E.Range).Count() == 0 || YasuoCalcs.IsDashing())
            {
                return;
            }

            if (EQEnemies == null)
            {
                EQEnemies = dashEnemies;
            }

            int         numberOfEnemiesHitWithEQ = 0;
            Obj_AI_Base unitToDashTo             = null;

            List <Obj_AI_Base> possibleDashUnits = dashEnemies.Where(a => a.MeetsCriteria() && a.IsInRange(Yasuo, Program.E.Range) && YasuoCalcs.ERequirements(a, goUnderEnemyTower) && a.Health > YasuoCalcs.E(a)).ToList();

            foreach (Obj_AI_Base possibleDashUnit in possibleDashUnits)
            {
                List <Obj_AI_Base> unitsHitWithEQ = EQEnemies.Where(a => a.MeetsCriteria() && a.Position(250).IsInRange(YasuoCalcs.GetDashingEnd(possibleDashUnit), Program.EQ.Range)).ToList();
                if (ks)
                {
                    unitsHitWithEQ = unitsHitWithEQ.Where(a => a.Health <= YasuoCalcs.Q(a) || (a.Name == possibleDashUnit.Name && a.Health <= YasuoCalcs.Q(a) + YasuoCalcs.E(a))).ToList();
                }

                if (numberOfEnemiesHitWithEQ < unitsHitWithEQ.Count())
                {
                    numberOfEnemiesHitWithEQ = unitsHitWithEQ.Count();
                    unitToDashTo             = possibleDashUnit;
                }
            }

            if (unitToDashTo != null && numberOfEnemiesHitWithEQ >= 1 && !didActionThisTick)
            {
                CastE(unitToDashTo);
                if (YasuoCalcs.GetQReadyTimeInt() == 0)
                {
                    Core.DelayAction(delegate { CastEQsQ(EQEnemies); }, 100);
                }
                else
                {
                    Core.DelayAction(delegate { CastEQsQ(EQEnemies); }, YasuoCalcs.GetQReadyTimeInt());
                }
                didActionThisTick = true;
            }
        }