Esempio n. 1
0
 public static List<Obj_AI_Base> canGoThrough(YasDash dash)
 {
     List<Obj_AI_Base> jumps = ObjectManager.Get<Obj_AI_Base>().Where(enemy => enemyIsJumpable(enemy) && enemy.IsValidTarget(550, true, dash.to)).ToList();
     List<Obj_AI_Base> canBejump = new List<Obj_AI_Base>();
     foreach (var jumpe in jumps)
     {
         if (YasMath.interCir(dash.from.To2D(), dash.to.To2D(), jumpe.Position.To2D(), 35) /*&& jumpe.Distance(dash.to) < Player.Distance(dash.to)*/)
         {
             canBejump.Add(jumpe);
         }
     }
     return canBejump.OrderBy(jum => Player.Distance(jum)).ToList();
 }
Esempio n. 2
0
        public static YasDash getClosestDash(float dist = 350)
        {
            YasDash closestWall = dashes[0];

            for (int i = 1; i < dashes.Count; i++)
            {
                closestWall = closestDashToMouse(closestWall, dashes[i]);
            }
            if (closestWall.to.Distance(Game.CursorPos) < dist)
            {
                return(closestWall);
            }
            return(null);
        }
Esempio n. 3
0
        public static List <Obj_AI_Base> canGoThrough(YasDash dash)
        {
            List <Obj_AI_Base> jumps     = ObjectManager.Get <Obj_AI_Base>().Where(enemy => enemyIsJumpable(enemy) && enemy.IsValidTarget(550, true, dash.to)).ToList();
            List <Obj_AI_Base> canBejump = new List <Obj_AI_Base>();

            foreach (var jumpe in jumps)
            {
                if (YasMath.interCir(dash.from.To2D(), dash.to.To2D(), jumpe.Position.To2D(), 35) /*&& jumpe.Distance(dash.to) < Player.Distance(dash.to)*/)
                {
                    canBejump.Add(jumpe);
                }
            }
            return(canBejump.OrderBy(jum => Player.Distance(jum)).ToList());
        }
Esempio n. 4
0
        public static void fleeToMouse()
        {
            try
            {
                stackQ();
                YasDash closeDash = getClosestDash();
                if (closeDash != null)
                {
                    List <Obj_AI_Base> jumps = canGoThrough(closeDash);
                    if (jumps.Count > 0 || ((W.IsReady() || (Yasuo.wall != null && (Yasuo.wall.endtime - Game.Time) > 3f))))
                    {
                        var distToDash = Player.Distance(closeDash.from);

                        if (W.IsReady() && distToDash < 136f && jumps.Count == 0 && NavMesh.LineOfSightTest(closeDash.to, closeDash.to) &&
                            MinionManager.GetMinions(Game.CursorPos, 350).Where(min => min.IsVisible).Count() < 2)
                        {
                            SmoothMouse.addMouseEvent(closeDash.to);
                            W.Cast(closeDash.to);
                        }

                        if (distToDash > 2f)
                        {
                            Player.IssueOrder(GameObjectOrder.MoveTo, closeDash.from);
                            return;
                        }

                        if (distToDash < 3f && jumps.Count > 0 && jumps.First().Distance(Player) <= 470)
                        {
                            SmoothMouse.addMouseEvent(jumps.First().Position);
                            E.Cast(jumps.First());
                        }
                        return;
                    }
                }
                if (getClosestDash(400) == null)
                {
                    Yasuo.gapCloseE(Game.CursorPos.To2D());
                }
                Player.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
Esempio n. 5
0
 public YasDash(YasDash dash)
 {
     from = dash.from;
     to   = dash.to;
 }
Esempio n. 6
0
 public static YasDash closestDashToMouse(YasDash w1, YasDash w2)
 {
     return(Vector3.DistanceSquared(w1.to, Game.CursorPos) + Vector3.DistanceSquared(w1.from, Player.Position) > Vector3.DistanceSquared(w2.to, Game.CursorPos) + Vector3.DistanceSquared(w2.from, Player.Position) ? w2 : w1);
 }
Esempio n. 7
0
 public YasDash(YasDash dash)
 {
     from = dash.from;
     to = dash.to;
 }
Esempio n. 8
0
 public static void saveLastDash()
 {
     if (lastDash.from.X != -1 && lastDash.from.Y != -1)
         dashes.Add(new YasDash(lastDash));
     lastDash = new YasDash();
 }
Esempio n. 9
0
 public static YasDash closestDashToMouse(YasDash w1, YasDash w2)
 {
     return Vector3.DistanceSquared(w1.to, Game.CursorPos) + Vector3.DistanceSquared(w1.from, Player.Position) > Vector3.DistanceSquared(w2.to, Game.CursorPos) + Vector3.DistanceSquared(w2.from, Player.Position) ? w2 : w1;
 }