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


C# AIHeroClient.ELDistance方法代码示例

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


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

示例1: InsecCombo

        private static void InsecCombo(AIHeroClient target)
        {
            try
            {
                if (target != null && target.IsVisible)
                {
                    if (Player.ELDistance(GetInsecPos(target)) < 200)
                    {
                        insecComboStep = InsecComboStepSelect.Pressr;
                    }
                    else if (insecComboStep == InsecComboStepSelect.None
                             && GetInsecPos(target).ELDistance(Player.Position) < 600)
                    {
                        insecComboStep = InsecComboStepSelect.Wgapclose;
                    }
                    else if (insecComboStep == InsecComboStepSelect.None
                             && target.ELDistance(Player) < spells[Spells.Q].Range)
                    {
                        insecComboStep = InsecComboStepSelect.Qgapclose;
                    }

                    switch (insecComboStep)
                    {
                        case InsecComboStepSelect.Qgapclose:
                            if (QState)
                            {
                                var pred1 = spells[Spells.Q].GetPrediction(target);
                                if (pred1.Hitchance >= HitChance.High)
                                {
                                    if (pred1.CollisionObjects.Count == 0)
                                    {
                                        if (spells[Spells.Q].Cast(pred1.CastPosition))
                                        {
                                            return;
                                        }
                                    }
                                    else
                                    {
                                        CastQ(target);
                                    }
                                }

                                if (!getCheckBoxItem(InitMenu.insecMenu, "checkOthers1"))
                                {
                                    return;
                                }

                                var insecObjects =
                                    HeroManager.Enemies.Where(
                                        x => x.LSIsValidTarget(spells[Spells.Q].Range) && x.ELDistance(target) < 550f)
                                        .Concat(MinionManager.GetMinions(Player.ServerPosition, spells[Spells.Q].Range))
                                        .Where(
                                            m =>
                                            m.LSIsValidTarget(spells[Spells.Q].Range)
                                            && spells[Spells.Q].GetDamage(m) < m.Health + 15
                                            && m.ELDistance(target) < 400f)
                                        .ToList();

                                if (insecObjects.Count > 0)
                                {
                                    foreach (var insectObject in
                                        insecObjects.Select(i => spells[Spells.Q].GetPrediction(i))
                                            .Where(i => i.Hitchance >= HitChance.High)
                                            .OrderByDescending(i => i.Hitchance))
                                    {
                                        spells[Spells.Q].Cast(insectObject.CastPosition);
                                        break;
                                    }
                                }
                                else
                                {
                                    return;
                                }
                            }

                            if (!(target.HasQBuff()) && QState)
                            {
                                CastQ(target);
                            }
                            else if (target.HasQBuff())
                            {
                                spells[Spells.Q].Cast();
                                insecComboStep = InsecComboStepSelect.Wgapclose;
                            }
                            else
                            {
                                if (spells[Spells.Q].Instance.Name.Equals(
                                    "blindmonkqtwo",
                                    StringComparison.InvariantCultureIgnoreCase)
                                    && ReturnQBuff()?.ELDistance(target) <= 600)
                                {
                                    spells[Spells.Q].Cast();
                                }
                            }
                            break;

                        case InsecComboStepSelect.Wgapclose:

                            if (Player.ELDistance(target) < WardRange)
                            {
//.........这里部分代码省略.........
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:101,代码来源:Program.cs

示例2: GetInsecPos

        public static Vector3 GetInsecPos(AIHeroClient target)
        {
            try
            {
                var jumpRange = 265;

                if (ClicksecEnabled && getCheckBoxItem(InitMenu.insecMenu, "clickInsec"))
                {
                    InsecLinePos = Drawing.WorldToScreen(InsecClickPos);
                    return V2E(InsecClickPos, target.Position, target.ELDistance(InsecClickPos) + jumpRange).To3D();
                }
                if (isNullInsecPos)
                {
                    isNullInsecPos = false;
                    insecPos = Player.Position;
                }

                if (GetAllyHeroes(target, 2000 + getSliderItem(InitMenu.insecMenu, "bonusRangeA")).Count > 0
                    && getCheckBoxItem(InitMenu.insecMenu, "ElLeeSin.Insec.Ally"))
                {
                    var insecPosition = InterceptionPoint(GetAllyInsec(GetAllyHeroes(target, 2000 + getSliderItem(InitMenu.insecMenu, "bonusRangeA"))));
                    InsecLinePos = Drawing.WorldToScreen(insecPosition);
                    return V2E(insecPosition, target.Position, target.ELDistance(insecPosition) + jumpRange).To3D();
                }

                if (getCheckBoxItem(InitMenu.insecMenu, "ElLeeSin.Insec.Tower"))
                {
                    var tower =ObjectManager.Get<Obj_AI_Turret>().Where(turret => turret.ELDistance(target) - 725 <= 950 && turret.IsAlly && turret.IsVisible && turret.Health > 0 && turret.ELDistance(target) <= 1300 && turret.ELDistance(target) > 400).MinOrDefault(i => target.ELDistance(Player));
                    if (tower != null)
                    {
                        InsecLinePos = Drawing.WorldToScreen(tower.Position);
                        return V2E(tower.Position, target.Position, target.ELDistance(tower.Position) + jumpRange).To3D();
                    }
                }

                if (getCheckBoxItem(InitMenu.insecMenu, "ElLeeSin.Insec.Original.Pos"))
                {
                    InsecLinePos = Drawing.WorldToScreen(insecPos);
                    return V2E(insecPos, target.Position, target.ELDistance(insecPos) + jumpRange).To3D();
                }
                return new Vector3();
            }
            catch (Exception e)
            {
                Console.WriteLine("An error occurred: '{0}'", e);
            }
            return new Vector3();
        }
开发者ID:yashine59fr,项目名称:PortAIO,代码行数:48,代码来源:Program.cs


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