本文整理匯總了C#中AIHeroClient.IsECastableOnEnemy方法的典型用法代碼示例。如果您正苦於以下問題:C# AIHeroClient.IsECastableOnEnemy方法的具體用法?C# AIHeroClient.IsECastableOnEnemy怎麽用?C# AIHeroClient.IsECastableOnEnemy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AIHeroClient
的用法示例。
在下文中一共展示了AIHeroClient.IsECastableOnEnemy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: CanICastE
/// <summary>
/// Returns true if all 3 condemn vectors have wall collision flags
/// </summary>
/// <param name="unit">Target</param>
/// <param name="range">Push distance</param>
/// <returns>Returns true if vectors have wall collision flags</returns>
public static bool CanICastE(AIHeroClient unit, float range)
{
if (unit == null || !unit.IsECastableOnEnemy() || unit.IsDashing())
return false;
var accuracy = Config.CondemnMenu.EMethod;
var position = Prediction.PredictUnitPosition(unit, 200);
if (!unit.CanMove)
{
for (var i = 25; i < range + 50; i += 50)
{
var vec = unit.ServerPosition.Extend(Player.Instance.ServerPosition, -Math.Min(i, range));
if (vec.IsWall())
{
return true;
}
}
}
else
{
switch (accuracy)
{
case 0:
{
for (var i = Config.CondemnMenu.PushDistance; i >= 100; i -= 100)
{
var vec = position.Extend(Player.Instance.ServerPosition, -i);
var left = new Vector2[5];
var right = new Vector2[5];
var var = 18*i/100;
for (var x = 0; x < 5; x++)
{
left[x] =
position.Extend(
vec + (position - vec).Normalized().Rotated((float) ToRadian(Math.Max(0, var)))*
Math.Abs(i < 200 ? 50 : 45*x), i);
right[x] =
position.Extend(
vec +
(position - vec).Normalized().Rotated((float) ToRadian(-Math.Max(0, var)))*
Math.Abs(i < 200 ? 50 : 45*x), i);
}
if (left[0].IsWall() && right[0].IsWall() && left[1].IsWall() && right[1].IsWall() &&
left[2].IsWall() && right[2].IsWall() && left[3].IsWall() && right[3].IsWall() &&
left[4].IsWall() && right[4].IsWall() && vec.IsWall())
{
return true;
}
}
break;
}
case 1:
{
for (var i = 25; i < range + 50; i += 50)
{
var vec = position.Extend(Player.Instance.ServerPosition, -Math.Min(i, range));
if (vec.IsWall())
{
return true;
}
}
break;
}
default:
{
return false;
}
}
}
return false;
}