protected void SwapByCountingEnemies() { var wCount = WShadowIsValid && W.IsReady && !WShadow.IsUnderEnemyturret() ? WShadow.CountEnemiesInRange(400) : 100; var rCount = RShadowIsValid && R.IsReady && !RShadow.IsUnderEnemyturret() ? RShadow.CountEnemiesInRange(400) : 100; var min = Math.Min(rCount, wCount); if (MyHero.CountEnemiesInRange(400) > min) { if (min == wCount) { W.Cast(); } else if (min == rCount) { R.Cast(); } } }
public static bool IsIsolated(this Obj_AI_Minion target) { if (EntityManager.MinionsAndMonsters.GetJungleMonsters().Contains(target)) { return(EntityManager.MinionsAndMonsters.GetJungleMonsters().Count(m => m.IsValidTarget() && m.IsInRange(target, 500)) <= 1); } return(target.CountEnemyHeroesInRangeWithPrediction(500) <= 1 && target.CountEnemyMinionsInRangeWithPrediction(500) == 0 && !target.IsUnderEnemyturret()); }