本文整理汇总了C#中System.Vector2.CountEnemiesInRange方法的典型用法代码示例。如果您正苦于以下问题:C# Vector2.CountEnemiesInRange方法的具体用法?C# Vector2.CountEnemiesInRange怎么用?C# Vector2.CountEnemiesInRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Vector2
的用法示例。
在下文中一共展示了Vector2.CountEnemiesInRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPRADAPos
public static Vector3 GetPRADAPos(this AIHeroClient target)
{
if (target == null) return Vector3.Zero;
var aRC = new Geometry.Circle(Heroes.Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath();
var tP = target.ServerPosition;
var pList = new List<Vector3>();
foreach (var p in aRC)
{
var v3 = new Vector2(p.X, p.Y).To3D();
if (!v3.UnderTurret(true) && v3.Distance(tP) > 325 && v3.Distance(tP) < Heroes.Player.AttackRange &&
(v3.CountEnemiesInRange(425) <= v3.CountAlliesInRange(325))) pList.Add(v3);
}
return pList.Count > 1 ? pList.OrderByDescending(el => el.Distance(tP)).FirstOrDefault() : Vector3.Zero;
}
示例2: GetTumblePos
public static Vector3 GetTumblePos(this Obj_AI_Hero target)
{
//if the target is not a melee and he's alone he's not really a danger to us, proceed to 1v1 him :^ )
if (!target.IsMelee && Heroes.Player.CountEnemiesInRange(800) == 1) return Game.CursorPos;
var flash = Program.Flash;
var flashedAtTick = Program.FlashTime;
if (!flash.IsReady())
{
if (Environment.TickCount - flashedAtTick < 500) return Vector3.Zero;
}
var aRC = new Geometry.Circle(Heroes.Player.ServerPosition.To2D(), 300).ToPolygon().ToClipperPath();
var cP = Game.CursorPos;
var tP = target.ServerPosition;
var pList = new List<Vector3>();
var additionalDistance = (0.106 + Game.Ping/2000f) * target.MoveSpeed;
if ((!cP.IsWall() && !cP.UnderTurret(true) && cP.Distance(tP) > 325 && cP.Distance(tP) < 550 &&
(cP.CountEnemiesInRange(425) <= cP.CountAlliesInRange(325)))) return cP;
foreach (var p in aRC)
{
var v3 = new Vector2(p.X, p.Y).To3D();
if (target.IsFacing(Heroes.Player))
{
if (!v3.IsWall() && !v3.UnderTurret(true) && v3.Distance(tP) > 325 && v3.Distance(tP) < 550 &&
(v3.CountEnemiesInRange(425) <= v3.CountAlliesInRange(325))) pList.Add(v3);
}
else
{
if (!v3.IsWall() && !v3.UnderTurret(true) && v3.Distance(tP) > 325 &&
v3.Distance(tP) < (550 - additionalDistance) &&
(v3.CountEnemiesInRange(425) <= v3.CountAlliesInRange(325))) pList.Add(v3);
}
}
if (Heroes.Player.UnderTurret() || Heroes.Player.CountEnemiesInRange(800) == 1)
{
return pList.Count > 1 ? pList.OrderBy(el => el.Distance(cP)).FirstOrDefault() : Vector3.Zero;
}
return pList.Count > 1 ? pList.OrderByDescending(el => el.Distance(tP)).FirstOrDefault() : Vector3.Zero;
}