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


C# AIHeroClient.Distance方法代码示例

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


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

示例1: GapcloserOnOnGapcloser

 private static void GapcloserOnOnGapcloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs gapcloserEventArgs)
 {
     if (!sender.IsEnemy || Player.Instance.IsRecalling())
     {
         return;
     }
     if (SettingsMisc.AntigapcloserUseQ && SpellManager.Q.IsReady() && gapcloserEventArgs.End.Distance(Player.Instance) < 200)
     {
         Debug.WriteChat("AntiGapcloser with Q, Target: {0}, Distance: {1}, GapcloserSpell: {2}", sender.ChampionName, "" + sender.Distance(Player.Instance), gapcloserEventArgs.SpellName);
         canAntiGapR = false;
         if (gapcloserEventArgs.Type == Gapcloser.GapcloserType.Targeted &&
             gapcloserEventArgs.End.Distance(Player.Instance.Position) < 50)
         {
             SpellManager.Q.Cast(sender);
             Core.DelayAction(() => { SpellManager.Q.Cast(sender); }, 1);
             Core.DelayAction(() => { canAntiGapR = true; }, 200);
         }
         else
         {
             SpellManager.Q.Cast(gapcloserEventArgs.End);
             Core.DelayAction(() => { SpellManager.Q.Cast(gapcloserEventArgs.End); }, 1);
             Core.DelayAction(() => { canAntiGapR = true; }, 200);
         }
         return;
     }
     if (SettingsMisc.AntigapcloserUseR && !SpellManager.R.IsOnCooldown && SpellManager.R.IsInRange(gapcloserEventArgs.End) && canAntiGapR)
     {
         Debug.WriteChat("AntiGapcloser with R, Target: {0}, Distance: {1}, GapcloserSpell: {2}", sender.ChampionName, "" + sender.Distance(Player.Instance), gapcloserEventArgs.SpellName);
         SpellManager.R.Cast();
     }
 }
开发者ID:tswierkot,项目名称:EloBuddy,代码行数:31,代码来源:Events.cs

示例2: GetDamage

 public override float GetDamage(AIHeroClient enemy)
 {
     var baseDamage = base.GetDamage(enemy);
     return enemy.HasBuff("brandablaze") || _brandE.CanBeCast() && enemy.Distance(ObjectManager.Player) < 650
         ? baseDamage*1.25f
         : baseDamage;
 }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:7,代码来源:BrandW.cs

示例3: CastE

        private static void CastE(AIHeroClient target)
        {
            var turret = EntityManager.Turrets.Allies.Where(x => !x.IsDead && x.Distance(myHero) < 1200).OrderBy(x => x.Distance(myHero));
            var push = target.ServerPosition.Extend(myHero, -300);
            if (
                (Menu.UseEStun && Lib.CanStun(target)) ||
                (Menu.UseEPassive && Lib.Passive != null && push.Distance(Lib.Passive) < myHero.Distance(Lib.Passive) - 100) ||
                (Menu.UseEInsec && turret.Count() > 0 && push.Distance(turret.First()) < target.Distance(turret.First()) && turret.First().IsInRange(push, 1050))
                )
            {
                Lib.E.Cast(target);
            }

            foreach (var ally in EntityManager.Heroes.Allies.Where(x => !x.IsDead && !x.IsMe && !x.IsInAutoAttackRange(target) && x.Distance(myHero) < 1200))
            {
                if (Menu.UseEInsec && push.Distance(ally) < myHero.Distance(ally) - 100)
                {
                    Lib.E.Cast(target);
                }
                else if (Menu.UseFlashE)
                {
                    if (Lib.Flash != null && !Lib.CanStun(target))
                    {
                        var pos = Lib.PointsAroundTheTarget(target).Where(x => Lib.CanStun(target, x)).OrderBy(x => x.Distance(myHero)).FirstOrDefault();
                        if (pos.IsValid(true))
                        {
                            if (Lib.Flash.IsReady() && Lib.Flash.IsInRange(pos.To3D()) && myHero.Distance(pos) >= Settings.MiscSettings.MinimumDistanceToFlash)
                            {
                                Lib.Flash.Cast(pos.To3D());
                            }
                        }
                    }
                }
            }
        }
开发者ID:alvothefirst,项目名称:EloBuddy,代码行数:35,代码来源:Combo.cs

示例4: Gapcloser_OnGapcloser

 private static void Gapcloser_OnGapcloser(AIHeroClient sender, Gapcloser.GapcloserEventArgs e)
 {
     if (Checker.AntiGapCloser && Spells.W.IsReady()
         && sender.Distance(Ryze.ServerPosition) < Spells.W.Range)
     {
         Spells.W.Cast(sender);
     }
 }
开发者ID:Faqer,项目名称:EloBuddy-1,代码行数:8,代码来源:Program.cs

示例5: InFountain

 public static bool InFountain(AIHeroClient hero)
 {
     var map = Game.MapId;
     var mapIsSR = map == GameMapId.SummonersRift;
     float fountainRange = mapIsSR ? 1050 : 750;
     return hero.IsVisible &&
            ObjectManager.Get<Obj_SpawnPoint>()
                .Any(sp => sp.Team == hero.Team && hero.Distance(sp.Position) < fountainRange);
 }
开发者ID:Musee30,项目名称:Elobuddyy,代码行数:9,代码来源:Program.cs

示例6: InFountain

 public static bool InFountain(AIHeroClient hero)
 {
     float fountainRange = 562500; //750 * 750
     Vector3 vec3 = (hero.Team == GameObjectTeam.Order) ? new Vector3(363, 426, 182) : new Vector3(14340, 14390, 172);
     var map = EloBuddy.Game.MapId;
     if (map == GameMapId.SummonersRift)
     {
         fountainRange = 1102500; //1050 * 1050
     }
     return hero.IsVisible && hero.Distance(vec3, true) < fountainRange;
 }
开发者ID:Maufeat,项目名称:Addons,代码行数:11,代码来源:Utility.cs

示例7: ShieldItems

 public static bool ShieldItems(AIHeroClient ally)
 {
     if (ally == null || ally.IsDead || ally.Health <= 0 || !ally.IsValid) return false;
     var predHp = ally.PredictedHealth();
     if (ally.IsMe && Defence.DefenceMenu["Archangels_Staff"].Cast<CheckBox>().CurrentValue && predHp + ShieldHeals[ItemId.Archangels_Staff].Invoke() > 0) // Seraphs
     {
         if (Archangles != null && Archangles.CanUseItem())
         {
             Player.CastSpell(Archangles.SpellSlot);
             Defence.LastSpellCast = Environment.TickCount + 250;
             return true;
         }
     }
     if (Defence.DefenceMenu["Locket_of_the_Iron_Solari"].Cast<CheckBox>().CurrentValue && (ally.IsMe && Defence.DefenceMenu["Locket_of_the_Iron_Solari_self"].Cast<CheckBox>().CurrentValue || !ally.IsMe && Defence.DefenceMenu["Locket_of_the_Iron_Solari_ally"].Cast<CheckBox>().CurrentValue) && predHp + ShieldHeals[ItemId.Locket_of_the_Iron_Solari].Invoke() > 0 && ally.Distance(Player.Instance) < 600) // Locket
     {
         if (Locket != null && Locket.CanUseItem())
         {
             Player.CastSpell(Locket.SpellSlot);
             Defence.LastSpellCast = Environment.TickCount + 250;
             return true;
         }
     }
     if (Defence.DefenceMenu["Face_of_the_Mountain"].Cast<CheckBox>().CurrentValue && (ally.IsMe && Defence.DefenceMenu["Face_of_the_Mountain_self"].Cast<CheckBox>().CurrentValue || !ally.IsMe) && predHp + ShieldHeals[ItemId.Face_of_the_Mountain].Invoke() > 0 && ally.Distance(Player.Instance) < 700) // FOM
     {
         if (FaceOfTheMountain != null && FaceOfTheMountain.CanUseItem())
         {
             Player.CastSpell(FaceOfTheMountain.SpellSlot, ally);
             Defence.LastSpellCast = Environment.TickCount + 250;
             return true;
         }
     }
     if (Defence.DefenceMenu["Mikaels_Crucible_Heal"].Cast<CheckBox>().CurrentValue && Mikaels != null && Mikaels.CanUseItem() && predHp + (150 + (0.1 * ally.Health)) > 0 && ally.Distance(Player.Instance) < 750) // Mikaels
     {
         Player.CastSpell(Mikaels.SpellSlot, ally);
         Defence.LastSpellCast = Environment.TickCount + 250;
         return true;
     }
     return false;
 }
开发者ID:tingtop747,项目名称:Elobuddy-Addons,代码行数:39,代码来源:DefenceItems.cs

示例8: eBehindWall

 public static void eBehindWall(AIHeroClient target)
 {
     if (!Program.E.IsReady() || !Variables.enemyIsJumpable(target) || target.IsMelee)
         return;
     float dist = Variables._Player.Distance(target);
     var pPos = Variables._Player.Position.To2D();
     Vector2 dashPos = target.Position.To2D();
     if (!target.IsMoving || Variables._Player.Distance(dashPos) <= dist)
     {
         foreach (Obj_AI_Base enemy in ObjectManager.Get<Obj_AI_Base>().Where(enemy => Variables.enemyIsJumpable(enemy)))
         {
             Vector2 posAfterE = pPos + (Vector2.Normalize(enemy.Position.To2D() - pPos) * Program.E.Range);
             if ((target.Distance(posAfterE) < dist
                  || target.Distance(posAfterE) < Variables._Player.GetAutoAttackRange(target) + 100)
                 && goesThroughWall(target.Position, posAfterE.To3D()))
             {
                 if (Events._game.useENormal(target))
                     return;
             }
         }
     }
 }
开发者ID:TristeMyth,项目名称:Triste,代码行数:22,代码来源:Combo.cs

示例9: IsValidTarget

 internal static bool IsValidTarget(AIHeroClient target, 
     float range, 
     DamageType damageType,
     bool ignoreShield = true,
     Vector3 from = default(Vector3))
 {
     try
     {
         return target.IsValidTarget() &&
                target.Distance(
                    (from.Equals(default(Vector3)) ? ObjectManager.Player.ServerPosition : from), true) <
                Math.Pow((range <= 0 ? ObjectManager.Player.GetAutoAttackRange(target) : range), 2) &&
                !Invulnerable.Check(target, damageType, ignoreShield );
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     return false;
 }
开发者ID:himrengod,项目名称:Elobuddy-1,代码行数:20,代码来源:AdvancedTargetSelector.cs

示例10: RDamage

        public static float RDamage(AIHeroClient target)
        {
            if (!Program.Spells[SpellSlot.R].IsLearned) return 0;
            var level = Program.Spells[SpellSlot.R].Level - 1;

            if (target.Distance(_Player) < 1350)
            {
                return _Player.CalculateDamageOnUnit(target, DamageType.Physical,
                    (float)
                        (new double[] {25, 35, 45}[level] +
                         new double[] {25, 30, 35}[level]/100*(target.MaxHealth - target.Health) +
                         0.1*_Player.FlatPhysicalDamageMod));
            }

            return _Player.CalculateDamageOnUnit(target, DamageType.Physical,
                (float)
                    (new double[] {250, 350, 450}[level] +
                     new double[] {25, 30, 35}[level]/100*(target.MaxHealth - target.Health) +
                     1*_Player.FlatPhysicalDamageMod));
        }
开发者ID:h4ntero,项目名称:Elobuddy-Addons,代码行数:20,代码来源:UltimateHandler.cs

示例11: Execute

 public override void Execute(AIHeroClient target)
 {
     var distance = target.Distance(ObjectManager.Player);
         //Todo: make him use fireminions even in range, just for showoff and potential AOE. Check if hes on fire too though
     if (distance < 950 && distance > 650 && Program.getMiscMenuCB("eMinion"))
     {
         var fireMinion =
             MinionManager.GetMinions(650, MinionTypes.All, MinionTeam.NotAlly, MinionOrderTypes.None)
                 .Where(minion => minion.HasBuff("brandablaze") && minion.Distance(target) < 300)
                 .MinOrDefault(minion => minion.Distance(target));
         if (fireMinion != null)
         {
             if (Cast(fireMinion) == CastStates.SuccessfullyCasted && !target.HasSpellShield())
                 Provider.SetMarked(target);
         }
     }
     if (distance < 650)
     {
         if (Cast(target) == CastStates.SuccessfullyCasted && !target.HasSpellShield())
             Provider.SetMarked(target);
     }
 }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:22,代码来源:BrandE.cs

示例12: GetPositionKickTo

 internal static Vector3 GetPositionKickTo(AIHeroClient target)
 {
     if (lastEndPos.IsValid())
     {
         return lastEndPos;
     }
     var pos = Player.ServerPosition;
     switch (getBoxItem(insecMenu, "Mode"))
     {
         case 0:
             var turret =
                 GameObjects.AllyTurrets.Where(
                     i =>
                     target.Distance(i) <= 1400 && i.Distance(target) - RKickRange <= 950
                     && i.Distance(target) > 225).MinOrDefault(i => i.DistanceToPlayer());
             if (turret != null)
             {
                 pos = turret.ServerPosition;
             }
             else
             {
                 var hero =
                     GameObjects.AllyHeroes.Where(
                         i =>
                         i.IsValidTarget(RKickRange + 700, false, target.ServerPosition) && !i.IsMe
                         && i.HealthPercent > 10 && i.Distance(target) > 325)
                         .MaxOrDefault(i => i.CountAllyHeroesInRange(600));
                 if (hero != null)
                 {
                     pos = hero.ServerPosition;
                 }
             }
             break;
         case 1:
             pos = Game.CursorPos;
             break;
     }
     return pos;
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:39,代码来源:LeeSin.cs

示例13: OnInterruptableTarget

        private static void OnInterruptableTarget(AIHeroClient sender, Interrupter2.InterruptableTargetEventArgs args)
        {
            if (sender.IsAlly || sender.IsMe)
            {
                return;
            }

            if (args.DangerLevel != Interrupter2.DangerLevel.High || sender.Distance(Player) > W.Range)
            {
                return;
            }

            if (sender.IsValidTarget(Q.Range) && Q.IsReady() && getCheckBoxItem(interrupterMenu, "ElAlistar.Interrupter.Q"))
            {
                Q.Cast();
            }

            if (sender.IsValidTarget(W.Range) && W.IsReady() &&
                getCheckBoxItem(interrupterMenu, "ElAlistar.Interrupter.W"))
            {
                W.Cast(sender);
            }
        }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:23,代码来源:Program.cs

示例14: IsKillByMark

 private static bool IsKillByMark(AIHeroClient target)
 {
     return HaveR(target) && deathMark != null && target.Distance(deathMark) < 150;
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:4,代码来源:Zed.cs

示例15: R1V1

 private static void R1V1(AIHeroClient target)
 {
     if (R1vs1 && target != null && target.IsHPBarRendered && target.Distance(ObjectManager.Player) < 650 && !ShouldntUlt(target))
     {
         if (target.HealthPercent > ObjectManager.Player.HealthPercent &&
             (target.MaxHealth <= ObjectManager.Player.MaxHealth + 300 ||
              noobchamps.Contains(target.CharData.BaseSkinName)))
         {
             var pred = R.GetPrediction(target);
             if (pred.Hitchance >= HitChance.High)
             {
                 R.Cast(pred.UnitPosition);
             }
         }
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:16,代码来源:Program.cs


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