本文整理汇总了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);
}
}
示例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();
}
}
}
示例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;
}
}
示例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;
}
}