Example #1
0
 public static float GetNeededMoveTimeHeavy(Obj_AI_Hero hero, Vector3 moveTo)
 {
     var path = hero.GetPath(moveTo);
     var time = (path[0] - hero.Position).Length() / hero.MoveSpeed;
     for (int i = 1; i < path.Length; i++)
         time += (path[i] - path[i - 1]).Length() / hero.MoveSpeed;
     return time;
 }
Example #2
0
 public static float GetNeededMoveTimeWithoutMsHeavy(Obj_AI_Hero hero, Vector3 moveTo)
 {
     Console.WriteLine(hero.Name);
     var path = hero.GetPath(moveTo);
     var time = (path[0] - hero.Position).Length();
     for (int i = 1; i < path.Length; i++)
         time += (path[i] - path[i - 1]).Length();
     return time;
 }
 public static Vector3 GetPointAfterTimeFromPath(Obj_AI_Hero hero, Vector3 b, float timeInSec)
 {
     var path = hero.GetPath(b);
     var lastPoint = path[0];
     var distance = 0f;
     var maxDist = hero.MoveSpeed * timeInSec;
     foreach (var point in path.Where(point => !point.Equals(lastPoint)))
     {
         if (distance > maxDist)
         {
             break;
         }
         distance += lastPoint.Distance(point);
         lastPoint = point;
     }
     return lastPoint;
 }
 private void DrawWaypoint(Obj_AI_Hero hero, Vector3 endPos)
 {
     List<Vector3> waypoints = hero.GetPath(endPos).ToList();
     for (int i = 0; i < waypoints.Count - 1; i++)
     {
         Vector2 oWp = Drawing.WorldToScreen(waypoints[i]);
         Vector2 nWp = Drawing.WorldToScreen(waypoints[i + 1]);
         Drawing.DrawLine(oWp[0], oWp[1], nWp[0], nWp[1], 1, System.Drawing.Color.GreenYellow);
     }
 }
 public static float GetPath(Obj_AI_Hero hero, Vector3 b)
 {
     var path = hero.GetPath(b);
     var lastPoint = path[0];
     var distance = 0f;
     foreach (var point in path.Where(point => !point.Equals(lastPoint)))
     {
         distance += lastPoint.Distance(point);
         lastPoint = point;
     }
     return distance;
 }