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); }
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); }