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


C# Obj_AI_Base.GetDistanceSqr方法代码示例

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


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

示例1: CastE

 public void CastE(Obj_AI_Base target)
 {
     if (E.IsReady && target != null && !IsWaitingShadow)
     {
         var heroDistance = MyHero.GetDistanceSqr(target);
         var wShadowDistance = WShadowIsValid ? target.GetDistanceSqr(WShadow) : 16000000f;
         var rShadowDistance = RShadowIsValid ? target.GetDistanceSqr(RShadow) : 16000000f;
         var min = Math.Min(Math.Min(rShadowDistance, wShadowDistance), heroDistance);
         if (Math.Abs(min - wShadowDistance) < float.Epsilon)
         {
             E.SourceObject = WShadow;
         }
         else if (Math.Abs(min - rShadowDistance) < float.Epsilon)
         {
             E.SourceObject = RShadow;
         }
         else
         {
             E.SourceObject = MyHero;
         }
         E.RangeCheckSourceObject = E.Source;
         E.Cast(target);
     }
 }
开发者ID:mezer123,项目名称:EloBuddy,代码行数:24,代码来源:Zed.cs

示例2: CastE

 public void CastE(Obj_AI_Base target)
 {
     if (E.IsReady && target != null && !IsWaitingShadow)
     {
         var heroDistance = MyHero.GetDistanceSqr(target);
         var wShadowDistance = WShadowIsValid ? target.GetDistanceSqr(WShadow) : 16000000f;
         var rShadowDistance = RShadowIsValid ? target.GetDistanceSqr(RShadow) : 16000000f;
         var min = Math.Min(Math.Min(rShadowDistance, wShadowDistance), heroDistance);
         if (Math.Abs(min - wShadowDistance) < float.Epsilon)
         {
             E.SourceObject = WShadow;
         }
         else if (Math.Abs(min - rShadowDistance) < float.Epsilon)
         {
             E.SourceObject = RShadow;
         }
         else
         {
             E.SourceObject = MyHero;
         }
         E.RangeCheckSourceObject = E.Source;
         var hero = target as AIHeroClient;
         var pred = E.GetPrediction(target);
         if (pred.HitChancePercent >= E.HitChancePercent)
         {
             if (hero != null)
             {
                 if (WillDie(hero, E.GetDamage(target)))
                 {
                     SwapByCountingEnemies();
                     return;
                 }
             }
             E.Cast();
         }
     }
 }
开发者ID:BEEBEEISADOG,项目名称:EloBuddy,代码行数:37,代码来源:Zed.cs

示例3: CastQ

 public void CastQ(Obj_AI_Base target)
 {
     if (Q.IsReady && target != null && !IsWaitingShadow)
     {
         var heroDistance = MyHero.GetDistanceSqr(target);
         var wShadowDistance = WShadowIsValid ? target.GetDistanceSqr(WShadow) : 16000000f;
         var rShadowDistance = RShadowIsValid ? target.GetDistanceSqr(RShadow) : 16000000f;
         var min = Math.Min(Math.Min(rShadowDistance, wShadowDistance), heroDistance);
         if (Math.Abs(min - wShadowDistance) < float.Epsilon && heroDistance > QReducedSqr)
         {
             Q.SourceObject = WShadow;
         }
         else if (Math.Abs(min - rShadowDistance) < float.Epsilon && heroDistance > QReducedSqr)
         {
             Q.SourceObject = RShadow;
         }
         else
         {
             Q.SourceObject = MyHero;
         }
         Q.RangeCheckSourceObject = Q.Source;
         var qRange = Q.Range;
         if (W.LastCastTime > 0 && !WShadowIsValid &&
             Core.GameTickCount - W.LastCastTime <= W.GetArrivalTime(W.LastEndPosition))
         {
             Q.Range = Q.Range + (int)W.LastEndPosition.Distance(Q.Source);
         }
         Q.Cast(target);
         Q.Range = qRange;
     }
 }
开发者ID:mezer123,项目名称:EloBuddy,代码行数:31,代码来源:Zed.cs

示例4: CastQ

 public void CastQ(Obj_AI_Base target)
 {
     if (Q.IsReady && target != null && !IsWaitingShadow)
     {
         var heroDistance = MyHero.GetDistanceSqr(target);
         var wShadowDistance = WShadowIsValid ? target.GetDistanceSqr(WShadow) : 16000000f;
         var rShadowDistance = RShadowIsValid ? target.GetDistanceSqr(RShadow) : 16000000f;
         var min = Math.Min(Math.Min(rShadowDistance, wShadowDistance), heroDistance);
         if (Math.Abs(min - wShadowDistance) < float.Epsilon && heroDistance > QReducedSqr)
         {
             Q.SourceObject = WShadow;
         }
         else if (Math.Abs(min - rShadowDistance) < float.Epsilon && heroDistance > QReducedSqr)
         {
             Q.SourceObject = RShadow;
         }
         else
         {
             Q.SourceObject = MyHero;
         }
         Q.RangeCheckSourceObject = Q.Source;
         var qRange = Q.Range;
         if (W.LastCastTime > 0 && !WShadowIsValid &&
             Core.GameTickCount - W.LastCastTime <= W.GetArrivalTime(W.LastEndPosition))
         {
             Q.Range = Q.Range + (int)W.LastEndPosition.Distance(Q.Source);
         }
         var hero = target as AIHeroClient;
         var pred = Q.GetPrediction(target);
         if (pred.HitChancePercent >= Q.HitChancePercent)
         {
             if (hero != null)
             {
                 if (WillDie(hero, Q.GetDamage(target)))
                 {
                     SwapByCountingEnemies();
                     return;
                 }
             }
             Q.Cast(pred.CastPosition);
         }
         Q.Range = qRange;
     }
 }
开发者ID:BEEBEEISADOG,项目名称:EloBuddy,代码行数:44,代码来源:Zed.cs


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