Exemple #1
0
        public Tuple <int, List <AIHeroClient> > GetHits(SpellBase spell)
        {
            var hits  = new List <AIHeroClient>();
            var range = spell.Range * spell.Range;

            foreach (var enemy in ObjectManager.Get <AIHeroClient>().Where(h => h.IsValidTarget() && BallManager.BallPosition.Distance(h.ServerPosition, true) < range))
            {
                if (spell.WillHit(enemy, BallManager.BallPosition) && BallManager.BallPosition.Distance(enemy.ServerPosition, true) < spell.Width() * spell.Width())
                {
                    hits.Add(enemy);
                }
            }
            return(new Tuple <int, List <AIHeroClient> >(hits.Count, hits));
        }