Пример #1
0
        public bool ShouldWaitForMinion(float delay)
        {
            var minionListAA = ObjectManager.Get <Obj_AI_Minion>().Where(minion => minion.IsValidTarget() &&
                                                                         minion.Team != GameObjectTeam.Neutral && Orbwalking.InAutoAttackRange(minion) && MinionManager.IsMinion(minion, false));

            var minionsAlly = ObjectManager.Get <Obj_AI_Minion>().Where(minion => !minion.IsDead &&
                                                                        minion.IsAlly && minion.Distance(Player) < 600 && MinionManager.IsMinion(minion, false));

            int countAlly = minionsAlly.Count();

            if (minionListAA.Count() == 1 && countAlly > 3 && minionListAA.Any(x => x.Health < Player.TotalAttackDamage * 2))
            {
                return(true);
            }

            if (countAlly > 2 && minionListAA.Any(x => x.IsMoving && x.Health < Player.TotalAttackDamage * 2))
            {
                return(true);
            }

            var   t = (int)(Player.AttackCastDelay * 1000) - 20 + 1000 * (int)Math.Max(0, 500) / (int)Orbwalking.GetMyProjectileSpeed();
            float laneClearDelay = delay * 1000 + t;

            return
                (ObjectManager.Get <Obj_AI_Minion>()
                 .Any(
                     minion =>
                     minion.IsValidTarget() && minion.Team != GameObjectTeam.Neutral &&
                     Orbwalking.InAutoAttackRange(minion) && MinionManager.IsMinion(minion, false) &&
                     HealthPrediction.LaneClearHealthPrediction(minion, (int)(laneClearDelay), 0) <= Player.GetAutoAttackDamage(minion)));
        }