Exemplo n.º 1
0
        private Obj_AI_Hero AutoPriority()
        {
            Obj_AI_Hero autopriority = null;
            var         prio         = 5;

            foreach (var target in
                     ObjectManager.Get <Obj_AI_Hero>()
                     .Where(target => target != null && target.IsValidTarget() && Geometry.Distance(target) <= _range))
            {
                var priority = FindPrioForTarget(target.ChampionName);
                if (autopriority == null)
                {
                    autopriority = target;
                    prio         = priority;
                }
                else
                {
                    if (priority < prio)
                    {
                        autopriority = target;
                        prio         = FindPrioForTarget(target.ChampionName);
                    }
                    else if (priority == prio)
                    {
                        if (!(target.Health < autopriority.Health))
                        {
                            continue;
                        }
                        autopriority = target;
                        prio         = priority;
                    }
                }
            }
            return(autopriority);
        }
Exemplo n.º 2
0
        public static bool notVisibleAndMostLieklyNotThere(Obj_AI_Base unit)
        {
            var distEneNex        = Geometry.Distance(ARAMSimulator.toNex.Position, unit.Position);
            var distEneNexDeepest = Geometry.Distance(ARAMSimulator.toNex.Position, ARAMSimulator.deepestAlly.Position);

            return(!ARAMSimulator.deepestAlly.IsDead && distEneNexDeepest + 1500 < distEneNex);
        }
Exemplo n.º 3
0
 private void Game_OnGameUpdate(EventArgs args)
 {
     if (Environment.TickCount > _lasttick + 100)
     {
         _lasttick = Environment.TickCount;
         if (!_update)
         {
             return;
         }
         if (_maintarget == null)
         {
             GetNormalTarget();
         }
         else
         {
             if (Geometry.Distance(_maintarget) > _range)
             {
                 GetNormalTarget();
             }
             else
             {
                 if (_maintarget.IsValidTarget())
                 {
                     Target = _maintarget;
                 }
                 else
                 {
                     GetNormalTarget();
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
        public static int balanceAroundPointAdvanced(Vector2 point, float rangePlus, int fearCompansate = 0)
        {
            int balance = (point.To3D().UnderTurret(true)) ? -80 : (point.To3D().UnderTurret(false)) ? 110 : 0;

            foreach (var ene in enemy_champions)
            {
                var eneBalance = 0;
                var reach      = ene.reach + rangePlus;
                if (!ene.hero.IsDead && ene.hero.Distance(point, true) < reach * reach && !unitIsUseless(ene.hero) && !notVisibleAndMostLieklyNotThere(ene.hero))
                {
                    eneBalance -= (int)((ene.hero.HealthPercent + 20 - ene.hero.Deaths * 4 + ene.hero.ChampionsKilled * 4));
                    if (!ene.hero.IsFacing(ObjectManager.Player))
                    {
                        eneBalance = (int)(eneBalance * 0.64f);
                    }
                    var focus = ene.getFocusTarget();
                    if (focus != null && focus.IsValid && focus.IsAlly && focus is Obj_AI_Hero)
                    {
                        eneBalance = (int)(eneBalance * (focus.IsMe?1.20:0.80));
                    }
                    eneBalance += getMinionImpactOnHero(ene);
                }
                balance += eneBalance;
                balance -= getMinionImpactOnHero(myControler);
            }


            foreach (var aly in ally_champions)
            {
                var reach = (aly.reach - 200 < 500)?500:(aly.reach - 200);
                if (!aly.hero.IsDead && /*aly.hero.Distance(point, true) < reach * reach &&*/
                    (Geometry.Distance(aly.hero, ARAMSimulator.toNex.Position) + reach < (Geometry.Distance(point, ARAMSimulator.toNex.Position) + fearDistance + fearCompansate + (ARAMSimulator.tankBal * -5) + (ARAMSimulator.agrobalance * 3))))
                {
                    balance += ((int)aly.hero.HealthPercent + 20 + 20 - aly.hero.Deaths * 4 + aly.hero.ChampionsKilled * 4);
                }
            }
            var myBal = ((int)myControler.hero.HealthPercent + 20 + 20 - myControler.hero.Deaths * 4 +
                         myControler.hero.ChampionsKilled * 4) + myControler.hero.Assists / 2 + myControler.bonusSpellBalance();

            balance += (myBal < 0)?10:myBal;
            return(balance);
        }
Exemplo n.º 5
0
        private void GetNormalTarget()
        {
            Obj_AI_Hero newtarget = null;

            if (_mode != TargetingMode.AutoPriority)
            {
                foreach (var target in
                         ObjectManager.Get <Obj_AI_Hero>()
                         .Where(target => target.IsValidTarget() && Geometry.Distance(target) <= _range))
                {
                    if (newtarget == null)
                    {
                        newtarget = target;
                    }
                    else
                    {
                        switch (_mode)
                        {
                        case TargetingMode.LowHP:
                            if (target.Health < newtarget.Health)
                            {
                                newtarget = target;
                            }
                            break;

                        case TargetingMode.MostAD:
                            if (target.BaseAttackDamage + target.FlatPhysicalDamageMod <
                                newtarget.BaseAttackDamage + newtarget.FlatPhysicalDamageMod)
                            {
                                newtarget = target;
                            }
                            break;

                        case TargetingMode.MostAP:
                            if (target.FlatMagicDamageMod < newtarget.FlatMagicDamageMod)
                            {
                                newtarget = target;
                            }
                            break;

                        case TargetingMode.Closest:
                            if (Geometry.Distance(target) < Geometry.Distance(newtarget))
                            {
                                newtarget = target;
                            }
                            break;

                        case TargetingMode.NearMouse:
                            if (SharpDX.Vector2.Distance(Game.CursorPos.To2D(), target.Position.To2D()) + 50 <
                                SharpDX.Vector2.Distance(Game.CursorPos.To2D(), newtarget.Position.To2D()))
                            {
                                newtarget = target;
                            }
                            break;

                        case TargetingMode.LessAttack:
                            if ((target.Health -
                                 ObjectManager.Player.CalcDamage(target, Damage.DamageType.Physical, target.Health) <
                                 (newtarget.Health -
                                  ObjectManager.Player.CalcDamage(
                                      newtarget, Damage.DamageType.Physical, newtarget.Health))))
                            {
                                newtarget = target;
                            }
                            break;

                        case TargetingMode.LessCast:
                            if ((target.Health -
                                 ObjectManager.Player.CalcDamage(target, Damage.DamageType.Magical, target.Health) <
                                 (newtarget.Health -
                                  ObjectManager.Player.CalcDamage(
                                      newtarget, Damage.DamageType.Magical, newtarget.Health))))
                            {
                                newtarget = target;
                            }
                            break;
                        }
                    }
                }
            }
            else
            {
                newtarget = AutoPriority();
            }
            Target = newtarget;
        }