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


C# Vector3.CountEnemiesInRange方法代码示例

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


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

示例1: IsSafeEx

        /// <summary>
        /// Determines whether the specified position is Safe using AA ranges logic.
        /// </summary>
        /// <param name="position">The position.</param>
        /// <returns></returns>
        public static bool IsSafeEx(Vector3 position)
        {
            var closeEnemies =
                    HeroManager.Enemies.FindAll(en => en.IsValidTarget(1500f) && !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f))
                    .OrderBy(en => en.Distance(position));

            return closeEnemies.All(
                                enemy =>
                                    position.CountEnemiesInRange(enemy.AttackRange) <= 1);
        }
开发者ID:ShineSharp,项目名称:LeagueSharp-5,代码行数:15,代码来源:TumbleHelper.cs

示例2: IsSafePosition

        public static bool IsSafePosition(Vector3 position)
        {
            if (position.UnderTurret(true) && !ObjectManager.Player.UnderTurret(true))
                return false;
            var allies = position.CountAlliesInRange(ObjectManager.Player.AttackRange);
            var enemies = position.CountEnemiesInRange(ObjectManager.Player.AttackRange);
            var lhEnemies = GetLhEnemiesNearPosition(position, ObjectManager.Player.AttackRange).Count();

            if (enemies == 1) //It's a 1v1, safe to assume I can E
            {
                return true;
            }

            //Adding 1 for the Player
            return (allies + 1 > enemies - lhEnemies);
        }
开发者ID:ShineSharp,项目名称:LeagueSharp-5,代码行数:16,代码来源:HeroHelper.cs

示例3: GetAvgDistance

        public static float GetAvgDistance(Vector3 from)
        {
            var numberOfEnemies = from.CountEnemiesInRange(1000f);
            if (numberOfEnemies != 0)
            {
                var enemies = HeroManager.Enemies.Where(en => en.LSIsValidTarget(1000f, true, from)
                                                    &&
                                                    en.Health >
                                                    ObjectManager.Player.GetAutoAttackDamage(en)*3 +
                                                    Variables.spells[SpellSlot.W].GetDamage(en) +
                                                    Variables.spells[SpellSlot.Q].GetDamage(en)).ToList();
                var enemiesEx = HeroManager.Enemies.Where(en => en.LSIsValidTarget(1000f, true, from)).ToList();
                var LHEnemies = enemiesEx.Count() - enemies.Count();
                var totalDistance = 0f;

                totalDistance = (LHEnemies > 1 && enemiesEx.Count() > 2) ?
                    enemiesEx.Sum(en => en.LSDistance(ObjectManager.Player.ServerPosition)) :
                    enemies.Sum(en => en.LSDistance(ObjectManager.Player.ServerPosition));

                return totalDistance / numberOfEnemies;
            }
            return -1;
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:23,代码来源:VHRQLogic.cs

示例4: GetAvgDistance

        /// <summary>
        ///     Gets the average distance of a specified position to the enemies.
        /// </summary>
        /// <param name="from">From.</param>
        /// <returns></returns>
        public static float GetAvgDistance(Vector3 from)
        {
            var numberOfEnemies = from.CountEnemiesInRange(1200f);
            if (numberOfEnemies != 0)
            {
                var enemies = EntityManager.Heroes.Enemies.Where(en => en.IsValidTarget(1200f, true, from)
                                                              &&
                                                              en.Health >
                                                              ObjectManager.Player.GetAutoAttackDamage(en) * 3 +
                                                              ObjectManager.Player.GetSpellDamage(en, SpellSlot.W) +
                                                              ObjectManager.Player.GetSpellDamage(en, SpellSlot.Q))
                    ;
                var enemiesEx = EntityManager.Heroes.Enemies.Where(en => en.IsValidTarget(1200f, true, from));
                var LHEnemies = enemiesEx.Count() - enemies.Count();

                var totalDistance = (LHEnemies > 1 && enemiesEx.Count() > 2)
                    ? enemiesEx.Sum(en => en.Distance(ObjectManager.Player.ServerPosition))
                    : enemies.Sum(en => en.Distance(ObjectManager.Player.ServerPosition));

                return totalDistance / numberOfEnemies;
            }
            return -1;
        }
开发者ID:Musee30,项目名称:Elobuddyy,代码行数:28,代码来源:TumbleHelper.cs

示例5: IsGoodPosition

        public bool IsGoodPosition(Vector3 dashPos)
        {
            if (getCheckBoxItem("WallCheck"))
            {
                var segment = DashSpell.Range / 5;
                for (var i = 1; i <= 5; i++)
                {
                    if (Player.Position.LSExtend(dashPos, i * segment).LSIsWall())
                        return false;
                }
            }

            if (getCheckBoxItem("TurretCheck"))
            {
                if (dashPos.UnderTurret(true))
                    return false;
            }

            var enemyCheck = getSliderItem("EnemyCheck");
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
                return true;

            var enemyCountPlayer = Player.CountEnemiesInRange(400);

            if (enemyCountDashPos <= enemyCountPlayer)
                return true;

            return false;
        }
开发者ID:CONANLXF,项目名称:AIO,代码行数:31,代码来源:OKTWdash.cs

示例6: InAARange

 public bool InAARange(Vector3 point)
 {
     if (!getCheckBoxItem("AAcheck"))
         return true;
     if (Orbwalker.LastTarget != null && Orbwalker.LastTarget.Type == GameObjectType.AIHeroClient)
     {
         return point.LSDistance(Orbwalker.LastTarget.Position) < Player.AttackRange;
     }
     return point.CountEnemiesInRange(Player.AttackRange) > 0;
 }
开发者ID:CONANLXF,项目名称:AIO,代码行数:10,代码来源:OKTWdash.cs

示例7: IsSafeEx

        public static bool IsSafeEx(Vector3 position)
        {
            var closeEnemies =
                    HeroManager.Enemies.FindAll(en => en.LSIsValidTarget(1500f) && !(en.LSDistance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f))
                    .OrderBy(en => en.LSDistance(position));

            return closeEnemies.All(
                                enemy =>
                                    position.CountEnemiesInRange(
                                        MenuGenerator.miscMenu["dz191.vhr.misc.tumble.dynamicqsafety"].Cast<CheckBox>().CurrentValue
                                            ? enemy.AttackRange
                                            : 405f) <= 1);
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:13,代码来源:VHRQLogic.cs

示例8: IsSafePosition

        public static bool IsSafePosition(Vector3 position)
        {
            var enemies = position.CountEnemiesInRange(800);
            var allies = CountAlliesInRange(position);
            var turrets = EntityManager.Turrets.Allies.Count(x => Player.Distance(x) < 800 && x.IsValid && !x.IsDead);
            var lowEnemies = GetLowaiAiHeroClients(position, 800).Count();

            if (UnderEnemyTurret(position)) return false;

            if (enemies == 1)
            {
                return true;
            }
            return allies + turrets > enemies - lowEnemies;
        }
开发者ID:KoalaHuman,项目名称:EloBuddy-4,代码行数:15,代码来源:Helpers.cs

示例9: IsSafeEx

        public static bool IsSafeEx(Vector3 position)
        {
            var closeEnemies =
                    HeroManager.Enemies.FindAll(en => en.IsValidTarget(1500f) && !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f))
                    .OrderBy(en => en.Distance(position));

            return closeEnemies.All(
                                enemy =>
                                    position.CountEnemiesInRange(
                                        MenuExtensions.GetItemValue<bool>("dz191.vhr.misc.tumble.dynamicqsafety")
                                            ? enemy.AttackRange
                                            : 405f) <= 1);
        }
开发者ID:luizssn,项目名称:LeagueSharp,代码行数:13,代码来源:VHRQLogic.cs


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