Пример #1
0
        public override void Rota()
        {
            if (br.CanUse() && Resource < 90)
            {
                br.Cast();
            }

            /*
             * if (bs.CanUse() && (!Effects.Any(e => e is BattleShoutBuff) || ((BattleShoutBuff)Effects.Where(e => e is BattleShoutBuff).First()).RemainingTime() < GCD))
             * {
             *  bs.Cast();
             * }
             */

            if (cds != null)
            {
                foreach (Skill cd in cds.Keys)
                {
                    if (cd.CanUse() &&
                        (Sim.FightLength - Sim.CurrentTime <= cds[cd] ||
                         Sim.FightLength - Sim.CurrentTime >= cd.BaseCD + cds[cd]))
                    {
                        if (!(cd is MightyRage) || Sim.FightLength - Sim.CurrentTime >= cd.BaseCD + cds[cd] || (!Tanking && Resource < exec.Cost))
                        {
                            cd.Cast();
                        }
                    }
                }
            }

            if (rota == 0) //BT > WW > HAM + HS + EXEC
            {
                if (Sim.Boss.LifePct > 0.2)
                {
                    if (bt.CanUse())
                    {
                        bt.Cast();
                    }
                    else if (ww.CanUse() && Resource >= ww.Cost + bt.Cost && bt.RemainingCD() >= GCD)
                    {
                        ww.Cast();
                    }
                    else if (ham.CanUse() && Resource >= bt.Cost + ww.Cost + hs.Cost && ww.RemainingCD() >= GCD && bt.RemainingCD() >= GCD && (!Effects.ContainsKey(Flurry.NAME) || ((Flurry)Effects[Flurry.NAME]).CurrentStacks < 3))
                    {
                        ham.Cast();
                    }

                    if (!MH.TwoHanded && applyAtNextAA == null && Resource >= bt.Cost + ww.Cost + hs.Cost && hs.CanUse())
                    {
                        hs.Cast();
                    }
                    else if (!MH.TwoHanded && Resource < bt.Cost + ww.Cost + hs.Cost)
                    {
                        applyAtNextAA = null;
                    }
                }
                else
                {
                    if (exec.CanUse())
                    {
                        exec.Cast();
                    }
                }
            }
            else if (rota == 1) //SLAM + EXEC
            {
                if (Sim.Boss.LifePct > 0.2)
                {
                    if (slam.CanUse())
                    {
                        slam.Cast();
                    }
                }
                else
                {
                    if (exec.CanUse())
                    {
                        exec.Cast();
                    }
                }
            }
            else if (rota == 2) //BT > REVENGE > BS + HS
            {
                if (bt.CanUse())
                {
                    bt.Cast();
                }
                else if (rev.CanUse())
                {
                    rev.Cast();
                }
                else if (sa.CanUse())
                {
                    sa.Cast();
                }

                if (!MH.TwoHanded && applyAtNextAA == null && Resource >= bt.Cost + sa.Cost + hs.Cost && hs.CanUse())
                {
                    hs.Cast();
                }
                else if (!MH.TwoHanded && applyAtNextAA != null && Resource < bt.Cost + sa.Cost + hs.Cost)
                {
                    applyAtNextAA = null;
                }
            }
            else if (rota == 3) //BT > REVENGE > SA + HS
            {
                if (bt.CanUse())
                {
                    bt.Cast();
                }
                else if (rev.CanUse())
                {
                    rev.Cast();
                }
                else if (bs.CanUse())
                {
                    bs.Cast();
                }

                if (!MH.TwoHanded && applyAtNextAA == null && Resource >= bt.Cost + sa.Cost + hs.Cost && hs.CanUse())
                {
                    hs.Cast();
                }
                else if (!MH.TwoHanded && applyAtNextAA != null && Resource < bt.Cost + sa.Cost + hs.Cost)
                {
                    applyAtNextAA = null;
                }
            }

            CheckAAs();
        }
Пример #2
0
        public void StartSim()
        {
            List <AutoAttack> autos = new List <AutoAttack>();

            autos.Add(new AutoAttack(Player, Player.MH, true));
            if (Player.OH != null)
            {
                autos.Add(new AutoAttack(Player, Player.OH, false));
            }

            CurrentTime = 0;

            Whirlwind    ww = new Whirlwind(Player);
            Bloodthirst  bt = new Bloodthirst(Player);
            HeroicStrike hs = new HeroicStrike(Player);

            hs.RessourceCost -= Player.GetTalentPoints("IHS");
            Execute     exec = new Execute(Player);
            Bloodrage   br   = new Bloodrage(Player);
            BattleShout bs   = new BattleShout(Player);
            Hamstring   ham  = new Hamstring(Player);

            Dictionary <Spell, int> cds = null;

            if (Player.Cooldowns != null)
            {
                cds = new Dictionary <Spell, int>();
                foreach (string s in Player.Cooldowns)
                {
                    switch (s)
                    {
                    case "Death Wish": cds.Add(new DeathWish(Player), DeathWishBuff.LENGTH); break;

                    case "Juju Flurry": cds.Add(new JujuFlurry(Player), JujuFlurryBuff.LENGTH); break;

                    case "Mighty Rage": cds.Add(new MightyRage(Player), MightyRageBuff.LENGTH); break;

                    case "Recklessness": cds.Add(new Recklessness(Player), RecklessnessBuff.LENGTH); break;

                    case "Racial":
                        if (Player.Race == Player.Races.Orc)
                        {
                            cds.Add(new BloodFury(Player), BloodFuryBuff.LENGTH);
                        }
                        else if (Player.Race == Player.Races.Troll)
                        {
                            cds.Add(new Berserking(Player), BerserkingBuff.LENGTH);
                        }
                        break;
                    }
                }
            }

            Boss.LifePct = 1;

            // Pre-cast Battle Shout (starts GCD as Charge would)
            bs.Cast();

            // Charge
            Player.Ressource += 15;

            int rota = 1;

            while (CurrentTime < FightLength)
            {
                if (AutoLife)
                {
                    Boss.LifePct = Math.Max(0, 1 - (CurrentTime / FightLength) * (16.0 / 17.0));
                }
                else if (CurrentTime >= LowLifeTime && Boss.LifePct == 1)
                {
                    Boss.LifePct = 0.10;
                }

                foreach (Effect e in Player.Effects)
                {
                    e.CheckEffect();
                }
                foreach (Effect e in Boss.Effects)
                {
                    e.CheckEffect();
                }

                Player.Effects.RemoveAll(e => e.Ended);
                Boss.Effects.RemoveAll(e => e.Ended);

                if (br.CanUse() && Player.Ressource <= 90)
                {
                    br.Cast();
                }

                if (bs.CanUse() && (!Player.Effects.Any(e => e is BattleShoutBuff) || ((BattleShoutBuff)Player.Effects.Where(e => e is BattleShoutBuff).First()).RemainingTime() < Player.GCD))
                {
                    bs.Cast();
                }


                if (cds != null)
                {
                    foreach (Spell cd in cds.Keys)
                    {
                        if (cd.CanUse() &&
                            (FightLength - CurrentTime <= cds[cd] ||
                             FightLength - CurrentTime >= cd.BaseCD + cds[cd]))
                        {
                            cd.Cast();
                        }
                    }
                }

                if (rota == 0)
                {
                }
                else if (rota == 1)
                {
                    if (Boss.LifePct > 0.2)
                    {
                        if (bt.CanUse())
                        {
                            bt.Cast();
                        }
                        else if (ww.CanUse() && Player.Ressource >= ww.RessourceCost + bt.RessourceCost && bt.RemainingCD() >= Player.GCD)
                        {
                            ww.Cast();
                        }
                        else if (ham.CanUse() && Player.Ressource >= Bloodthirst.COST + Whirlwind.COST + Hamstring.COST && ww.RemainingCD() >= Player.GCD && bt.RemainingCD() >= Player.GCD && (!Player.Effects.Any(e => e is Flurry) || ((Flurry)Player.Effects.Where(f => f is Flurry).First()).CurrentStacks < 3))
                        {
                            ham.Cast();
                        }

                        if (Player.Ressource >= Bloodthirst.COST + Whirlwind.COST + HeroicStrike.COST && hs.CanUse())
                        {
                            hs.Cast();
                        }
                    }
                    else
                    {
                        if (exec.CanUse())
                        {
                            exec.Cast();
                        }
                    }
                }
                else if (rota == 2)
                {
                    if (ww.CanUse())
                    {
                        ww.Cast();
                    }
                    else if (bt.CanUse() && Player.Ressource >= ww.RessourceCost + bt.RessourceCost)
                    {
                        bt.Cast();
                    }
                    else if (ham.CanUse() && Player.Ressource >= Bloodthirst.COST + Whirlwind.COST + Hamstring.COST && ww.RemainingCD() >= Player.GCD && bt.RemainingCD() >= Player.GCD && (!Player.Effects.Any(e => e is Flurry) || ((Flurry)Player.Effects.Where(f => f is Flurry).First()).CurrentStacks < 3))
                    {
                        ham.Cast();
                    }

                    if (Player.Ressource >= Bloodthirst.COST + Whirlwind.COST + HeroicStrike.COST && hs.CanUse())
                    {
                        hs.Cast();
                    }
                }

                foreach (AutoAttack a in autos)
                {
                    if (a.Available())
                    {
                        if (a.MH && Player.applyAtNextAA != null)
                        {
                            Player.applyAtNextAA.DoAction();
                            a.NextAA();
                        }
                        else
                        {
                            a.Cast();
                        }
                    }
                }

                Player.Effects.RemoveAll(e => e.Ended);
                Boss.Effects.RemoveAll(e => e.Ended);

                CurrentTime += 1 / RATE;
            }

            Program.damages.Add(Damage);
            Program.totalActions.Add(Actions);
            Program.totalEffects.Add(Effects);

            Ended = true;
        }