本文整理汇总了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();
}
}
//.........这里部分代码省略.........