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