示例#1
0
        private static bool CanEvadeFromInterselectPointHead(ProjectilesInfo projectile)
        {
            var interselectPointRange = projectile.CurrentPoint.GetDistanceTo(projectile.EndPoint);

            var safeDistance = Tick.Self.Radius + projectile.Radius;
            var evadeVector  =
                new Vector(projectile.EndPoint) -
                new Vector(Tick.Self.GetPositionPoint());

            evadeVector.Negate();
            evadeVector.Normalize();
            evadeVector = safeDistance * evadeVector;
            var safePoint = projectile.EndPoint + evadeVector;

            //VisualClientHelper.Circle(safePoint.X,safePoint.Y, 5, 1,0,0);

            var distanceToEscape = Tick.Self.GetDistanceTo(safePoint.X, safePoint.Y);

            var wizardSpeed = 3 * UnitHelper.GetSpeedBonusFactorFromSkillsAndAuras();

            var projectilesToInterselectTicks = Math.Abs(interselectPointRange / projectile.Speed);
            var escapeTicks = Math.Abs(distanceToEscape / wizardSpeed);

            //DebugTrace.ConsoleWriteLite($"{projectilesToInterselectTicks.ToString("N3")} / {escapeTicks.ToString("N3")}");

            return(escapeTicks <= projectilesToInterselectTicks);
        }
示例#2
0
        private static bool CanEvadeFromInterselectPoint(ProjectilesInfo projectile, Point2D interselectPoint)
        {
            var interselectPointRange = projectile.CurrentPoint.GetDistanceTo(interselectPoint);
            var interselectMyRange    = Tick.Self.GetDistanceTo(interselectPoint.X, interselectPoint.Y);

            var distanceToEscape = Tick.Self.Radius + projectile.Radius - interselectMyRange;

            if (distanceToEscape < 0)
            {
                return(true);
            }

            var wizardSpeed = 3 * UnitHelper.GetSpeedBonusFactorFromSkillsAndAuras();

            var projectilesToInterselectTicks = Math.Abs(/*(int)*/ (interselectPointRange / projectile.Speed));
            var escapeTicks = Math.Abs(/*(int)*/ (distanceToEscape / wizardSpeed));

            //DebugTrace.ConsoleWriteLite($"{projectilesToInterselectTicks.ToString("N3")} / {escapeTicks.ToString("N3")}");

            return(escapeTicks <= projectilesToInterselectTicks);
        }