예제 #1
0
파일: CassR.cs 프로젝트: wx8829110/WUYANZZZ
        public override void Execute(Obj_AI_Hero target)
        {
            //Console.WriteLine(Delay);
            var bestPosFacing = GetBestPosition(HeroManager.Enemies.Where(item => item.IsFacingMe()));

            if (MinTargetsFacing <= bestPosFacing?.Item2)
            {
                Cast(bestPosFacing.Item1);
                return;
            }

            var bestPos = GetBestPosition(HeroManager.Enemies);

            if (bestPos?.Item2 >= MinTargetsNotFacing)
            {
                Cast(bestPos.Item1);
                return;
            }


            if (UltOnKillable && Provider.GetComboDamage(target) > target.Health && target.IsFacingMe() && target.HealthPercent > MinHealth && target.IsValidTarget() || PanicModeHealth > ObjectManager.Player.HealthPercent || BurstMode.IsActive())
            {
                var targetPos = CassW.GetMovementPrediction(target);
                if (targetPos.Distance(ObjectManager.Player.Position, true) < Range * Range)
                {
                    Cast(targetPos);
                }
            }
        }
예제 #2
0
        public override void Execute(Obj_AI_Hero target)
        {
            //Console.WriteLine(Delay);

            if (MinEnemiesOnlyInCombo)
            {
                TryMassUlt();
            }

            if (!target.IsValidTarget())
            {
                return;
            }

            if (UltOnKillable && Provider.GetComboDamage(target) > target.Health && target.IsFacingMe() && target.HealthPercent > MinHealth || PanicModeHealth > ObjectManager.Player.HealthPercent || BurstMode.IsActive())
            {
                var targetPos = CassW.GetMovementPrediction(target);
                if (targetPos.Distance(ObjectManager.Player.Position, true) < Range * Range)
                {
                    Cast(targetPos);
                }
            }
        }
예제 #3
0
파일: CassR.cs 프로젝트: wx8829110/WUYANZZZ
        public Tuple <Vector3, int> GetBestPosition(IEnumerable <Obj_AI_Base> targets)
        {
            var preds = Grouped(targets.Where(enemy => enemy.IsValidTarget(Range + enemy.MoveSpeed * Delay)).Select(item => CassW.GetMovementPrediction(item, Delay)).Where(pred =>
            {
                var dst = pred.Distance(ObjectManager.Player.Position, true);
                return(dst < Range * Range);
            }).ToArray());

            if (preds.Count > 0)
            {
                var final = new Vector3();
                for (var i = 0; i < preds.Count; i++)
                {
                    final.X += preds[i].X;
                    final.Y += preds[i].Y;
                }
                final.X /= preds.Count;
                final.Y /= preds.Count;
                return(new Tuple <Vector3, int>(final, preds.Count));
            }
            return(null);
        }