Beispiel #1
0
        public int GetDangerValue(AIHeroClient hero = null)
        {
            hero = hero ?? Player.Instance;
            var skillshots = Skillshots.Where(c => _skillshotPolygonCache[c].IsInside(hero.Position)).ToArray();

            if (!skillshots.Any())
            {
                return(0);
            }

            var values = skillshots.Select(c => c.SpellData.DangerValue).OrderByDescending(t => t);

            return(values.Any() ? values.First() : 0);
        }
Beispiel #2
0
        public int GetTimeAvailable(AIHeroClient hero = null)
        {
            hero = hero ?? Player.Instance;
            var skillshots = Skillshots.Where(c => _skillshotPolygonCache[c].IsInside(hero.Position)).ToArray();

            if (!skillshots.Any())
            {
                return(short.MaxValue);
            }

            var times =
                skillshots.Select(c => c.GetAvailableTime(hero.ServerPosition.To2D()))
                .Where(t => t > 0)
                .OrderByDescending(t => t);

            return(times.Any() ? times.Last() : short.MaxValue);
        }