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


C# Obj_AI_Hero.GetRealAutoAttackRange方法代码示例

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


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

示例1: Swap

 private static void Swap(Obj_AI_Hero target)
 {
     var eCanKill = E.CanCast(target) && target.Health + target.PhysicalShield <= E.GetDamage(target);
     if (MainMenu["Combo"]["SwapIfKill"])
     {
         if (IsKillByMark(target) || eCanKill)
         {
             SwapCountEnemy();
         }
     }
     if (Player.HealthPercent < MainMenu["Combo"]["SwapIfHpU"])
     {
         if (IsKillByMark(target) || !eCanKill || Player.HealthPercent < target.HealthPercent)
         {
             SwapCountEnemy();
         }
     }
     else if (MainMenu["Combo"]["SwapGap"].GetValue<MenuList>().Index > 0 && !E.IsInRange(target)
              && !IsKillByMark(target))
     {
         var playerDist = target.DistanceToPlayer();
         var wDist = WState == 1 && wShadow.IsValid() ? wShadow.Distance(target) : float.MaxValue;
         var rDist = RState == 1 && rShadow.IsValid() ? rShadow.Distance(target) : float.MaxValue;
         var minDist = Math.Min(Math.Min(wDist, rDist), playerDist);
         if (minDist < playerDist)
         {
             switch (MainMenu["Combo"]["SwapGap"].GetValue<MenuList>().Index)
             {
                 case 1:
                     if (Math.Abs(minDist - wDist) < float.Epsilon)
                     {
                         var comboW = GetCombo(
                             target,
                             Q.IsReady() && minDist < Q.Range,
                             false,
                             E.IsReady() && minDist < E.Range,
                             MainMenu["Combo"]["R"] && MainMenu["Combo"]["RCast" + target.ChampionName]
                             && RState == 0 && minDist < R.Range);
                         if (minDist > target.GetRealAutoAttackRange())
                         {
                             comboW[0] -= Player.GetAutoAttackDamage(target);
                         }
                         if (target.Health + target.PhysicalShield <= comboW[0] && Player.Mana >= comboW[1]
                             && W.Cast())
                         {
                             return;
                         }
                         if (MainMenu["Combo"]["R"] && MainMenu["Combo"]["RCast" + target.ChampionName]
                             && RState == 0 && !R.IsInRange(target) && minDist < R.Range
                             && (MainMenu["Combo"]["RMode"].GetValue<MenuList>().Index == 0 || CanR)
                             && W.Cast())
                         {
                             return;
                         }
                     }
                     else if (Math.Abs(minDist - rDist) < float.Epsilon)
                     {
                         var comboR = GetCombo(
                             target,
                             Q.IsReady() && minDist < Q.Range,
                             false,
                             E.IsReady() && minDist < E.Range,
                             false);
                         if (minDist > target.GetRealAutoAttackRange())
                         {
                             comboR[0] -= Player.GetAutoAttackDamage(target);
                         }
                         if (target.Health + target.PhysicalShield <= comboR[0] && Player.Mana >= comboR[1]
                             && R.Cast())
                         {
                             return;
                         }
                     }
                     if (minDist < E.Range && target.HealthPercent <= 20
                         && target.HealthPercent < Player.HealthPercent && (Q.IsReady() || E.IsReady()))
                     {
                         if (Math.Abs(minDist - wDist) < float.Epsilon)
                         {
                             W.Cast();
                         }
                         else if (Math.Abs(minDist - rDist) < float.Epsilon)
                         {
                             R.Cast();
                         }
                     }
                     break;
                 case 2:
                     if (minDist <= 500)
                     {
                         if (Math.Abs(minDist - wDist) < float.Epsilon)
                         {
                             W.Cast();
                         }
                         else if (Math.Abs(minDist - rDist) < float.Epsilon)
                         {
                             R.Cast();
                         }
                     }
                     break;
             }
//.........这里部分代码省略.........
开发者ID:Inuyalx,项目名称:LeagueSharp,代码行数:101,代码来源:Zed.cs

示例2: IsValidTarget

 /// <summary>
 ///     Determines whether [is valid target] [the specified hero].
 /// </summary>
 /// <param name="hero">
 ///     The hero.
 /// </param>
 /// <param name="range">
 ///     The range.
 /// </param>
 /// <param name="damageType">
 ///     Type of the damage.
 /// </param>
 /// <param name="ignoreShields">
 ///     Indicates whether to ignore shields.
 /// </param>
 /// <param name="from">The from location.</param>
 /// <returns>
 ///     The <see cref="bool" />.
 /// </returns>
 private static bool IsValidTarget(
     Obj_AI_Hero hero,
     float range,
     DamageType damageType,
     bool ignoreShields = true,
     Vector3 from = default(Vector3))
 {
     return hero.IsValidTarget()
            && hero.DistanceSquared(@from.Equals(default(Vector3)) ? GameObjects.Player.ServerPosition : @from)
            < Math.Pow(range <= 0 ? hero.GetRealAutoAttackRange() : range, 2)
            && !Invulnerable.Check(hero, damageType, ignoreShields);
 }
开发者ID:parkyoungsoo,项目名称:LeagueSharp.SDK,代码行数:31,代码来源:TargetSelector.cs


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