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


C# Obj_AI_Base.CountEnemiesInRange方法代码示例

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


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

示例1: castSafeE

 public static void castSafeE(Obj_AI_Base target)
 {
     if (target.IsValidTarget(E.Range) && E.IsReady() && target.CountEnemiesInRange(800) <= 2)
     {
         E.Cast(target);
     }
 }
开发者ID:Casanje,项目名称:ItsMeMario,代码行数:7,代码来源:ComboLogics.cs

示例2: OnProcessSpellCast

        private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
        {
            if (Player.Instance.IsRecalling()) return;

            foreach (
                var enemy in
                    EntityManager.Heroes.Enemies.Where(
                        enemy => sender.IsAlly && Player.Instance.IsInRange(sender, E.Range) &&
                                 args.SData.Name == "EzrealMysticShotMissile" && sender.CountEnemiesInRange(1200) > 0 &&
                                 Prediction.Position.PredictUnitPosition(enemy, 250).IsInRange(args.End, 60)))
                CastShield(sender);

            if (!sender.IsEnemy) return;

            priorAllyOrder = new List<AIHeroClient>();

            hpAllyOrder = new List<AIHeroClient>();

            highestPriority = 0;

            lowestHP = int.MaxValue;

            if (Config.Settings.AutoShield.PriorMode == 1)
            {
                foreach (var slider in Config.Settings.AutoShield.Sliders)
                {
                    if (slider.CurrentValue >= highestPriority)
                    {
                        highestPriority = slider.CurrentValue;

                        foreach (
                            var ally in
                                Config.Settings.AutoShield.Heros.Where(
                                    ally => slider.VisibleName.Contains(ally.ChampionName)))
                            priorAllyOrder.Insert(0, ally);
                    }
                    else
                    {
                        foreach (
                            var ally in
                                Config.Settings.AutoShield.Heros.Where(
                                    ally => slider.VisibleName.Contains(ally.ChampionName)))
                            priorAllyOrder.Add(ally);
                    }
                }

                foreach (var ally in priorAllyOrder.Where(ally => Player.Instance.IsInRange(ally, E.Range)))
                {
                    foreach (
                        var shieldThisSpell in
                            from shieldThisAlly in
                                Config.Settings.AutoShield.ShieldAllyList.Where(
                                    x => x.DisplayName.Contains(ally.ChampionName) && x.CurrentValue)
                            from shieldThisSpell in Config.Settings.AutoShield.ShieldSpellList
                            where shieldThisSpell.DisplayName.Contains(args.SData.Name) && shieldThisSpell.CurrentValue
                            select shieldThisSpell)
                    {
                        if (args.Target == ally)
                            CastShield(ally);
                        else
                        {
                            if (Prediction.Position.PredictUnitPosition(ally, 250)
                                .IsInRange(args.End,
                                    MissileDatabase.rangeRadiusDatabase[shieldThisSpell.DisplayName.Last(), 1]))
                            {
                                CastShield(ally);
                            }
                            else if (sender.IsFacing(ally) &&
                                     Prediction.Position.PredictUnitPosition(ally, 250)
                                         .IsInRange(sender,
                                             MissileDatabase.rangeRadiusDatabase[shieldThisSpell.DisplayName.Last(), 0]))
                            {
                                CastShield(ally);
                            }
                        }
                    }
                }
            }
            else
            {
                foreach (var ally in EntityManager.Heroes.Allies)
                {
                    if (ally.Health <= lowestHP)
                    {
                        lowestHP = ally.Health;
                        hpAllyOrder.Insert(0, ally);
                    }
                    else
                        hpAllyOrder.Add(ally);
                }

                foreach (var ally in hpAllyOrder.Where(ally => Player.Instance.IsInRange(ally, E.Range)))
                {
                    foreach (
                        var shieldThisSpell in
                            Config.Settings.AutoShield.ShieldAllyList.Where(
                                x => x.DisplayName.Contains(ally.ChampionName) && x.CurrentValue)
                                .SelectMany(
                                    shieldThisAlly =>
                                        Config.Settings.AutoShield.ShieldSpellList.Where(
//.........这里部分代码省略.........
开发者ID:FireBuddy,项目名称:elobuddy,代码行数:101,代码来源:Events.cs

示例3: UseItems

        public static void UseItems(Obj_AI_Base target, float comboDmg = 0f, bool cleanseSpell = false)
        {
            hydraTarget = target;

            if (Item.HasItem(randuins.Id) && Item.CanUseItem(randuins.Id))
            {
                if (target != null && player.Distance(target) < randuins.Range &&
                    player.CountEnemiesInRange(randuins.Range) >= 2)
                {
                    Item.UseItem(randuins.Id);
                }
            }
            if (target != null && Item.HasItem(odins.Id) &&
                Item.CanUseItem(odins.Id))
            {
                var odinDmg = player.GetItemDamage(target, ItemId.Odyns_Veil);

                if (odinDmg > target.Health)
                    {
                        odins.Cast(target);
                    }

            }
            if (Item.HasItem(bilgewater.Id) &&
                Item.CanUseItem(bilgewater.Id))
            {
                var bilDmg = player.GetItemDamage(target, ItemId.Bilgewater_Cutlass);
                if (bilDmg > target.Health)
                    {
                        bilgewater.Cast(target);
                    }

            }
            if (target != null && Item.HasItem(botrk.Id) &&
                Item.CanUseItem(botrk.Id))
            {
                var botrDmg = player.GetItemDamage(target, ItemId.Blade_of_the_Ruined_King);

                    if (botrDmg > target.Health)
                    {
                        botrk.Cast(target);
                    }

            }
            if (target != null && Item.HasItem(hexgun.Id) &&
                Item.CanUseItem(hexgun.Id))
            {
                var hexDmg = player.GetItemDamage(target, ItemId.Hextech_Gunblade);

                if (hexDmg > target.Health)
                    {
                        hexgun.Cast(target);
                    }

            }
            if (
                ((!MuramanaEnabled && 40 < player.ManaPercent) ||
                 (MuramanaEnabled && 40 > player.ManaPercent)))
            {
                if (Muramana.IsOwned() && Muramana.IsReady())
                {
                    Muramana.Cast();
                }
                if (Muramana2.IsOwned() && Muramana2.IsReady())
                {
                    Muramana2.Cast();
                }
            }
            MuramanaTime = System.Environment.TickCount;
            if (Item.HasItem(youmuu.Id) && Item.CanUseItem(youmuu.Id) &&
                target != null && player.Distance(target) < player.AttackRange + 50 && target.HealthPercent < 65)
            {
                youmuu.Cast();
            }

            if (Item.HasItem(frost.Id) && Item.CanUseItem(frost.Id) && target != null)
            {
                if (player.Distance(target) < frost.Range &&
                    (2 <= target.CountEnemiesInRange(225f) &&
                     ((target.Health / target.MaxHealth * 100f) < 40 && true ||
                      !true)))
                {
                    frost.Cast(target);
                }
            }
            if (Item.HasItem(solari.Id) && Item.CanUseItem(solari.Id))
            {
                if ((2 <= player.CountAlliesInRange(solari.Range) &&
                     2 <= player.CountEnemiesInRange(solari.Range)) ||
                    ObjectManager.Get<Obj_AI_Base>()
                        .FirstOrDefault(
                            h => h.IsAlly && !h.IsDead && solari.IsInRange(h) && CombatHelper.CheckCriticalBuffs(h)) !=
                    null)
                {
                    solari.Cast();
                }
            }

                UseCleanse(cleanseSpell);
        }
开发者ID:roaxtreil,项目名称:EBRepo,代码行数:100,代码来源:ItemHandler.cs

示例4: steal

 private void steal(Obj_AI_Base monster)
 {
     if (monster == null || monster.CountEnemiesInRange(600) == 0 || monster.CountAlliesInRange(500) > 0)
         return;
     float distance = Player.Instance.Position.Distance(monster.Position);
     int travelTime = 0;
     if (distance > 1500)
     {
         travelTime = 1000;
         distance -= 1500;
     }
     else
     {
         travelTime = (int)distance / 1500 * 1000;
         distance = 0;
     }
     travelTime += (int)(distance / 2500) * 1000;
     float health = Prediction.Health.GetPrediction(monster, travelTime);
     if (health - 300 > 0 && health < SpellManager.getRDamage(monster) * 0.8)
     {
         R.Cast(monster);
     }
 }
开发者ID:TopGunner,项目名称:EloBuddy,代码行数:23,代码来源:PermaActive.cs

示例5: FishBoneToMiniGun

        private static void FishBoneToMiniGun(Obj_AI_Base t)
        {
            var realDistance = GetRealDistance(t);

            if (realDistance < GetRealPowPowRange(t) && t.CountEnemiesInRange(250) < Config.Item("Qaoe").GetValue<Slider>().Value)
            {
                if (Player.ManaPercent < Config.Item("QmanaCombo").GetValue<Slider>().Value || Player.GetAutoAttackDamage(t) * Config.Item("QmanaIgnore").GetValue<Slider>().Value < t.Health)
                    Q.Cast();

            }
        }
开发者ID:adukhuyet,项目名称:AsCarryteam,代码行数:11,代码来源:Program.cs

示例6: GetEnemiesAround

 private static int GetEnemiesAround(Obj_AI_Base unit, float range)
 {
     return unit.CountEnemiesInRange(range);
 }
开发者ID:LSharpAura,项目名称:LeagueSharp,代码行数:4,代码来源:Annie.cs

示例7: GetComboDamage

        private float GetComboDamage(Obj_AI_Base target)
        {
            double comboDamage = 0;

            if (Q.IsReady())
                comboDamage += Player.GetSpellDamage(target, SpellSlot.Q) * 2;

            if (W.IsReady())
                comboDamage += Player.GetSpellDamage(target, SpellSlot.W);

            if (R.IsReady())
                comboDamage += Player.GetSpellDamage(target, SpellSlot.R) / target.CountEnemiesInRange(R.Range);

            comboDamage = ItemManager.CalcDamage(target, comboDamage);

            return (float)(comboDamage + Player.GetAutoAttackDamage(target) * 3);
        }
开发者ID:leenam0910,项目名称:LSharp,代码行数:17,代码来源:Fiora.cs

示例8: canCastQ

        private static bool canCastQ(Obj_AI_Base target)
        {
            if (target == null || !target.IsValidTarget() || target.IsDead) return isFishBones();

            if (isFishBones())
            {
                if (Misc.IsChecked(MiscMenu, "qOptionDistance"))
                {
                    if (target.Distance(Player.Instance.Position) > normalAttackRange)
                    {
                        return false;
                    }
                }
                if (Misc.IsChecked(MiscMenu, "qOptionAOE"))
                {
                    if (target.CountEnemiesInRange(300f) >= Misc.GetSliderValue(MiscMenu, "qOptionAOEMin"))
                    {
                        return false;
                    }
                }
            }
            else
            {
                if (Misc.IsChecked(MiscMenu, "qOptionDistance"))
                {
                    if (target.Distance(Player.Instance.Position) > normalAttackRange)
                    {
                        return true;
                    }
                }
                if (Misc.IsChecked(MiscMenu, "qOptionAOE"))
                {
                    if (target.CountEnemiesInRange(300f) >= Misc.GetSliderValue(MiscMenu, "qOptionAOEMin"))
                    {
                        return true;
                    }
                }
            }

            return isFishBones();
        }
开发者ID:himrengod,项目名称:Elobuddy-1,代码行数:41,代码来源:Jinx.cs

示例9: BestTumblePost

        public static Vector3 BestTumblePost(Obj_AI_Base target)
        {
            if (MenuManager.Modes.Misc.AutomaticPositionTumble && target.CountEnemiesInRange(800) <= 1)
            {  
                if (SpellManager.E.IsReady() && MenuManager.Modes.Condemn.TumbleIfCondemn)
                {
                    var direction = (target.ServerPosition - Player.Instance.ServerPosition).To2D().Normalized();

                    for (var i = 0; i < 180; i++)
                    {
                        var angle = (float)(i * Math.PI / 180);
                        var position = Player.Instance.ServerPosition.To2D() + direction.Rotated(-angle) * 300;

                        if (collisionTypeCheckage(position.To3D()) && position.Distance(Player.Instance.ServerPosition) >= 300 && position.Distance(target) < Player.Instance.Distance(target))
                            return position.To3D();
                    }
                }

                return Game.CursorPos;
            }
            else
            {
                return Game.CursorPos;
            }
        }
开发者ID:mrarticuno,项目名称:EBHQ,代码行数:25,代码来源:ExtensionsHelpers.cs


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