public static List <Vector2> GetEnemyPoints() { var polygonsList = EnemiesClose.Select(enemy => new Geometry.Circle(enemy.ServerPosition.ToVector2(), (enemy.IsMelee ? enemy.AttackRange * 1.5f : enemy.AttackRange) + enemy.BoundingRadius + 20).ToPolygon()).ToList(); var pathList = Geometry.ClipPolygons(polygonsList); var pointList = pathList.SelectMany(path => path, (path, point) => new Vector2(point.X, point.Y)).Where(currentPoint => !currentPoint.IsWall()).ToList(); return(pointList); }
private static List <Vector2> GetEnemyPoints(bool dynamic = true) { var staticRange = 360f; var polygonsList = EnemiesClose.Select(enemy => new Geometry.Polygon.Circle(enemy.ServerPosition.To2D(), (dynamic ? (enemy.IsMelee ? enemy.AttackRange * 1.5f : enemy.AttackRange) : staticRange) + enemy.BoundingRadius + 20)).ToList(); var pathList = Geometry.ClipPolygons(polygonsList); var pointList = pathList.SelectMany(path => path, (path, point) => new Vector2(point.X, point.Y)).Where(currentPoint => !currentPoint.IsWall()).ToList(); return(pointList); }
/// <summary> /// Returns if this passes the 'No Q into enemies mode' /// </summary> /// <param name="Position">The Position</param> /// <returns></returns> public static bool PassesNoQIntoEnemiesCheck(this Vector3 Position) { if (!VHR.VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.tumble"]["noqenemies"].GetValue <MenuBool>().Value || VHR.VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.tumble"]["qspam"].GetValue <MenuBool>().Value) { return(true); } if (!VHR.VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.general"]["lightweight"].GetValue <MenuBool>().Value) { var Vector2Position = Position.ToVector2(); if (EnemiesClose.Count() <= 1) { return(true); } if (GetEnemyPoints().Contains(Vector2Position) && !VHR.VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.tumble"]["qspam"].GetValue <MenuBool>().Value) { return(false); } return(true); } var closeEnemies = GameObjects.EnemyHeroes.Where(en => en.IsValidTarget(1500f)).OrderBy(en => en.Distance(Position)); if (closeEnemies.Any()) { if (closeEnemies.Count() <= 1) { return(true); } return(closeEnemies.All(enemy => Position.CountEnemiesInRange(VHR.VHRMenu["dz191.vhr.misc"]["dz191.vhr.misc.tumble"]["dynamicqsafety"].GetValue <MenuBool>().Value ? enemy.AttackRange : 405f) < 1)); } return(true); }