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


C# Obj_AI_Hero.InAutoAttackRange方法代码示例

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


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

示例1: Swap

 private static void Swap(Obj_AI_Hero target)
 {
     if (DeadByRMark(target))
     {
         return;
     }
     if (MainMenu["Combo"]["SwapGap"].GetValue<MenuList>().Index > 0 && !target.InAutoAttackRange())
     {
         var distPlayer = Player.Distance(target);
         var distW = WState == 1 && wShadow.IsValid() ? wShadow.Distance(target) : 999999;
         var distR = RState == 1 && rShadow.IsValid() ? rShadow.Distance(target) : 999999;
         var minDist = Math.Min(Math.Min(distW, distR), distPlayer);
         if (minDist < distPlayer)
         {
             switch (MainMenu["Combo"]["SwapGap"].GetValue<MenuList>().Index)
             {
                 case 1:
                     if (Math.Abs(minDist - distW) < float.Epsilon)
                     {
                         var calcCombo = GetComboDmg(
                             target,
                             Q.IsReady(),
                             minDist < Q.Range || (rShadow.IsValid() && rShadow.Distance(target) < Q.Range),
                             E.IsReady(),
                             MainMenu["Combo"]["R"] && MainMenu["Combo"]["RCast" + target.ChampionName]
                             && RState == 0);
                         if (target.Health + target.PhysicalShield < calcCombo[0]
                             && (Player.Mana >= calcCombo[1] || Player.Mana * OverkillValue >= calcCombo[1]))
                         {
                             W.Cast();
                         }
                         if (MainMenu["Combo"]["R"] && MainMenu["Combo"]["RCast" + target.ChampionName]
                             && RState == 0 && !R.IsInRange(target) && minDist < R.Range)
                         {
                             W.Cast();
                         }
                     }
                     else if (Math.Abs(minDist - distR) < float.Epsilon)
                     {
                         var calcCombo = GetComboDmg(
                             target,
                             Q.IsReady(),
                             minDist < Q.Range || (wShadow.IsValid() && wShadow.Distance(target) < Q.Range),
                             E.IsReady(),
                             false);
                         if (target.Health + target.PhysicalShield < calcCombo[0]
                             && (Player.Mana >= calcCombo[1] || Player.Mana * OverkillValue >= calcCombo[1]))
                         {
                             R.Cast();
                         }
                         if (MainMenu["Combo"]["WNormal"] && WState == 0 && distPlayer > RangeW - 100
                             && !HaveRMark(target))
                         {
                             if (Q.IsReady() && Player.Mana >= Q.Instance.ManaCost + W.Instance.ManaCost
                                 && minDist < RangeW + Q.Range)
                             {
                                 R.Cast();
                             }
                             if (E.IsReady() && Player.Mana >= E.Instance.ManaCost + W.Instance.ManaCost
                                 && minDist < RangeW + E.Range)
                             {
                                 R.Cast();
                             }
                         }
                     }
                     break;
                 case 2:
                     if (minDist <= 500)
                     {
                         if (Math.Abs(minDist - distW) < float.Epsilon)
                         {
                             W.Cast();
                         }
                         else if (Math.Abs(minDist - distR) < float.Epsilon)
                         {
                             R.Cast();
                         }
                     }
                     break;
             }
         }
     }
     if ((MainMenu["Combo"]["SwapIfHpU"] > Player.HealthPercent && Player.HealthPercent < target.HealthPercent)
         || (MainMenu["Combo"]["SwapIfKill"] && deathMark != null))
     {
         var countPlayer = Player.CountEnemyHeroesInRange(400);
         var countW = WState == 1 && wShadow.IsValid() ? wShadow.CountEnemyHeroesInRange(400) : 10;
         var countR = RState == 1 && rShadow.IsValid() ? rShadow.CountEnemyHeroesInRange(400) : 10;
         var minCount = Math.Min(countR, countW);
         if (minCount < countPlayer)
         {
             if (minCount == countW)
             {
                 W.Cast();
             }
             else if (minCount == countR)
             {
                 R.Cast();
             }
         }
//.........这里部分代码省略.........
开发者ID:pandaChoi,项目名称:LeagueSharp-3,代码行数:101,代码来源:Zed.cs


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