Exemple #1
0
 private void CastEr()
 {
     if (E.IsReady && R.IsReady)
     {
         E.CachedPredictions.Clear();
         var eWidth     = E.Width;
         var eCastDelay = E.CastDelay;
         E.CastDelay = R.CastDelay + eCastDelay;
         E.Width     = R.Range;
         E.Type      = SpellType.Circular;
         var enemyList = (from enemy in UnitManager.ValidEnemyHeroes
                          select E.GetPrediction(enemy)
                          into pred
                          where pred.HitChancePercent >= R.HitChancePercent / 2f
                          select pred.CastPosition).ToList();
         if (enemyList.Count >= ComboMenu.Slider("R.Hit"))
         {
             var allyList =
                 UnitManager.ValidAllyHeroesInRange.Select(ally => E.GetPrediction(ally))
                 .Select(pred => pred.CastPosition.To2D()).ToList();
             var bestCount = -1;
             var bestPoint = default(Vector2);
             var result    = Enumerable.Range(1, (1 << allyList.Count) - 1).Select(index => allyList.Where((item, idx) => ((1 << idx) & index) != 0).ToList()).ToList();
             foreach (var points in result)
             {
                 var polygon = new Geometry.Polygon();
                 polygon.Points.AddRange(points);
                 var center = polygon.CenterOfPolygon();
                 var count  = enemyList.Count(v => center.IsInRange(v, R.Range * 1.4f));
                 if (count > bestCount)
                 {
                     bestCount = count;
                     bestPoint = center;
                 }
             }
             if (bestCount >= ComboMenu.Slider("R.Hit"))
             {
                 var allyNear =
                     UnitManager.ValidAllyHeroesInRange.OrderBy(h => h.Distance(bestPoint, true))
                     .FirstOrDefault();
                 if (allyNear != null)
                 {
                     CastE(allyNear);
                 }
             }
         }
         E.CachedPredictions.Clear();
         E.Type      = SpellType.Self;
         E.CastDelay = eCastDelay;
         E.Width     = eWidth;
     }
 }
Exemple #2
0
 private void CastQr()
 {
     if (Q.IsReady && R.IsReady)
     {
         Q.CachedPredictions.Clear();
         var qWidth     = Q.Width;
         var qCastDelay = Q.CastDelay;
         Q.CastDelay = R.CastDelay + qCastDelay;
         Q.Width     = R.Range;
         var list = (from enemy in UnitManager.ValidEnemyHeroes
                     select Q.GetPrediction(enemy)
                     into pred
                     where pred.HitChancePercent >= R.HitChancePercent / 2f
                     select pred.CastPosition.To2D()).ToList();
         if (list.Count >= ComboMenu.Slider("R.Hit"))
         {
             var bestCount = -1;
             var bestPoint = new Vector2(0, 0);
             var result    = Enumerable.Range(1, (1 << list.Count) - 1).Select(index => list.Where((item, idx) => ((1 << idx) & index) != 0).ToList()).ToList();
             foreach (var points in result)
             {
                 var polygon = new Geometry.Polygon();
                 polygon.Points.AddRange(points);
                 var center = polygon.CenterOfPolygon();
                 var count  = list.Count(v => center.IsInRange(v, R.Range * 1.4f));
                 if (count > bestCount)
                 {
                     bestCount = count;
                     bestPoint = center;
                 }
             }
             if (bestCount >= ComboMenu.Slider("R.Hit"))
             {
                 Q.Cast(bestPoint.To3DWorld());
             }
         }
         Q.CachedPredictions.Clear();
         Q.CastDelay = qCastDelay;
         Q.Width     = qWidth;
     }
 }
Exemple #3
0
 private void CastQr()
 {
     if (Q.IsReady && R.IsReady)
     {
         Q.CachedPredictions.Clear();
         var qWidth = Q.Width;
         var qCastDelay = Q.CastDelay;
         Q.CastDelay = R.CastDelay + qCastDelay;
         Q.Width = R.Range;
         var list = (from enemy in UnitManager.ValidEnemyHeroes
                     select Q.GetPrediction(enemy)
             into pred
                     where pred.HitChancePercent >= R.HitChancePercent / 2f
                     select pred.CastPosition.To2D()).ToList();
         if (list.Count >= ComboMenu.Slider("R.Hit"))
         {
             var bestCount = -1;
             var bestPoint = new Vector2(0, 0);
             var result = Enumerable.Range(1, (1 << list.Count) - 1).Select(index => list.Where((item, idx) => ((1 << idx) & index) != 0).ToList()).ToList();
             foreach (var points in result)
             {
                 var polygon = new Geometry.Polygon();
                 polygon.Points.AddRange(points);
                 var center = polygon.CenterOfPolygon();
                 var count = list.Count(v => center.IsInRange(v, R.Range * 1.4f));
                 if (count > bestCount)
                 {
                     bestCount = count;
                     bestPoint = center;
                 }
             }
             if (bestCount >= ComboMenu.Slider("R.Hit"))
             {
                 Q.Cast(bestPoint.To3DWorld());
             }
         }
         Q.CachedPredictions.Clear();
         Q.CastDelay = qCastDelay;
         Q.Width = qWidth;
     }
 }
Exemple #4
0
 private void CastEr()
 {
     if (E.IsReady && R.IsReady)
     {
         E.CachedPredictions.Clear();
         var eWidth = E.Width;
         var eCastDelay = E.CastDelay;
         E.CastDelay = R.CastDelay + eCastDelay;
         E.Width = R.Range;
         E.Type = SpellType.Circular;
         var enemyList = (from enemy in UnitManager.ValidEnemyHeroes
                          select E.GetPrediction(enemy)
             into pred
                          where pred.HitChancePercent >= R.HitChancePercent / 2f
                          select pred.CastPosition).ToList();
         if (enemyList.Count >= ComboMenu.Slider("R.Hit"))
         {
             var allyList =
                 UnitManager.ValidAllyHeroesInRange.Select(ally => E.GetPrediction(ally))
                     .Select(pred => pred.CastPosition.To2D()).ToList();
             var bestCount = -1;
             var bestPoint = default(Vector2);
             var result = Enumerable.Range(1, (1 << allyList.Count) - 1).Select(index => allyList.Where((item, idx) => ((1 << idx) & index) != 0).ToList()).ToList();
             foreach (var points in result)
             {
                 var polygon = new Geometry.Polygon();
                 polygon.Points.AddRange(points);
                 var center = polygon.CenterOfPolygon();
                 var count = enemyList.Count(v => center.IsInRange(v, R.Range * 1.4f));
                 if (count > bestCount)
                 {
                     bestCount = count;
                     bestPoint = center;
                 }
             }
             if (bestCount >= ComboMenu.Slider("R.Hit"))
             {
                 var allyNear =
                     UnitManager.ValidAllyHeroesInRange.OrderBy(h => h.Distance(bestPoint, true))
                         .FirstOrDefault();
                 if (allyNear != null)
                 {
                     CastE(allyNear);
                 }
             }
         }
         E.CachedPredictions.Clear();
         E.Type = SpellType.Self;
         E.CastDelay = eCastDelay;
         E.Width = eWidth;
     }
 }