Beispiel #1
0
 internal static void HandleLogic()
 {
     if (Variables.spells[SpellSlot.E].IsEnabledAndReady())
     {
         var eTarget = TargetSelector.GetTarget(TristanaUtility.GetERRange(), TargetSelector.DamageType.Physical);
         if ((eTarget.IsValidTarget() && MenuExtensions.GetItemValue <bool>($"iseriesr.tristana.combo.eon.{eTarget.ChampionName.ToLower()}")) ||
             PositioningVariables.EnemiesClose.Count() == 1)
         {
             Variables.spells[SpellSlot.E].Cast(eTarget);
         }
     }
 }
Beispiel #2
0
        internal static void HandleLogic()
        {
            if (Variables.spells[SpellSlot.R].IsEnabledAndReady())
            {
                var selectedTarget = TargetSelector.GetTarget(
                    TristanaUtility.GetERRange(), TargetSelector.DamageType.Physical);
                if (selectedTarget.IsValidTarget())
                {
                    var selectedTargetHealth = HealthPrediction.GetHealthPrediction(
                        selectedTarget,
                        (int)
                        (250 + Game.Ping / 2f + ObjectManager.Player.Distance(selectedTarget.ServerPosition) / 2000f));
                    if (selectedTargetHealth > 0 && selectedTargetHealth < TristanaUtility.GetRDamage(selectedTarget))
                    {
                        Variables.spells[SpellSlot.R].Cast(selectedTarget);
                        return;
                    }

                    var enemiesClose =
                        ObjectManager.Player.GetEnemiesInRange(250f).Where(m => m.IsValidTarget()).OrderBy(m => m.Distance(ObjectManager.Player)).ThenByDescending(m => m.GetComboDamage(ObjectManager.Player, new List <SpellSlot> {
                        SpellSlot.Q, SpellSlot.W, SpellSlot.E, SpellSlot.R
                    }));

                    var firstEnemy = enemiesClose.FirstOrDefault();

                    //There are enemies
                    //Sort them by combo damage to us
                    //If we are low health and they have a lot of health
                    //And they are not killable with R and 4 AA
                    //Repel them away with R

                    if (firstEnemy != null &&
                        firstEnemy.Health > ObjectManager.Player.Health * 2.0f &&
                        ObjectManager.Player.HealthPercent < 8 &&
                        !(firstEnemy.Health + 5 < TristanaUtility.GetRDamage(selectedTarget) + ObjectManager.Player.GetAutoAttackDamage(firstEnemy) * 4))
                    {
                        Variables.spells[SpellSlot.R].Cast(firstEnemy);
                    }
                }
            }
        }