public static bool wontHitOnDash(Skillshot ss, Obj_AI_Base jumpOn, Skillshot skillShot, Vector2 dashDir) { 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) && !YasMath.willColide(skillShot, Player.Position.To2D(), 700f + Player.MoveSpeed, dashDir, Player.BoundingRadius + skillShot.SpellData.Radius)) { 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.LSTo2D(), vec2.LSTo2D(), wall.pointL.Position.LSTo2D(), wall.pointR.Position.LSTo2D()); float wallW = (300 + 50 * W.Level); if (wall.pointL.Position.LSTo2D().LSDistance(inter) > wallW || wall.pointR.Position.LSTo2D().LSDistance(inter) > wallW) { return(false); } var dist = vec1.LSDistance(vec2); if (vec1.LSTo2D().LSDistance(inter) + vec2.LSTo2D().LSDistance(inter) - 30 > dist) { return(false); } return(true); }