Example #1
0
 public bool goesThroughUnit(Obj_AI_Base unit)
 {
     if (YasMath.interact(Mis.Start.To2D(), Mis.End.To2D(), unit.Position.To2D(), unit.BoundingRadius + Mis.SData.LineWidth))
     {
         return(true);
     }
     return(false);
 }
Example #2
0
File: Yasuo.cs Project: betw01/detu
 public static bool missleWillHit(Obj_SpellMissile missle)
 {
     if (missle.Target.IsMe || YasMath.interCir(missle.StartPosition.To2D(), missle.EndPosition.To2D(), Player.Position.To2D(), missle.SData.LineWidth + Player.BoundingRadius))
     {
         if (missle.StartPosition.Distance(Player.Position) < (missle.StartPosition.Distance(missle.EndPosition)))
         {
             return(true);
         }
     }
     return(false);
 }
Example #3
0
File: Yasuo.cs Project: betw01/detu
        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());
        }
Example #4
0
File: Yasuo.cs Project: betw01/detu
        public static bool wontHitOnDash(Skillshot ss, Obj_AI_Base jumpOn)
        {
            float currentDashSpeed = 700 + Player.MoveSpeed;//At least has to be like this
            //Get intersection point
            Vector2 intersectionPoint = YasMath.LineIntersectionPoint(Player.Position.To2D(), V2E(Player.Position, jumpOn.Position, 475), ss.Start, ss.End);
            //Time when yasuo will be in intersection point
            float arrivingTime = Vector2.Distance(Player.Position.To2D(), intersectionPoint) / currentDashSpeed;
            //Estimated skillshot position
            Vector2 skillshotPosition = ss.GetMissilePosition((int)(arrivingTime * 1000));

            if (Vector2.DistanceSquared(skillshotPosition, intersectionPoint) <
                (ss.SpellData.Radius + Player.BoundingRadius))
            {
                return(false);
            }
            return(true);
        }
Example #5
0
File: Yasuo.cs Project: betw01/detu
        public static bool goesThroughWall(Vector3 vec1, Vector3 vec2)
        {
            if (wall.endtime < Game.Time || wall.pointL == null || wall.pointL == null)
            {
                return(false);
            }
            Vector2 inter = YasMath.LineIntersectionPoint(vec1.To2D(), vec2.To2D(), wall.pointL.Position.To2D(), wall.pointR.Position.To2D());
            float   wallW = (300 + 50 * W.Level);

            if (wall.pointL.Position.To2D().Distance(inter) > wallW ||
                wall.pointR.Position.To2D().Distance(inter) > wallW)
            {
                return(false);
            }
            var dist = vec1.Distance(vec2);

            if (vec1.To2D().Distance(inter) + vec2.To2D().Distance(inter) - 30 > dist)
            {
                return(false);
            }

            return(true);
        }
Example #6
0
File: Yasuo.cs Project: betw01/detu
        public static void doLaneClear(Obj_AI_Hero target)
        {
            List <Obj_AI_Base> minions = MinionManager.GetMinions(ObjectManager.Player.ServerPosition, 1000, MinionTypes.All, MinionTeam.NotAlly);

            if (YasuoSharp.Config.Item("useElc").GetValue <bool>() && E.IsReady())
            {
                foreach (var minion in minions.Where(minion => minion.IsValidTarget(E.Range) && enemyIsJumpable(minion)))
                {
                    if (minion.Health < Player.GetSpellDamage(minion, E.Slot) ||
                        Q.IsReady() && minion.Health < (Player.GetSpellDamage(minion, E.Slot) + Player.GetSpellDamage(minion, Q.Slot)))
                    {
                        if (useENormal(minion))
                        {
                            return;
                        }
                    }
                }
            }

            if (Q.IsReady() && YasuoSharp.Config.Item("useQlc").GetValue <bool>())
            {
                if (isQEmpovered() && !(target != null && Player.Distance(target) < 1050))
                {
                    if (canCastFarQ())
                    {
                        List <Vector2>             minionPs = YasMath.GetCastMinionsPredictedPositions(minions, getNewQSpeed(), 50f, 1200f, Player.ServerPosition, 900f, false, SkillshotType.SkillshotLine);
                        MinionManager.FarmLocation farm     = QEmp.GetLineFarmLocation(minionPs); //MinionManager.GetBestLineFarmLocation(minionPs, 50f, 900f);
                        if (farm.MinionsHit >= YasuoSharp.Config.Item("useEmpQHit").GetValue <Slider>().Value)
                        {
                            //Console.WriteLine("Cast q simp Emp");
                            QEmp.Cast(farm.Position, false);
                            return;
                        }
                    }
                    else
                    {
                        if (minions.Count(min => min.IsValid && !min.IsDead && min.Distance(getDashEndPos()) < QCir.Range) >= YasuoSharp.Config.Item("useEmpQHit").GetValue <Slider>().Value)
                        {
                            QCir.Cast(Player.Position, false);
                            Console.WriteLine("Cast q circ simp");
                        }
                    }
                }
                else
                {
                    if (!isDashigPro)
                    {
                        List <Vector2> minionPs = YasMath.GetCastMinionsPredictedPositions(minions, getNewQSpeed() * 0.3f, 30f, float.MaxValue, Player.ServerPosition, 465, false, SkillshotType.SkillshotLine);
                        Vector2        clos     = Geometry.Closest(Player.ServerPosition.To2D(), minionPs);
                        if (Player.Distance(clos) < 475)
                        {
                            Console.WriteLine("Cast q simp");

                            Q.Cast(clos, false);
                            return;
                        }
                    }
                    else
                    {
                        if (minions.Count(min => !min.IsDead && min.IsValid && min.Distance(getDashEndPos()) < QCir.Range) > 1)
                        {
                            QCir.Cast(Player.Position, false);
                            Console.WriteLine("Cast q circ simp");
                            return;
                        }
                    }
                }
            }
        }