コード例 #1
0
        void CastR(int minhit = 1)
        {
            UltMode ultmode = GetUltMode();

            IOrderedEnumerable <AIHeroClient> ordered = null;


            if (ultmode == UltMode.Health)
            {
                ordered = KnockedUp.OrderBy(x => x.Health).ThenByDescending(x => TargetSelector.GetPriority(x)).ThenByDescending(x => x.CountEnemiesInRange(350));
            }

            if (ultmode == UltMode.Priority)
            {
                ordered = KnockedUp.OrderByDescending(x => TargetSelector.GetPriority(x)).ThenBy(x => x.Health).ThenByDescending(x => x.CountEnemiesInRange(350));
            }

            if (ultmode == UltMode.EnemiesHit)
            {
                ordered = KnockedUp.OrderByDescending(x => x.CountEnemiesInRange(350)).ThenByDescending(x => TargetSelector.GetPriority(x)).ThenBy(x => x.Health);
            }

            if (GetBool("Combo.UltOnlyKillable", YasuoMenu.ComboM))
            {
                var killable = ordered.FirstOrDefault(x => !x.isBlackListed() && x.Health <= Yasuo.GetSpellDamage(x, SpellSlot.R) && x.HealthPercent >= GetSliderInt("Combo.MinHealthUlt", YasuoMenu.ComboM) && (GetBool("Combo.UltTower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || ShouldDive(x)));
                if (killable != null && (!killable.IsInRange(Spells[Q].Range) || !isHealthy))
                {
                    Spells[R].CastOnUnit(killable);
                    return;
                }
                return;
            }

            if ((GetBool("Combo.OnlyifMin", YasuoMenu.ComboM) && ordered.Count() < minhit) || (ordered.Count() == 1 && ordered.FirstOrDefault().HealthPercent < GetSliderInt("Combo.MinHealthUlt", YasuoMenu.ComboM)))
            {
                return;
            }

            if (GetBool("Combo.RPriority", YasuoMenu.ComboM))
            {
                var best = ordered.Find(x => !x.isBlackListed() && TargetSelector.GetPriority(x).Equals(2.5f) && (GetBool("Combo.UltTower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !x.Position.LSTo2D().PointUnderEnemyTurret()));
                if (best != null && Yasuo.HealthPercent / best.HealthPercent <= 1)
                {
                    Spells[R].CastOnUnit(best);
                    return;
                }
            }

            if (ordered.Count() >= minhit)
            {
                var best2 = ordered.FirstOrDefault(x => !x.isBlackListed() && (GetBool("Combo.UltTower", YasuoMenu.ComboM) || ShouldDive(x)));
                if (best2 != null)
                {
                    Spells[R].CastOnUnit(best2);
                }
                return;
            }
        }
コード例 #2
0
ファイル: Yasuo.cs プロジェクト: geramz/PortAIO
        void Killsteal()
        {
            if (SpellSlot.Q.IsReady() && GetBool("Killsteal.UseQ", YasuoMenu.KillstealM))
            {
                var targ = HeroManager.Enemies.Find(x => x.CanKill(SpellSlot.Q) && x.IsInRange(Qrange));
                if (targ != null)
                {
                    UseQ(targ, GetHitChance("Hitchance.Q"));
                    return;
                }
            }

            if (SpellSlot.E.IsReady() && GetBool("Killsteal.UseE", YasuoMenu.KillstealM))
            {
                var targ = HeroManager.Enemies.Find(x => x.CanKill(SpellSlot.E) && x.IsInRange(Spells[E].Range));
                if (targ != null)
                {
                    Spells[E].Cast(targ);
                    return;
                }
            }

            if (SpellSlot.R.IsReady() && GetBool("Killsteal.UseR", YasuoMenu.KillstealM))
            {
                var targ = KnockedUp.Find(x => x.CanKill(SpellSlot.R) && x.IsValidEnemy(Spells[R].Range) && !x.isBlackListed());
                if (targ != null)
                {
                    Spells[R].Cast(targ);
                    return;
                }
            }

            if (GetBool("Killsteal.UseItems", YasuoMenu.KillstealM))
            {
                if (Tiamat.item.IsReady())
                {
                    var targ =
                        HeroManager.Enemies.Find(
                            x =>
                            x.IsValidEnemy(Tiamat.item.Range) &&
                            x.Health <= Yasuo.GetItemDamage(x, LeagueSharp.Common.Damage.DamageItems.Tiamat));
                    if (targ != null)
                    {
                        Tiamat.Cast(null);
                    }
                }

                if (Titanic.item.IsReady())
                {
                    var targ =
                        HeroManager.Enemies.Find(
                            x =>
                            x.IsValidEnemy(Titanic.item.Range) &&
                            x.Health <= Yasuo.GetItemDamage(x, LeagueSharp.Common.Damage.DamageItems.Tiamat));
                    if (targ != null)
                    {
                        Titanic.Cast(null);
                    }
                }

                if (Hydra.item.IsReady())
                {
                    var targ =
                        HeroManager.Enemies.Find(
                            x =>
                            x.IsValidEnemy(Hydra.item.Range) &&
                            x.Health <= Yasuo.GetItemDamage(x, LeagueSharp.Common.Damage.DamageItems.Tiamat));
                    if (targ != null)
                    {
                        Hydra.Cast(null);
                    }
                }
                if (Blade.item.IsReady())
                {
                    var targ = HeroManager.Enemies.Find(
                        x =>
                        x.IsValidEnemy(Blade.item.Range) &&
                        x.Health <= Yasuo.GetItemDamage(x, LeagueSharp.Common.Damage.DamageItems.Botrk));
                    if (targ != null)
                    {
                        Blade.Cast(targ);
                    }
                }
                if (Bilgewater.item.IsReady())
                {
                    var targ = HeroManager.Enemies.Find(
                        x =>
                        x.IsValidEnemy(Bilgewater.item.Range) &&
                        x.Health <= Yasuo.GetItemDamage(x, LeagueSharp.Common.Damage.DamageItems.Bilgewater));
                    if (targ != null)
                    {
                        Bilgewater.Cast(targ);
                    }
                }
            }
        }
コード例 #3
0
ファイル: Yasuo.cs プロジェクト: chienhao10/PortAIO
        private void CastR(float minhit = 1)
        {
            var ultmode = GetUltMode();

            IOrderedEnumerable <AIHeroClient> ordered = null;


            if (ultmode == UltMode.Health)
            {
                ordered =
                    KnockedUp.OrderBy(x => x.Health)
                    .ThenByDescending(TargetSelector.GetPriority)
                    .ThenByDescending(x => x.CountEnemiesInRange(350));
            }

            if (ultmode == UltMode.Priority)
            {
                ordered =
                    KnockedUp.OrderByDescending(TargetSelector.GetPriority)
                    .ThenBy(x => x.Health)
                    .ThenByDescending(x => x.CountEnemiesInRange(350));
            }

            if (ultmode == UltMode.EnemiesHit)
            {
                ordered =
                    KnockedUp.OrderByDescending(x => x.CountEnemiesInRange(350))
                    .ThenByDescending(TargetSelector.GetPriority)
                    .ThenBy(x => x.Health);
            }

            if ((YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Combo.OnlyifMin") && ordered.Count() < minhit) ||
                (ordered.Count() == 1 &&
                 ordered.FirstOrDefault().HealthPercent <
                 YasuoMenu.getSliderItem(YasuoMenu.ComboA, "Combo.MinHealthUlt")))
            {
                return;
            }

            if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Combo.RPriority"))
            {
                var best =
                    ordered.Find(
                        x =>
                        !x.isBlackListed() && TargetSelector.GetPriority(x) == 5 &&
                        (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Combo.UltTower") ||
                         YasuoMenu.getKeyBindItem(YasuoMenu.MiscA, "Misc.TowerDive") ||
                         !x.Position.To2D().PointUnderEnemyTurret()));
                if (best != null && Yasuo.HealthPercent / best.HealthPercent <= 1)
                {
                    Spells[R].CastOnUnit(best);
                    return;
                }
            }

            if (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Combo.UltOnlyKillable"))
            {
                var killable =
                    ordered.FirstOrDefault(
                        x =>
                        !x.isBlackListed() && x.Health <= Yasuo.GetSpellDamage(x, SpellSlot.R) &&
                        x.HealthPercent >= YasuoMenu.getSliderItem(YasuoMenu.ComboA, "Combo.MinHealthUlt") &&
                        (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Combo.UltTower") ||
                         YasuoMenu.getKeyBindItem(YasuoMenu.MiscA, "Misc.TowerDive") ||
                         !x.Position.To2D().PointUnderEnemyTurret()));
                if (killable != null && !killable.IsInRange(Spells[Q].Range))
                {
                    Spells[R].CastOnUnit(killable);
                    return;
                }
            }

            if (ordered.Count() >= minhit)
            {
                var best2 =
                    ordered.FirstOrDefault(
                        x =>
                        !x.isBlackListed() &&
                        (YasuoMenu.getCheckBoxItem(YasuoMenu.ComboA, "Combo.UltTower") ||
                         YasuoMenu.getKeyBindItem(YasuoMenu.MiscA, "Misc.TowerDive") ||
                         !x.Position.To2D().PointUnderEnemyTurret()));
                if (best2 != null)
                {
                    Spells[R].CastOnUnit(best2);
                }
            }
        }