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


C# AttackableUnit.CountEnemiesInRange方法代码示例

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


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

示例1: Orbwalker_OnPreAttack

        /*private static void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            Chat.Print("Failed Downloading: " + e.Error);
            AllahAkbar = new SoundPlayer
            {
                SoundLocation =
                    SandboxConfig.DataDirectory + @"\JinXXX\" + "Allahu_Akbar_Sound_Effect_Download_Link.wav"
            };
            AllahAkbar.Load();
        }*/
        /// <summary>
        /// Called Before Attack
        /// </summary>
        /// <param name="target">The Target</param>
        /// <param name="args">The Args</param>
        private static void Orbwalker_OnPreAttack(AttackableUnit target, Orbwalker.PreAttackArgs args)
        {
            #region Combo

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo))
            {
                var useQ = Config.ComboMenu["useQ"].Cast<CheckBox>().CurrentValue;

                // If the player has the rocket
                if (useQ && Program.Q.IsReady() && Essentials.FishBones())
                {
                    //var target = TargetSelector.GetTarget(Essentials.FishBonesRange(), DamageType.Physical);

                    if (target != null && target.IsValidTarget())
                    {
                        if (Player.Instance.Distance(target) <= Essentials.MinigunRange &&
                            target.CountEnemiesInRange(100) <
                            Config.ComboMenu["qCountC"].Cast<Slider>().CurrentValue)
                        {
                            Program.Q.Cast();
                            Orbwalker.ForcedTarget = target;
                        }
                    }
                }
            }

            #endregion

            #region LastHit

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LastHit))
            {
                var useQ = Config.LastHitMenu["useQ"].Cast<CheckBox>().CurrentValue;
                var manaQ = Config.LastHitMenu["manaQ"].Cast<Slider>().CurrentValue;
                var qCountM = Config.LastHitMenu["qCountM"].Cast<Slider>().CurrentValue;

                // Force Minigun if there is a lasthittable minion in minigun range and there is no targets more than the setting amount.
                var kM = Orbwalker.LastHitMinionsList.Where(
                    t => t.IsEnemy &&
                         t.Health <= (Player.Instance.GetAutoAttackDamage(t) * 0.9) && t.IsValidTarget() &&
                         t.Distance(Player.Instance) <= Essentials.MinigunRange);
                if (useQ && Essentials.FishBones() && kM.Count() < qCountM)
                {
                    Program.Q.Cast();
                }
            }

            #endregion

            #region Lane Clear

            if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.LaneClear))
            {
                var minion = EntityManager.MinionsAndMonsters.GetLaneMinions(
                    EntityManager.UnitTeam.Enemy,
                    Player.Instance.ServerPosition,
                    Essentials.FishBonesRange()).OrderByDescending(t => t.Health);

                if (Essentials.FishBones())
                {
                    foreach (var m in minion)
                    {
                        var minionsAoe =
                            EntityManager.MinionsAndMonsters.EnemyMinions.Count(
                                t => t.IsValidTarget() && t.Distance(m) <= 100);

                        if (m.Distance(Player.Instance) <= Essentials.MinigunRange && m.IsValidTarget() &&
                            (minionsAoe < Config.LaneClearMenu["qCountM"].Cast<Slider>().CurrentValue ||
                             m.Health > (Player.Instance.GetAutoAttackDamage(m))))
                        {
                            Q.Cast();
                            Orbwalker.ForcedTarget = m;
                        }
                        else if (m.Distance(Player.Instance) <= Essentials.MinigunRange &&
                                 !Orbwalker.LastHitMinionsList.Contains(m))
                        {
                            Q.Cast();
                            Orbwalker.ForcedTarget = m;
                        }
                        else
                        {
                            foreach (
                                var kM in
                                    Orbwalker.LastHitMinionsList.Where(
                                        kM =>
//.........这里部分代码省略.........
开发者ID:KarmaPanda,项目名称:EloBuddy,代码行数:101,代码来源:Program.cs


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