Ejemplo n.º 1
0
        public void startAttack(Camp.JungleMinion minion, bool smite)
        {
            usePots();
            getDPS(minion.unit);

            if (minion == null || !minion.unit.IsValid || !minion.unit.IsVisible)
            {
                return;
            }
            if ((smite || player.Health / player.MaxHealth < 0.14f) && minion.smiteBuff != Camp.JungleMinion.SmiteBuff.None)
            {
                if (HypaJungle.Config.Item("smiteToKill").GetValue <bool>())
                {
                    if (player.GetSummonerSpellDamage(minion.unit, Damage.SummonerSpell.Smite) >= minion.unit.Health)
                    {
                        doSmite(minion.unit);
                    }
                }
                else
                {
                    //if (minion.Health / getDPS(minion) > ((!HypaJungle.jTimer.jungleCamps.Where(cp => cp.isBuff).Any()) ? 8 : 5) * (player.Health / player.MaxHealth) || (JungleClearer.focusedCamp.isBuff && minion.MaxHealth >= 1400))
                    if (minion.unit.Health > getSmiteDmg() * 0.70f)
                    {
                        doSmite(minion.unit);
                    }
                }
            }
            attackMinion(minion.unit, smite);
        }
Ejemplo n.º 2
0
        public override float getTimeToDoDmgAoe(Camp.JungleMinion camp, float damageToDo, float cdResetTime)
        {
            //    Console.WriteLine("AS: " + player.AttackSpeedMod + " asbase " + player.AttackDelay);
            //Qdmg can deal
            var qDmg = camp.UpdatedStats.physicGoesThrough * (getSpellDmgRaw(SpellSlot.E));
            //  Console.WriteLine("Qdmg: " + qDmg + " raw: " + getSpellDmgRaw(SpellSlot.Q));
            var tillNext = ((Edata.Cooldown == 0) ? 18 : Edata.Cooldown);
            // Console.WriteLine("Ŗeal q cd: " + tillNext);


            var   castTimes      = 0;
            var   cdLeft         = (Edata.CooldownExpires - Game.Time - cdResetTime > 0) ? Edata.CooldownExpires - Game.Time - cdResetTime : 0;
            int   aproxCastTimes = (int)(damageToDo / (qDmg));
            float aproxTime      = aproxCastTimes * tillNext;

            //GotNoFrogBuff
            if (timeTillFrogBuffEnd() <= cdResetTime || timeTillFrogBuffEnd() == 0 || aproxCastTimes == 0)
            {
                // Console.WriteLine("aaprox: " + Qdata.Cooldown);
                return(aproxTime * aproxCastTimes + cdLeft);
            }
            float buffDmg  = getFrogBuffAoe(cdResetTime, aproxTime);
            float buffQdmg = (qDmg + tillNext * buffDmg);

            //With frog
            castTimes = (int)((damageToDo - cdLeft * buffDmg) / (buffQdmg));
            float bonusTime = 0;

            bonusTime += ((damageToDo - cdLeft * buffDmg) + tillNext * buffDmg - (castTimes) * buffQdmg) / buffDmg;
            return(castTimes * tillNext + cdLeft + bonusTime);
        }
Ejemplo n.º 3
0
        public static void attackCampMinions()
        {
            if (focusedCamp == null || focusedCamp.Minions == null)
            {
                return;
            }

            getJungleMinionsManualy();
            if (!jungler.gotOverTime || !HypaJungle.Config.Item("getOverTime").GetValue <bool>() || !focusedCamp.useOverTime)
            {
                Camp.JungleMinion campMinions =
                    focusedCamp.Minions.Where(min => min != null && min.unit != null && min.unit is Obj_AI_Minion && !min.unit.IsDead && min.unit.IsVisible)
                    .OrderByDescending(min => (min.unit).MaxHealth).FirstOrDefault();
                if (campMinions.unit is Obj_AI_Minion)
                {
                    jungler.startAttack(campMinions, focusedCamp.canSmite());
                }
            }
            else
            {
                Camp.JungleMinion campMinions =
                    focusedCamp.Minions.Where(min => min != null && min.unit != null && min.unit is Obj_AI_Minion && !min.unit.IsDead && min.unit.IsVisible)
                    .OrderBy(min => minHasOvertime(((Obj_AI_Minion)min.unit))).ThenByDescending(min => (min.unit).MaxHealth)
                    .FirstOrDefault();
                // .OrderByDescending(min => ((Obj_AI_Minion)min.Unit).MaxHealth).First();

                if (campMinions.unit is Obj_AI_Minion)
                {
                    jungler.startAttack(campMinions, focusedCamp.canSmite());
                }
            }
        }
Ejemplo n.º 4
0
        public override float getTimeToDoDmg(Camp.JungleMinion camp, float damageToDo, float cdResetTime)
        {
            float damage = 0;
            //Qdmg can deal
            var qDmg     = camp.UpdatedStats.physicGoesThrough * (getSpellDmgRaw(SpellSlot.Q));
            var tillNext = ((Qdata.Cooldown == 0) ? 10 : Qdata.Cooldown);
            var qDps     = qDmg / tillNext;
            // Console.WriteLine(qDmg);

            float aaDps    = camp.UpdatedStats.physicGoesThrough * (player.BaseAttackDamage + player.FlatPhysicalDamageMod) * getAAperSecond();
            float timeSkip = 0;

            if (Q.IsReady((int)(cdResetTime * 1000)))
            {
                damage   += qDmg;
                timeSkip += tillNext;
            }

            damage += (player.BaseAttackDamage + player.FlatPhysicalDamageMod);
            if (damage >= damageToDo)
            {
                return(1);
            }

            float time = (damageToDo - damage) / (aaDps + getItemPassiveBoostDps());

            float timeWithRed = (damageToDo - damage + timeSkip * qDps) /
                                (aaDps + qDps + getItemPassiveBoostDps() + getRedBuffDmg(cdResetTime, time));

            return(timeWithRed);
        }
Ejemplo n.º 5
0
        public override float getTimeToDoDmgAoe(Camp.JungleMinion camp, float damageToDo, float cdResetTime)
        {
            var bufDmg = getFrogBuffAoe(cdResetTime, 1);

            if (bufDmg == 0)
            {
                return(0.1f);
            }
            return(damageToDo / bufDmg);
        }
Ejemplo n.º 6
0
        public override float getAoeDmgDoneInTime(Camp.JungleMinion camp, float time, float cdResetTime)
        {
            float damage = 0;

            //Qdmg can deal
            var qDmg     = camp.UpdatedStats.physicGoesThrough * (getSpellDmgRaw(SpellSlot.E));
            var tillNext = ((Edata.Cooldown == 0) ? 18 : Edata.Cooldown);

            if (E.IsReady((int)(cdResetTime * 1000)))
            {
                damage += qDmg;
            }
            int qCastsMore = (int)(time / tillNext);

            damage += qDmg * qCastsMore;

            return(damage);
        }
Ejemplo n.º 7
0
        public override float getAoeDmgDoneInTime(Camp.JungleMinion camp, float time, float cdResetTime)
        {
            float damage = 0;

            //Qdmg can deal
            var qDmg     = camp.UpdatedStats.physicGoesThrough * (getQdmg() + 50 + 25 * Q.Level);
            var tillNext = ((Qdata.Cooldown == 0) ? 18 : Qdata.Cooldown) / (1 + getAAperSecond());

            if (Q.IsReady((int)(cdResetTime * 1000)))
            {
                damage += qDmg;
            }
            int qCastsMore = (int)(time / tillNext);

            damage += qDmg * qCastsMore;

            return(damage);
        }
Ejemplo n.º 8
0
        public override float getDmgDoneInTime(Camp.JungleMinion camp, float time, float cdResetTime)
        {
            float damage = 0;
            //Qdmg can deal
            var qDmg = camp.UpdatedStats.physicGoesThrough * (getQdmg() + 50 + 25 * Q.Level);
            // Console.WriteLine(qDmg);
            var tillNext = ((Qdata.Cooldown == 0) ? 18 : Qdata.Cooldown) / (1 + getAAperSecond());

            if (Q.IsReady((int)(cdResetTime * 1000)))
            {
                damage += qDmg;
            }
            int qCastsMore = (int)(time / tillNext);

            damage += qDmg * qCastsMore;

            //AutoAttacks
            float timeForaa   = player.AttackSpeedMod / 1.1f;
            int   aaCastsMore = (int)(time / timeForaa);

            damage += camp.UpdatedStats.physicGoesThrough * (player.BaseAttackDamage + player.FlatPhysicalDamageMod) * aaCastsMore;

            return(damage + time * getItemPassiveBoostDps());
        }
Ejemplo n.º 9
0
 public abstract float getTimeToDoDmg(Camp.JungleMinion camp, float damageToDo, float cdResetTime);
Ejemplo n.º 10
0
 //  public abstract float getDmgDoneInTime(Camp.JungleMinion camp, float time, float cdResetTime);
 public abstract float getAoeDmgDoneInTime(Camp.JungleMinion camp, float time, float cdResetTime);
Ejemplo n.º 11
0
        /*  private void Fight(Camp campFighting)
         * {
         *    Camp.JungleMinion minHpMin = campFighting.Minions.OrderBy(cp => cp.UpdatedStats.health).First();
         *    Camp.JungleMinion maxHpMin = campFighting.Minions.OrderByDescending(cp => cp.UpdatedStats.health).First();
         *
         *    Console.WriteLine("Minion count: " + maxHpMin.UpdatedStats.health);
         *
         *    float heroAoeDps = heroFigher.getSkillAoePerSec();
         *    float heroDps = heroFigher.getDPS(campFighting);
         *
         *    Console.WriteLine("Hero dps:" + heroDps);
         *
         *    float timeToKIllMin = heroFigher.getTimeToDoDmgAoe(minHpMin, minHpMin.UpdatedStats.health, (campFighting.timeToCamp - 3) < 0 ? 0 : campFighting.timeToCamp - 3);
         *    float timeToKIllMax = heroFigher.getTimeToDoDmg(maxHpMin, maxHpMin.UpdatedStats.health, (campFighting.timeToCamp - 3) < 0 ? 0 : campFighting.timeToCamp - 3);
         *
         *    float fullCampDps = campFighting.Minions.Sum(min => min.getDps());
         *
         *    float fullDmgDoneToMe = 0;
         *
         *    float timeToFinish = 0;
         *
         *    //Much aoe
         *    if (timeToKIllMin < timeToKIllMax)
         *    {
         *        Console.WriteLine("Aeo better");
         *        fullDmgDoneToMe += timeToKIllMin*fullCampDps;
         *        float restTimeToKill = timeToKIllMax - timeToKIllMin;
         *        fullDmgDoneToMe += restTimeToKill * maxHpMin.getDps() * heroFigher.getKrugBuffDmgRemove(campFighting.timeToCamp, timeToKIllMax);
         *        timeToFinish += timeToKIllMin+restTimeToKill;
         *    }
         *    else
         *    {
         *        Console.WriteLine("Single dps better: " + maxHpMin.UpdatedStats.health);
         *        fullDmgDoneToMe += timeToKIllMax * fullCampDps;
         *        float dmgDoneAor = timeToKIllMax*heroAoeDps;
         *        float leftMin = campFighting.Minions.Count - 1;
         *        float leftMinHp = leftMin * (minHpMin.UpdatedStats.health - dmgDoneAor);
         *
         *        float tmeToFinish = leftMinHp/(heroAoeDps + heroDps);
         *        timeToFinish = tmeToFinish + timeToKIllMax;
         *        fullDmgDoneToMe += minHpMin.getDps()*2;
         *    }
         *
         *    Console.WriteLine("TimeTOfinish: " + timeToFinish);
         *    float myHpTillThere = heroFigher.getFulHeal((campFighting.timeToCamp - 3) < 0 ? 0 : campFighting.timeToCamp - 3, timeToFinish) + Jungler.player.Health;
         *
         *    float relDmgToMe = heroFigher.realPhysDmgDoneToMe(fullDmgDoneToMe);
         *
         *    Console.WriteLine("HpLeft: " + (myHpTillThere-relDmgToMe));
         *
         * }*/

        public bool AroundFight(Camp campFighting, bool smite = false, bool aoeSmite = false, bool smiteIfNeedTo = false)
        {
            Camp.JungleMinion minHpMin = campFighting.Minions.OrderBy(cp => cp.UpdatedStats.health).First();
            Camp.JungleMinion maxHpMin = campFighting.Minions.OrderByDescending(cp => cp.UpdatedStats.health).First();
            smite = getSmiteCd(campFighting.timeToCamp) == 0 && smite;
            // Console.WriteLine("Smite: " + smite + " dmg: " + heroFigher.getSmiteDmg());
            float maxMinHp = maxHpMin.UpdatedStats.health - ((smite) ? (heroFigher.getSmiteDmg() / 2) : 0);;
            float minMinHp = minHpMin.UpdatedStats.health - ((smite && aoeSmite)?(heroFigher.getSmiteDmg() / 2):0);

            //Console.WriteLine("Fighting: " + campFighting.ToString());

            float timeToKillMin = heroFigher.getTimeToDoDmgAoe(minHpMin, minMinHp, (campFighting.timeToCamp - 3) < 0 ? 0 : campFighting.timeToCamp - 3);
            float timeToKillMax = heroFigher.getTimeToDoDmg(maxHpMin, maxMinHp, (campFighting.timeToCamp - 3) < 0 ? 0 : campFighting.timeToCamp - 3);

            float fullCampDps = campFighting.Minions.Sum(min => min.getDps());

            float fullDmgDoneToMe = 0;

            float timeToKillCamp = 0;

            // Console.WriteLine("timeToKillMin " + timeToKillMin);
            //Console.WriteLine("timeToKillMax " + timeToKillMax);


            if (campFighting.aliveMinCount() == 1)
            {
                timeToKillCamp  = timeToKillMax;
                fullDmgDoneToMe = maxHpMin.getDps() *
                                  heroFigher.getKrugBuffDmgRemove(campFighting.timeToCamp, timeToKillMax);
            }
            else
            {
                //Good aoe
                if (timeToKillMin < timeToKillMax)
                {
                    // Console.WriteLine("Aeo better: " + timeToKillMin);
                    float restTimeToKill = timeToKillMax - timeToKillMin;
                    fullDmgDoneToMe += fullCampDps * timeToKillMin;

                    fullDmgDoneToMe += restTimeToKill * maxHpMin.getDps() * heroFigher.getKrugBuffDmgRemove(campFighting.timeToCamp, timeToKillMax);
                    timeToKillCamp   = restTimeToKill + timeToKillMin;
                }
                else
                {
                    fullDmgDoneToMe += timeToKillMax * fullCampDps;
                    float dmgDoneAor = heroFigher.getAoeDmgDoneInTime(minHpMin, timeToKillMax, campFighting.timeToCamp) + heroFigher.getFrogBuffAoe(campFighting.timeToCamp, timeToKillMin - timeToKillMax);
                    float leftMin    = campFighting.Minions.Count - 1;
                    float leftMinHp  = leftMin * (minMinHp - dmgDoneAor);

                    float tmeToFinish = heroFigher.getTimeToDoDmg(minHpMin, leftMinHp, 6);
                    timeToKillCamp   = tmeToFinish + timeToKillMax;
                    fullDmgDoneToMe += minHpMin.getDps() * tmeToFinish;
                }
            }
            // Console.WriteLine("TimeTOfinish: " + timeToKillCamp);
            float myHpTillThere = heroFigher.getFulHeal((campFighting.timeToCamp - 3) < 0 ? 0 : campFighting.timeToCamp - 3, timeToKillCamp);

            float relDmgToMe = heroFigher.realPhysDmgDoneToMe(fullDmgDoneToMe);

            // Console.WriteLine("HpLeft: " + (myHpTillThere + Jungler.player.Health - relDmgToMe) + " will heal:" + myHpTillThere);

            hpLeftAfter = (myHpTillThere + Jungler.player.Health - relDmgToMe);
            timeToKill  = timeToKillCamp;

            if (smiteIfNeedTo && hpLeftAfter <= 100 && getSmiteCd(campFighting.timeToCamp) == 0)
            {
                AroundFight(campFighting, true, aoeSmite);
                campFighting.forceSmite = true;
                //  Console.WriteLine("force smite!!!!");
            }
            //Update camp
            campFighting.willKillMe       = hpLeftAfter < 250;
            campFighting.hpLeftAfterFight = hpLeftAfter;
            campFighting.timeToKill       = timeToKill;

            return(hpLeftAfter > 250);
        }
Ejemplo n.º 12
0
 public override float getAoeDmgDoneInTime(Camp.JungleMinion camp, float time, float cdResetTime)
 {
     return(0.1f);
 }