Beispiel #1
0
        public static float GetKSDamage(this Obj_AI_Base target, bool gapcloseE = false)
        {
            var q = SpellManager.Q.IsReady() && SpellManager.Q.IsActive(true);
            var w = SpellManager.W.IsReady() && SpellManager.W.IsActive(true);
            var e = !gapcloseE && SpellManager.E.IsReady() && SpellManager.E.IsActive(true);
            var r = SpellManager.R.IsReady() && SpellManager.R.IsActive(true);

            return(target.GetComboDamage(q, w, e, r, true));
        }
Beispiel #2
0
 public static DamageResult GetBestComboR(this Obj_AI_Base target)
 {
     if (target.IsValidTarget())
     {
         float  cd       = Combo.Menu.GetSliderValue("Cooldown");
         var    qcd      = SpellSlot.Q.GetSpellDataInst().Cooldown;
         var    wcd      = SpellSlot.W.GetSpellDataInst().Cooldown;
         var    ecd      = SpellSlot.E.GetSpellDataInst().Cooldown;
         var    q1       = (SpellSlot.Q.IsReady() || qcd < cd);
         var    w1       = (SpellSlot.W.IsReady() || wcd < cd);
         var    e1       = (SpellSlot.E.IsReady() || ecd < cd);
         var    qArray   = q1 ? new[] { false, true } : new[] { false };
         var    wArray   = w1 ? new[] { false, true } : new[] { false };
         var    eArray   = e1 ? new[] { false, true } : new[] { false };
         float  bestdmg  = -1;
         float  bestmana = 0;
         bool[] best     = { false, false, false };
         if (q1 || w1 || e1)
         {
             foreach (var qBool in qArray)
             {
                 foreach (var wBool in wArray)
                 {
                     foreach (var eBool in eArray)
                     {
                         var damageI2 = target.GetComboDamage(qBool, wBool, eBool, false);
                         var d        = damageI2.Damage;
                         var m        = damageI2.Mana;
                         if (Util.MyHero.Mana >= m && d >= target.TotalShieldHealth())
                         {
                             if (d < bestdmg || Math.Abs(bestdmg - (-1f)) < float.Epsilon)
                             {
                                 bestdmg  = d;
                                 bestmana = m;
                                 best     = new[] { q1, w1, e1, false };
                             }
                         }
                     }
                 }
             }
         }
         return(new DamageResult(target, bestdmg, bestmana, best[0], best[1], best[2], false, 0));
     }
     return(new DamageResult(target, 0, 0, false, false, false, false, 0));
 }
Beispiel #3
0
 public static DamageResult GetBestComboR(this Obj_AI_Base target)
 {
     if (target.IsValidTarget())
     {
         float  cd       = Combo.Menu.GetSliderValue("Cooldown");
         float  qcd      = SpellSlot.Q.GetSpellDataInst().Cooldown;
         float  wcd      = SpellSlot.W.GetSpellDataInst().Cooldown;
         float  ecd      = SpellSlot.E.GetSpellDataInst().Cooldown;
         bool   q1       = (SpellSlot.Q.IsReady() || qcd < cd);
         bool   w1       = (SpellSlot.W.IsReady() || wcd < cd);
         bool   e1       = (SpellSlot.E.IsReady() || ecd < cd);
         bool[] q_array  = (SpellSlot.Q.IsReady() || qcd < cd) ? new bool[] { false, true } : new bool[] { false };
         bool[] w_array  = (SpellSlot.W.IsReady() || wcd < cd) ? new bool[] { false, true } : new bool[] { false };
         bool[] e_array  = (SpellSlot.E.IsReady() || ecd < cd) ? new bool[] { false, true } : new bool[] { false };
         float  bestdmg  = -1;
         float  bestmana = 0;
         bool[] best     = new bool[] { false, false, false };
         if (q1 || w1 || e1)
         {
             foreach (bool q_bool in q_array)
             {
                 foreach (bool w_bool in w_array)
                 {
                     foreach (bool e_bool in e_array)
                     {
                         DamageResult damageI2 = target.GetComboDamage(q_bool, w_bool, e_bool, false);
                         float        d        = damageI2.Damage;
                         float        m        = damageI2.Mana;
                         if (Util.MyHero.Mana >= m && d >= target.Health)
                         {
                             if (d < bestdmg || bestdmg == -1)
                             {
                                 bestdmg  = d;
                                 bestmana = m;
                                 best     = new bool[] { q1, w1, e1, false };
                             }
                         }
                     }
                 }
             }
         }
         return(new DamageResult(target, bestdmg, bestmana, best[0], best[1], best[2], false, 0));
     }
     return(new DamageResult(target, 0, 0, false, false, false, false, 0));
 }
Beispiel #4
0
        public static DamageResult GetBestCombo(this Obj_AI_Base target)
        {
            var q = new[] { true };
            var w = SpellSlot.W.IsReady() ? new[] { false, true } : new[] { false };
            var e = SpellSlot.E.IsReady() ? new[] { false, true } : new[] { false };
            var r = SpellSlot.R.IsReady() ? new[] { false, true } : new[] { false };

            if (target != null)
            {
                DamageResult damageI2;
                if (PredictedDamage.ContainsKey(target.NetworkId))
                {
                    var damageI = PredictedDamage[target.NetworkId];
                    if (Game.Time - damageI.Time <= RefreshTime)
                    {
                        return(PredictedDamage[target.NetworkId]);
                    }
                    bool[] best     = { false, false, false, false };
                    var    bestdmg  = 0f;
                    var    bestmana = 0f;
                    foreach (var r1 in r)
                    {
                        foreach (var q1 in q)
                        {
                            foreach (var w1 in w)
                            {
                                foreach (var e1 in e)
                                {
                                    damageI2 = target.GetComboDamage(q1, w1, e1, r1);
                                    var d = damageI2.Damage;
                                    var m = damageI2.Mana;
                                    if (Util.MyHero.Mana >= m)
                                    {
                                        if (bestdmg >= target.TotalShieldHealth())
                                        {
                                            if (d >= target.TotalShieldHealth() && (d < bestdmg || m < bestmana))
                                            {
                                                bestdmg  = d;
                                                bestmana = m;
                                                best     = new[] { q1, w1, e1, r1 };
                                            }
                                        }
                                        else
                                        {
                                            if (d >= bestdmg)
                                            {
                                                bestdmg  = d;
                                                bestmana = m;
                                                best     = new[] { q1, w1, e1, r1 };
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    PredictedDamage[target.NetworkId] = new DamageResult(target, bestdmg, bestmana, best[0], best[1],
                                                                         best[2], best[3], Game.Time);
                    return(PredictedDamage[target.NetworkId]);
                }
                damageI2 = target.GetComboDamage(SpellSlot.Q.IsReady(), SpellSlot.W.IsReady(), SpellSlot.E.IsReady(), SpellSlot.R.IsReady());
                PredictedDamage[target.NetworkId] = new DamageResult(target, damageI2.Damage, damageI2.Mana, false,
                                                                     false, false, false, Game.Time - (Game.Ping * 2f) / 2000f);
                return(target.GetBestCombo());
            }
            return(new DamageResult(null, 0, 0, false, false, false, false, 0));
        }
 public static float GetComboDamage(Obj_AI_Base unit)
 {
     return unit.GetComboDamage(
         SpellManager.Q.IsReady(), SpellManager.W.IsReady(), SpellManager.E.IsReady(), IsRReady(), true, true);
 }
Beispiel #6
0
 public static float GetComboDamage(Obj_AI_Base unit)
 {
     return(unit.GetComboDamage(
                SpellManager.Q.IsReady(), SpellManager.W.IsReady(), SpellManager.E.IsReady(), IsRReady(), true, true));
 }
Beispiel #7
0
        public static DamageResult GetBestCombo(this Obj_AI_Base target)
        {
            var q = SpellSlot.Q.IsReady() ? new bool[] { false, true } : new bool[] { false };
            var w = SpellSlot.W.IsReady() ? new bool[] { false, true } : new bool[] { false };
            var e = SpellSlot.E.IsReady() ? new bool[] { false, true } : new bool[] { false };
            var r = SpellSlot.R.IsReady() ? new bool[] { false, true } : new bool[] { false };

            if (target.IsValidTarget())
            {
                if (PredictedDamage.ContainsKey(target.NetworkId))
                {
                    var damageI = PredictedDamage[target.NetworkId];
                    if (Game.Time - damageI.Time <= RefreshTime)
                    {
                        return(PredictedDamage[target.NetworkId]);
                    }
                    else
                    {
                        bool[] best = new bool[] {
                            SpellSlot.Q.IsReady(),
                               SpellSlot.W.IsReady(),
                               SpellSlot.E.IsReady(),
                               SpellSlot.R.IsReady()
                        };
                        var bestdmg  = 0f;
                        var bestmana = 0f;
                        foreach (bool r1 in r)
                        {
                            foreach (bool q1 in q)
                            {
                                foreach (bool w1 in w)
                                {
                                    foreach (bool e1 in e)
                                    {
                                        DamageResult damageI2 = target.GetComboDamage(q1, w1, e1, r1);
                                        float        d        = damageI2.Damage;
                                        float        m        = damageI2.Mana;
                                        if (Util.MyHero.Mana >= m)
                                        {
                                            if (bestdmg >= target.Health)
                                            {
                                                if (d >= target.Health && (d < bestdmg || m < bestmana))
                                                {
                                                    bestdmg  = d;
                                                    bestmana = m;
                                                    best     = new bool[] { q1, w1, e1, r1 };
                                                }
                                            }
                                            else
                                            {
                                                if (d >= bestdmg)
                                                {
                                                    bestdmg  = d;
                                                    bestmana = m;
                                                    best     = new bool[] { q1, w1, e1, r1 };
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        PredictedDamage[target.NetworkId] = new DamageResult(target, bestdmg, bestmana, best[0], best[1], best[2], best[3], Game.Time);
                        return(PredictedDamage[target.NetworkId]);
                    }
                }
                else
                {
                    var damageI2 = target.GetComboDamage(SpellSlot.Q.IsReady(), SpellSlot.W.IsReady(), SpellSlot.R.IsReady(), SpellSlot.R.IsReady());
                    PredictedDamage[target.NetworkId] = new DamageResult(target, damageI2.Damage, damageI2.Mana, false, false, false, false, Game.Time - (Game.Ping * 2) / 2000);
                    return(target.GetBestCombo());
                }
            }
            return(new DamageResult(target, 0, 0, false, false, false, false, 0));
        }