当前位置: 首页>>代码示例>>C#>>正文


C# AIHeroClient.IsInRange方法代码示例

本文整理汇总了C#中AIHeroClient.IsInRange方法的典型用法代码示例。如果您正苦于以下问题:C# AIHeroClient.IsInRange方法的具体用法?C# AIHeroClient.IsInRange怎么用?C# AIHeroClient.IsInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AIHeroClient的用法示例。


在下文中一共展示了AIHeroClient.IsInRange方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Combo1

        private static void Combo1(AIHeroClient t)
        {
            if (SpellManager.E.IsReady() && t.IsInRange(Player.Instance.Position, SpellManager.E.Range) && ConfigList.Combo.ComboE)
            {
                var d = Dagger.GetClosestDagger();
                if (t.Position.IsInRange(d, SpellManager.W.Range)) SpellManager.E.CastE(Damage.GetBestDaggerPoint(d, t));
                else
                    if (Player.Instance.Distance(t) >= SpellManager.W.Range)
                    SpellManager.E.CastE(t.Position);
            }

            if (SpellManager.W.IsLearned && !SpellManager.W.IsOnCooldown && ConfigList.Combo.ComboW)
            {
                if (t.IsInRange(Player.Instance.Position, SpellManager.W.Range))
                    SpellManager.W.Cast();
            }

            if (SpellManager.Q.CanCast(t) && ConfigList.Combo.ComboQ)
            {
                SpellManager.Q.Cast(t);
            }

            if (SpellManager.R.IsLearned && !SpellManager.R.IsOnCooldown && ConfigList.Combo.ComboR)
            {
                if (Player.Instance.CountEnemyChampionsInRange(ConfigList.Combo.MaxRCastRange) < ConfigList.Combo.MinToUseR) return;
                if (Damage.GetQDamage(t) + Damage.GetPDamage(t) + Damage.GetEDamage(t) + Player.Instance.GetAutoAttackDamage(t, true) >= t.TotalShieldHealth()) return;
                if (Orbwalker.IsAutoAttacking && !Orbwalker.DisableAttacking)
                {
                    Orbwalker.DisableAttacking = true;
                    Orbwalker.ResetAutoAttack();
                }
                SpellManager.R.Cast();
                Damage.FreezePlayer();
            }
        }
开发者ID:,项目名称:,代码行数:35,代码来源:

示例2: Cast

            internal bool Cast(AIHeroClient target, bool farmcast = false)
            {
                if (!item.IsReady())
                {
                    return false;
                }

                if (!farmcast)
                {
                    if ((type == ItemCastType.SelfCast || type == ItemCastType.RangeCast) &&
                        Player.LSCountEnemiesInRange(item.Range) >= eneinrangecount)
                    {
                        item.Cast();
                        return true;
                    }

                    if (type == ItemCastType.TargettedCast && target.IsInRange(item.Range))
                    {
                        item.Cast(target);
                        return true;
                    }
                }

                else if (farmcast)
                {
                    if ((type == ItemCastType.SelfCast || type == ItemCastType.RangeCast) && ObjectManager.Get<Obj_AI_Minion>().Count(x=> x.LSIsValidTarget(item.Range)) >= minioncount)
                    {
                        item.Cast();
                        return true;
                    }
                }

                return false;
            }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:34,代码来源:ItemManager.cs

示例3: Gapcloser_OnGapcloser

        private static void Gapcloser_OnGapcloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
        {
            if (!Settings.GapE && !SpellManager.E.IsReady() && sender.IsAlly) return;

            if (sender.IsEnemy && sender.IsVisible && sender.IsInRange(Player.Instance, SpellManager.E.Range))
            {
                SpellManager.E.Cast(Player.Instance.Position.Shorten(sender.Position, SpellManager.E.Range));
            }
        }
开发者ID:mariogk,项目名称:EB,代码行数:9,代码来源:EventsManager.cs

示例4: Gapcloser_OnGapcloser

        private static void Gapcloser_OnGapcloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
        {
            if (!sender.IsEnemy) return;

            if (sender.IsEnemy && sender.IsInRange(Player.Instance, SpellManager.R.Range) && Player.Instance.Distance(e.End) < SpellManager.R.Range && Misc.AntiGapCloser)
            {
                SpellManager.R.Cast(sender);
            }
        }
开发者ID:hao1630,项目名称:KickAss,代码行数:9,代码来源:EventsManager.cs

示例5: GetBestCombo

 private static void GetBestCombo(AIHeroClient t)
 {
     if (t.IsInRange(Player.Instance, SpellManager.Q.Range) && !t.IsInRange(Player.Instance, SpellManager.E.Range)) Combo3(t);
     else Combo2(t);
 }
开发者ID:,项目名称:,代码行数:5,代码来源:

示例6: Gapcloser_OnGapcloser

 // Thanks MarioGK has allowed me to use some his logic
 private static void Gapcloser_OnGapcloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
 {
     if (Misc["AntiGap"].Cast<CheckBox>().CurrentValue && W.IsReady() && sender.IsEnemy && sender.IsVisible && sender.IsInRange(Player.Instance, 450))
     {
         W.Cast(Player.Instance.Position.Shorten(sender.Position, W.Range));
     }
 }
开发者ID:FireBuddy,项目名称:olaf,代码行数:8,代码来源:Program.cs

示例7: checkQDelayedCast

 public static void checkQDelayedCast(AIHeroClient enemy)
 {
     if (enemy.HealthPercent == 0 || !enemy.IsInRange(Player.Instance, SpellManager.Q.MaximumRange))
     {
         SpellManager.isCharging = true;
         return;
     }
     SpellManager.Q.Cast(SpellManager.Q.GetPrediction(enemy).CastPosition);
 }
开发者ID:denizereer3,项目名称:EloBuddy,代码行数:9,代码来源:PermaActive.cs

示例8: RoverkillCheck

 public static bool RoverkillCheck(AIHeroClient enemy)
 {
     //TODO check if enemy.Allies = my allies??
     if (enemy.CountAlliesInRange(650) > 1)
     {
         return false;
     }
     if (enemy.IsInRange(Player.Instance, Range) && Player.Instance.CountEnemiesInRange(Range) == 1 && Player.Instance.HealthPercent < 20)
     {
         return true;
     }
     if (Player.Instance.CountEnemiesInRange(Range) > 0)
     {
         return false;
     }
     return true;
 }
开发者ID:TopGunner,项目名称:EloBuddy,代码行数:17,代码来源:SpellManager.cs

示例9: CastENew

        internal void CastENew(AIHeroClient target)
        {
            if (!SpellSlot.E.IsReady() || Yasuo.LSIsDashing() || InDash)
            {
                return;
            }

            var minionsinrange = ObjectManager.Get<Obj_AI_Minion>().Any(x => x.IsDashable());
            if (target == null || !target.IsInRange(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range))
            {
                target = TargetSelector.GetTarget(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range,
                    DamageType.Physical);
            }

            if (target != null && TowerCheck(target, true))
            {
                var dist = Yasuo.LSDistance(target);
                var pctOutOfRange = dist / Yasuo.AttackRange * 100;

                if (pctOutOfRange > 0.8f)
                {
                    if (target.IsDashable())
                    {
                        if (target.ECanKill())
                        {
                            return;
                        }

                        if (TornadoReady && target.IsInRange(Spells[E].Range) && targInKnockupRadius(target))
                        {
                            Spells[E].CastOnUnit(target);
                        }

                        //Stay in range
                        else if (pctOutOfRange > 0.8f)
                        {
                            var bestminion = ObjectManager.Get<Obj_AI_Base>()
                                .Where(x =>
                                    x.IsDashable()
                                    && GetDashPos(x).IsCloser(target) && TowerCheck(x, true))
                                .MinOrDefault(x => GetDashPos(x).LSDistance(target));

                            var shouldETarget = bestminion == null || GetDashPos(target).Distance(target) <
                                                GetDashPos(bestminion).LSDistance(target);
                            if (shouldETarget && GetDashPos(target).IsCloser(target))
                            {
                                Spells[E].CastOnUnit(target);
                            }

                            else if (bestminion != null)
                            {
                                Spells[E].CastOnUnit(bestminion);
                            }
                        }
                    }

                    else
                    {
                        var minion = ObjectManager.Get<Obj_AI_Minion>()
                            .Where(x => x.IsDashable() && x.IsCloser(target) && TowerCheck(x, true))
                            .MinOrDefault(x => GetDashPos(x).LSDistance(target));
                        if (minion != null)
                        {
                            Spells[E].CastOnUnit(minion);
                        }
                    }
                }
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:69,代码来源:Yasuo.cs

示例10: CastQ

        internal void CastQ(AIHeroClient target)
        {
            if (target != null && !target.IsInRange(Qrange))
            {
                target = TargetSelector.GetTarget(Qrange, DamageType.Physical);
            }

            if (target != null)
            {
                if (Spells[Q].IsReady() && target.IsValidEnemy(Qrange))
                {
                    UseQ(target, GetHitChance("Hitchance.Q"), GetBool("Combo.UseQ", YasuoMenu.ComboM), GetBool("Combo.UseQ2", YasuoMenu.ComboM));
                    return;
                }

                if (GetBool("Combo.StackQ", YasuoMenu.ComboM) && !target.IsValidEnemy(Qrange) && !TornadoReady && !Yasuo.LSIsDashing() && !InDash)
                {
                    var bestmin =
                        ObjectManager.Get<Obj_AI_Minion>()
                            .Where(x => x.IsValidMinion(Qrange) && MinionManager.IsMinion(x, false))
                            .MinOrDefault(x => x.LSDistance(Yasuo));
                    if (bestmin != null)
                    {
                        var pred = Spells[Q].GetPrediction(bestmin);

                        if (pred.Hitchance >= HitChance.Medium)
                        {
                            Spells[Q].Cast(bestmin);
                        }
                    }
                }
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:33,代码来源:Yasuo.cs

示例11: CastEOld

        internal void CastEOld(AIHeroClient target, bool force = false)
        {
            var minionsinrange = ObjectManager.Get<Obj_AI_Minion>().Any(x => x.IsDashable());
            if (target == null || !target.IsInRange(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range))
            {
                target = TargetSelector.GetTarget(minionsinrange ? Spells[E].Range * 2 : Spells[E].Range, DamageType.Physical);
            }

            if (target != null)
            {
                if (SpellSlot.E.IsReady() && isHealthy && target.LSDistance(Yasuo) >= 0.30 * Yasuo.AttackRange)
                {
                    if (TornadoReady && ((GetBool("Combo.ETower", YasuoMenu.ComboM) && GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM)) || !GetDashPos(target).PointUnderEnemyTurret()))
                    {
                        Spells[E].CastOnUnit(target);
                        return;
                    }

                    if (DashCount >= 1 && GetDashPos(target).IsCloser(target) && target.IsDashable() &&
                        (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(target).PointUnderEnemyTurret()))
                    {
                        Spells[E].CastOnUnit(target);
                        return;
                    }

                    if (DashCount == 0)
                    {
                        var bestminion =
                            ObjectManager.Get<Obj_AI_Base>()
                                .Where(
                                    x =>
                                         x.IsDashable()
                                         && GetDashPos(x).IsCloser(target) &&
                                        (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(x).PointUnderEnemyTurret()))
                                .OrderBy(x => Vector2.Distance(GetDashPos(x), target.ServerPosition.LSTo2D()))
                                .FirstOrDefault();
                        if (bestminion != null)
                        {
                            Spells[E].CastOnUnit(bestminion);
                        }

                        else if (target.IsDashable() && GetDashPos(target).IsCloser(target) && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(target).PointUnderEnemyTurret()))
                        {
                            Spells[E].CastOnUnit(target);
                        }
                    }

                    else
                    {
                        var minion =
                            ObjectManager.Get<Obj_AI_Base>()
                                .Where(x => x.IsDashable() && GetDashPos(x).IsCloser(target) && (GetBool("Combo.ETower", YasuoMenu.ComboM) || GetKeyBind("Misc.TowerDive", YasuoMenu.MiscM) || !GetDashPos(x).PointUnderEnemyTurret()))
                                .OrderBy(x => GetDashPos(x).LSDistance(target.ServerPosition)).FirstOrDefault();

                        if (minion != null && GetDashPos(minion).IsCloser(target))
                        {
                            Spells[E].CastOnUnit(minion);
                        }
                    }
                }
            }
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:62,代码来源:Yasuo.cs


注:本文中的AIHeroClient.IsInRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。