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


C# Vector3.CountEnemiesInRange方法代码示例

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


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

示例1: GetAvgDistanceFromEnemyTeam

        public static float GetAvgDistanceFromEnemyTeam(Vector3 from, float MaxRange = 1200f)
        {
            var numberOfEnemies = from.CountEnemiesInRange(MaxRange);
            if (numberOfEnemies != 0)
            {
                var enemies = HeroManager.Enemies.Where(en => en.IsValidTarget(MaxRange, true, from)).ToList();
                var totalDistance = enemies.Sum(en => en.Distance(ObjectManager.Player.ServerPosition));

                return totalDistance / numberOfEnemies;
            }
            return -1;
        }
开发者ID:DZ191,项目名称:LeagueSharp,代码行数:12,代码来源:PositioningHelper.cs

示例2: OkToQ

        public static bool OkToQ(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:GodLS,项目名称:LSharpWIP,代码行数:16,代码来源:Helpers.cs

示例3: 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 +
                                                                       Variables._Player.GetSpellDamage(en, SpellSlot.W) +
                                                                       Variables._Player.GetSpellDamage(en, SpellSlot.Q)).ToList()
                    ;
                var enemiesEx = EntityManager.Heroes.Enemies.Where(en => en.IsValidTarget(1200f, true, from)).ToList();
                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:lolscripts,项目名称:Aka-s,代码行数:28,代码来源:QProvider.cs

示例4: IsNotIntoEnemies

        static bool IsNotIntoEnemies(Vector3 position)
        {
            var enemyPoints = GetEnemyPoints();
            if (enemyPoints.ToList().Contains(position.To2D()) && !enemyPoints.Contains(ObjectManager.Player.ServerPosition.To2D()))
            {
                return false;
            }

            var closeEnemies =
                EntityManager.Heroes.Enemies.FindAll(
                    en =>
                        en.IsValidTarget(1500f) && !en.IsDead &&
                        !(en.Distance(ObjectManager.Player.ServerPosition) < en.AttackRange + 65f));
            if (!closeEnemies.All(enemy => position.CountEnemiesInRange(enemy.AttackRange) <= 1))
            {
                return false;
            }

            return true;
        }
开发者ID:Kysamaa,项目名称:EloBuddy,代码行数:20,代码来源:AJSProvider.cs

示例5: SafeCheckThree

 public static bool SafeCheckThree(Vector3 pos)
 {
     return (!EnemyPoints().Contains(pos.To2D()) ||
             EnemyPoints().Contains(Player.Instance.ServerPosition.To2D())) &&
            !EntityManager.Heroes.Enemies.FindAll(
                e =>
                    e.IsValidTarget(1500) &&
                    !(e.Distance(Player.Instance.ServerPosition) < e.GetAutoAttackRange() + 65))
                .All(e => pos.CountEnemiesInRange(e.GetAutoAttackRange()) <= 1);
 }
开发者ID:newchild,项目名称:OKTRAIO,代码行数:10,代码来源:Geometry.cs

示例6: IsGoodPosition

        public bool IsGoodPosition(Vector3 dashPos)
        {
            if (Config.Item("WallCheck", true).GetValue<bool>())
            {
                float segment = DashSpell.Range / 5;
                for (int i = 1; i <= 5; i++)
                {
                    if (Player.Position.Extend(dashPos, i * segment).IsWall())
                        return false;
                }
            }

            if (Config.Item("TurretCheck", true).GetValue<bool>())
            {
                if(dashPos.UnderTurret(true))
                    return false;
            }

            var enemyCheck = Config.Item("EnemyCheck", true).GetValue<Slider>().Value;
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
                return true;

            var enemyCountPlayer = Player.CountEnemiesInRange(400);

            if(enemyCountDashPos <= enemyCountPlayer)
                return true;

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

示例7: CheckForRetreat

 private static bool CheckForRetreat(Obj_AI_Base enemy, Vector3 pos)
 {
     if (_GameInfo.GameState == State.Jungling)
     {
         return false;
     }
     if (enemy != null && !enemy.UnderTurret(true) && player.Distance(enemy) < 350 && !_GameInfo.AttackedByTurret)
     {
         return false;
     }
     var indanger = ((Helpers.GetHealth(true, pos) +
                      ((player.Distance(pos) < GameInfo.ChampionRange) ? 0 : player.Health)) * 1.3f <
                     Helpers.GetHealth(false, pos) && pos.CountEnemiesInRange(GameInfo.ChampionRange) > 1 &&
                     Helpers.AlliesThere(pos, 500) == 0) ||
                    player.HealthPercent < menu.Item("HealtToBack").GetValue<Slider>().Value;
     if (indanger || _GameInfo.AttackedByTurret)
     {
         if (((enemy != null && Helpers.AlliesThere(pos, 600) > 0) && player.HealthPercent > 25))
         {
             return false;
         }
         if (_GameInfo.AttackedByTurret)
         {
             if ((enemy != null &&
                  (enemy.Health > player.GetAutoAttackDamage(enemy, true) * 2 ||
                   enemy.Distance(player) > Orbwalking.GetRealAutoAttackRange(enemy) + 20) || enemy == null))
             {
                 return true;
             }
         }
         if (indanger)
         {
             return true;
         }
     }
     return false;
 }
开发者ID:chienhao10,项目名称:LeagueSharp.BOT,代码行数:37,代码来源:Program.cs

示例8: CheckObjective

 private static bool CheckObjective(Vector3 pos)
 {
     if ((pos.CountEnemiesInRange(800) > 0 || pos.CountAlliesInRange(800) > 0) && !CheckForRetreat(null, pos))
     {
         var obj = Helpers.GetNearest(pos);
         if (obj != null && obj.Health < obj.MaxHealth - 300)
         {
             if (player.Distance(pos) > Jungle.smiteRange)
             {
                 _GameInfo.MoveTo = pos;
                 return true;
             }
         }
     }
     if ((Jungle.SmiteReady() || (player.Level >= 14 && player.HealthPercent > 80)) && player.Level >= 9 &&
         player.Distance(Camps.Dragon.Position) < GameInfo.ChampionRange)
     {
         var drake = Helpers.GetNearest(player.Position, GameInfo.ChampionRange);
         if (drake != null && drake.Name.Contains("Dragon"))
         {
             _GameInfo.CurrentMonster = 13;
             _GameInfo.MoveTo = drake.Position;
             return true;
         }
     }
     return false;
 }
开发者ID:chienhao10,项目名称:LeagueSharp.BOT,代码行数:27,代码来源:Program.cs

示例9: CaitlynIsSafePosition

 bool CaitlynIsSafePosition(Vector3 position)
 {
     //If the enemies in range - the low health enemies in range are equal to zero and our Health % is >= 40% then we can go in
     return (position.CountEnemiesInRange(450f) - HeroHelper.GetLhEnemiesNearPosition(position,450f).Count == 0) && (ObjectManager.Player.HealthPercentage() >= 40) && (!position.UnderTurret(true));
 }
开发者ID:ShineSharp,项目名称:LeagueSharp-5,代码行数:5,代码来源:Caitlyn.cs

示例10: GoodPath

 private static bool GoodPath(Vector3 gankPosition, bool withoutHero=false)
 {
     return
         Player.GetPath(gankPosition)
             .All(
                 point =>
                     !point.UnderTurret(true) && (gankPosition.CountEnemiesInRange(800) == 0 || withoutHero) &&
                     MinionManager.GetMinions(gankPosition, 800, MinionTypes.All, MinionTeam.Enemy).Count == 0);
 }
开发者ID:ff00789,项目名称:LeagueSharp,代码行数:9,代码来源:Program.cs

示例11: IsSafePosition

        public static bool IsSafePosition(Vector3 position)
        {
            var underTurret =
                EntityManager.Turrets.Enemies.FirstOrDefault(
                    turret => !turret.IsDead && turret.Distance(position) <= 950);
            var allies = EntityManager.Heroes.Allies.Count(
                allied => !allied.IsDead && allied.Distance(position) <= 800);
            var enemies = position.CountEnemiesInRange(1000);
            var lhEnemies = GetLowaiAiHeroClients(position, 800).Count();
            if (underTurret != null) return false;

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

示例12: OkToQ2

 public static bool OkToQ2(Vector3 Position)
 {
     if (!MenuHelper.isMenuEnabled("dz191.vhr.misc.tumble.mirin"))
     {
         var closeEnemies =
             HeroManager.Enemies.FindAll(en => en.IsValidTarget(1500f)).OrderBy(en => en.Distance(Position));
         if (closeEnemies.Any())
         {
             return
                 closeEnemies.All(
                     enemy =>
                         Position.CountEnemiesInRange(
                             MenuHelper.isMenuEnabled("dz191.vhr.misc.tumble.dynamicqsafety")
                                 ? enemy.AttackRange
                                 : 405f) < 1);
         }
         return true;
     }
     else
     {
         if (Position.CountEnemiesInRange(360f) >= 1)
         {
             return false;
         }
         return true;
     }
 }
开发者ID:evangelineak1026,项目名称:LeagueSharp,代码行数:27,代码来源:Helpers.cs

示例13: InAARange

 public bool InAARange(Vector3 point)
 {
     if (!Config.Item("AAcheck", true).GetValue<bool>())
         return true;
     else if (Orbwalker.GetTarget() != null && Orbwalker.GetTarget().Type == GameObjectType.obj_AI_Hero)
     {
         return point.Distance(Orbwalker.GetTarget().Position) < Player.AttackRange;
     }
     else
     {
         return point.CountEnemiesInRange(Player.AttackRange) > 0;
     }
 }
开发者ID:Zzihao,项目名称:LeagueRepo,代码行数:13,代码来源:OKTWdash.cs

示例14: CheckLaneClear

 private static bool CheckLaneClear(Vector3 pos)
 {
     return (Helpers.AlliesThere(pos) == 0 || Helpers.AlliesThere(pos) >= 2 ||
             player.Distance(_GameInfo.SpawnPoint) < 6000 || player.Distance(_GameInfo.SpawnPointEnemy) < 6000 ||
             player.Level >= 14) && pos.CountEnemiesInRange(GameInfo.ChampionRange) == 0 &&
            Helpers.getMobs(pos, GameInfo.ChampionRange).Count +
            _GameInfo.EnemyStructures.Count(p => p.Distance(pos) < GameInfo.ChampionRange) > 0 &&
            !_GameInfo.MonsterList.Any(m => m.Position.Distance(pos) < 600) && _GameInfo.SmiteableMob == null &&
            _GameInfo.GameState != State.Retreat;
 }
开发者ID:koolkaracter,项目名称:LeagueSharp,代码行数:10,代码来源:Program.cs

示例15: IsGoodPosition

        public static bool IsGoodPosition(Vector3 dashPos)
        {
            if (MenuManager.UseQWall)
            {
                float segment = Manager.SpellManager.Q.Range / 5;
                for (int i = 1; i <= 5; i++)
                {
                    if (Variables._Player.Position.Extend(dashPos, i * segment).IsWall())
                        return false;
                }
            }

            var enemyCheck = MenuManager.UseQEnemies;
            var enemyCountDashPos = dashPos.CountEnemiesInRange(600);

            if (enemyCheck > enemyCountDashPos)
                return true;

            var enemyCountPlayer = Variables._Player.CountEnemiesInRange(400);

            if (enemyCountDashPos <= enemyCountPlayer)
                return true;

            return false;
        }
开发者ID:Kysamaa,项目名称:Developing,代码行数:25,代码来源:Tumble.cs


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