Ejemplo n.º 1
0
        public static PudgeSensorsData PartWalking(PudgeSensorsData data, PudgeClientLevel3 client, IEnumerable <Node> path, WorldInfo visited, WorldInfo killed)
        {
            foreach (var node in path)
            {
                visited.Check(data.WorldTime);
                killed.Check(data.WorldTime);
                data = client.GoTo(data, node.Location, visited, killed);
                if (data.IsDead)
                {
                    for (int i = 0; i < 1; i++)
                    {
                        data = client.Wait(PudgeRules.Current.PudgeRespawnTime);
                        visited.Check(data.WorldTime);
                        killed.Check(data.WorldTime);
                    }
                    return(data);
                }
            }
            var destination = path.Last().Location;

            visited.Add(destination);
            data = client.Wait(0.1);
            return(data);
        }
Ejemplo n.º 2
0
        public static PudgeSensorsData MoveByLine(this PudgeClientLevel3 client, PudgeSensorsData data, double distance, WorldInfo visited, WorldInfo killed)
        {
            double speed;

            if (data.Events.Select(x => x.Event).Contains(PudgeEvent.Hasted))
            {
                var hasteDuration = data.Events.Select(x => x).Where(x => x.Event == PudgeEvent.Hasted).First().Duration;
                if (hasteDuration > distance / 80)
                {
                    speed = 80;
                }
                else
                {
                    speed = distance / (hasteDuration + (distance - hasteDuration * 80) / 40);
                }
            }
            else
            {
                speed = 40;
            }

            var count = Math.Floor((distance / speed) * 4.5);
            var step  = distance / count;

            for (var i = 0; i < count; i++)
            {
                if (data.IsDead)
                {
                    break;
                }
                var check = CheckEnemy(data);
                if (check != "")
                {
                    if (!data.Events.Select(x => x.Event).Contains(PudgeEvent.HookCooldown))
                    {
                        if (check == "Slardar")
                        {
                            killed.Add(SlardarSpots.Where(x => Movement.ApproximatelyEqual(data.SelfLocation, x, 100)).Single());
                        }
                        data = HookEnemy(client, data);
                        break;
                    }
                }
                #region MaybeNextTime
                //if (CheckRune(data))
                //    if (!OnMove)
                //    {
                //        var loc = data.Map.Runes.First().Location;
                //        var min = Points.Select(x => Movement.GetDistance(x, data.SelfLocation)).Min();
                //        var toGo = Points.Where(x => Movement.GetDistance(x, data.SelfLocation) == min).First();
                //        OnMove = !OnMove;
                //        data = client.GoTo(data, toGo, visited);
                //        data = client.GoTo(data, loc, visited);
                //        visited.Add(loc);
                //        OnMove = !OnMove;
                //        break;
                //    }
                #endregion
                data = client.Move(step);
                visited.Check(data.WorldTime);
                killed.Check(data.WorldTime);
            }

            return(data);
        }