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


C# AIHeroClient.DistanceToPlayer方法代码示例

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


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

示例1: GapByQ

 private static void GapByQ(AIHeroClient target)
 {
     if (!getCheckBoxItem(insecMenu, "Q") || !Q.IsReady() || IsDashing)
     {
         return;
     }
     if (CanWardFlash && (IsWardFlash || (IsQOne && Player.Mana < 50 + 80)))
     {
         return;
     }
     var minDist = GetRange(target, CanWardFlash);
     if (IsQOne)
     {
         Q.CastSpellSmite(target, getCheckBoxItem(insecMenu, "QCol"));
         if (!getCheckBoxItem(insecMenu, "QObj"))
         {
             return;
         }
         var nearObj =
             Common.ListEnemies(true)
                 .Where(
                     i =>
                     !i.Compare(target) && i.IsValidTarget(Q.Range)
                     && Q.GetHealthPrediction(i) > Q.GetDamage(i)
                     && i.Distance(target) < target.DistanceToPlayer() && i.Distance(target) < minDist - 80)
                 .OrderBy(i => i.Distance(target))
                 .ThenByDescending(i => i.Health)
                 .ToList();
         if (nearObj.Count == 0)
         {
             return;
         }
         nearObj.ForEach(i => Q.Casting(i));
     }
     else if (target.DistanceToPlayer() > minDist
              && (HaveQ(target) || (objQ.IsValidTarget(Q2.Range) && target.Distance(objQ) < minDist - 80))
              && ((WardManager.CanWardJump && Player.Mana >= 80)
                  || (getCheckBoxItem(insecMenu, "Flash") && Common.CanFlash)) && Q2.Cast())
     {
         isDashing = true;
         PortAIO.OrbwalkerManager.ForcedTarget(target);
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:43,代码来源:LeeSin.cs

示例2: CanW

 private static SpellSlot CanW(AIHeroClient target)
 {
     if (E.IsReady() && Player.Mana >= E.Instance.SData.Mana + W.Instance.SData.Mana
         && target.DistanceToPlayer() < W.Range + E.Range - 20)
     {
         return SpellSlot.E;
     }
     if (Q.IsReady() && Player.Mana >= Q.Instance.SData.Mana + W.Instance.SData.Mana
         && target.DistanceToPlayer() < W.Range + Q.Range)
     {
         return SpellSlot.Q;
     }
     return SpellSlot.Unknown;
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:14,代码来源:Zed.cs

示例3: Swap

 private static void Swap(AIHeroClient target)
 {
     var eCanKill = E.CanCast(target) && E.CanHitCircle(target)
                    && target.Health + target.AttackShield <= E.GetDamage(target);
     var markCanKill = IsKillByMark(target);
     if (getCheckBoxItem(comboMenu, "SwapIfKill") && (markCanKill || eCanKill))
     {
         SwapCountEnemy();
         return;
     }
     if (Player.HealthPercent < getSliderItem(comboMenu, "SwapIfHpU"))
     {
         if (markCanKill || !eCanKill || Player.HealthPercent < target.HealthPercent)
         {
             SwapCountEnemy();
         }
     }
     else if (getBoxItem(comboMenu, "SwapGap") > 0 && !E.IsInRange(target) && !markCanKill)
     {
         var wDist = WState == 1 && wShadow.LSIsValid() ? wShadow.Distance(target) : float.MaxValue;
         var rDist = RState == 1 && rShadow.LSIsValid() ? rShadow.Distance(target) : float.MaxValue;
         var minDist = Math.Min(wDist, rDist);
         if (minDist.Equals(float.MaxValue) || target.DistanceToPlayer() <= minDist)
         {
             return;
         }
         var swapByW = Math.Abs(minDist - wDist) < float.Epsilon;
         var swapByR = Math.Abs(minDist - rDist) < float.Epsilon;
         if (swapByW && minDist < R.Range && !R.IsInRange(target)
             && getKeyBindItem(comboMenu, "R")
             && getCheckBoxItem(comboMenu, "RCast" + target.NetworkId) && RState == 0 && CanR && W.Cast())
         {
             return;
         }
         switch (getBoxItem(comboMenu, "SwapGap"))
         {
             case 1:
                 if (IsInRangeE(target) && target.HealthPercent < 15 && Player.HealthPercent > 30
                     && (Q.IsReady() || E.IsReady()))
                 {
                     if (swapByW)
                     {
                         W.Cast();
                     }
                     else if (swapByR)
                     {
                         R.Cast();
                     }
                     return;
                 }
                 var combo = GetCombo(
                     target,
                     Q.IsReady() && minDist < Q.Range,
                     false,
                     E.IsReady() && minDist < E.Range);
                 if (minDist > target.GetRealAutoAttackRange())
                 {
                     combo[0] -= Player.GetAutoAttackDamage(target);
                 }
                 if (minDist > target.GetRealAutoAttackRange() + 100)
                 {
                     combo[0] -= Player.GetAutoAttackDamage(target);
                 }
                 if (target.Health + target.AttackShield > combo[0] || Player.Mana < combo[1])
                 {
                     return;
                 }
                 if (swapByW)
                 {
                     W.Cast();
                 }
                 else if (swapByR)
                 {
                     R.Cast();
                 }
                 break;
             case 2:
                 if (minDist > 500)
                 {
                     return;
                 }
                 if (swapByW)
                 {
                     W.Cast();
                 }
                 else if (swapByR)
                 {
                     R.Cast();
                 }
                 break;
         }
     }
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:93,代码来源:Zed.cs

示例4: GapByQ

 private static void GapByQ(AIHeroClient target)
 {
     if (!getCheckBoxItem(insecMenu, "Q") || !Q.IsReady())
     {
         return;
     }
     if (CanWardFlash && IsQOne && Player.Mana < 50 + 80)
     {
         return;
     }
     var minDist = CanWardFlash ? RangeWardFlash : RangeNormal;
     if (IsQOne)
     {
         var pred = Q.GetPrediction(target, false, -1, LeagueSharp.SDK.CollisionableObjects.YasuoWall);
         if (pred.Hitchance >= Q.MinHitChance)
         {
             var col = pred.GetCollision();
             if ((col.Count == 0 || (getCheckBoxItem(insecMenu, "QCol") && Common.CastSmiteKillCollision(col))))
             {
                 //Q.CastIfHitchanceMinimum(target, LeagueSharp.SDK.HitChance.Medium);
                 QELO.Cast(target);
                 return;
             }
         }
         if (!getCheckBoxItem(insecMenu, "QObj"))
         {
             return;
         }
         var nearObj =
             EntityManager.Heroes.Enemies.Where(i => !i.Compare(target))
                 .Cast<Obj_AI_Base>().Concat(EntityManager.MinionsAndMonsters.EnemyMinions.Where(i => i.IsMinion() || i.IsPet()).Concat(GameObjects.Jungle))
                 .Where(
                     i =>
                     i.IsValidTarget(Q.Range) && Q.GetHealthPrediction(i) > Q.GetDamage(i)
                     && i.Distance(target) < minDist - 50)
                 .OrderBy(i => i.Distance(target))
                 .ThenByDescending(i => i.Health)
                 .ToList();
         if (nearObj.Count == 0)
         {
             return;
         }
         nearObj.ForEach(i => Q.Casting(i));
     }
     else if (target.DistanceToPlayer() > minDist
              && (HaveQ(target) || (objQ.IsValidTarget(Q2.Range) && target.Distance(objQ) < minDist - 50))
              && ((WardManager.CanWardJump && Player.Mana >= 80)
                  || (getCheckBoxItem(insecMenu, "Flash") && Flash.IsReady())) && Q2.Cast())
     {
         isDashing = true;
         Orbwalker.ForcedTarget = target;
     }
 }
开发者ID:Xelamats,项目名称:PortAIO,代码行数:53,代码来源:LeeSin.cs


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