Exemple #1
0
        public BloodCycle(Character c, CombatTable t, Stats s, CalculationOptionsDPSDK opts, AbilityHandler a)
        {
            BP          = 0;
            FF          = 0;
            currentTime = 0;
            GCDTime     = 0;
            occurence   = new Rotation();
            //occurence.presence = calcOpts.rotation.presence;
            occurence.setRotation(Rotation.Type.Custom);
            occurence.NumDisease        = 0f;
            occurence.DiseaseUptime     = 100f;
            occurence.DeathCoil         = 0f;
            occurence.IcyTouch          = 0f;
            occurence.PlagueStrike      = 0f;
            occurence.ScourgeStrike     = 0f;
            occurence.ManagedRP         = false;
            occurence.FrostStrike       = 0f;
            occurence.HowlingBlast      = 0f;
            occurence.Obliterate        = 0f;
            occurence.BloodStrike       = 0f;
            occurence.HeartStrike       = 0f;
            occurence.DancingRuneWeapon = 0f;
            occurence.Horn                = 0f;
            occurence.GargoyleDuration    = 30f;
            occurence.DeathStrike         = 0f;
            occurence.GhoulFrenzy         = 0f;
            occurence.Pestilence          = 0f;
            occurence.CurRotationDuration = 60f;

            RP               = 0;
            FrostRune1       = 0;
            FrostRune2       = 0;
            UnholyRune1      = 0;
            UnholyRune2      = 0;
            BloodRune1       = 0;
            BloodRune2       = 0;
            DeathUnholyRune1 = 100 * 60 * 1000 * 100;
            DeathUnholyRune2 = 100 * 60 * 1000 * 100;
            DeathFrostRune1  = 100 * 60 * 1000 * 100;
            DeathFrostRune2  = 100 * 60 * 1000 * 100;
            horn             = 0;
            character        = c;
            combatTable      = t;
            stats            = s;
            talents          = c.DeathKnightTalents;
            calcOpts         = opts;
            if (opts.CurrentPresence == CalculationOptionsDPSDK.Presence.Unholy)
            {
                meleeGCD = 1000;
                spellGCD = 1000;
            }
            else
            {
                meleeGCD = 1500;
                spellGCD = (int)(1500 / ((1 + (StatConversion.GetHasteFromRating(stats.HasteRating, CharacterClass.DeathKnight))) * (1d + stats.SpellHaste)));
                if (spellGCD < 1000)
                {
                    spellGCD = 1000;
                }
            }

            PhysicalGCDMultiplier = (1 / (1 - (combatTable.dodgedSpecial + combatTable.missedSpecial)));
            SpellGCDMultiplier    = (1 / (1 - (combatTable.spellResist)));

            MHFrequency = (int)(combatTable.MH.hastedSpeed * 1000);
        }
Exemple #2
0
        public RotationGene(int availableBlood, int availableFrost, int availableUnholy, DeathKnightTalents talents)
        {
            Rotation = new Rotation();
            Rotation.curRotationType = Rotation.Type.Custom;
            Rotation.ManagedRP       = true;
            Random rand = new Random((int)(CalculationsDPSDK.hawut + 0.5d));

            CalculationsDPSDK.hawut -= rand.NextDouble() * DateTime.Now.ToOADate() / 1000000;
            double nextRand;

            Rotation.presence = (rand.NextDouble() > .5 ? CalculationOptionsDPSDK.Presence.Blood : CalculationOptionsDPSDK.Presence.Unholy);
            nextRand          = rand.NextDouble();
            #region blood runes
            if (nextRand > 0.5d && availableBlood > 0d)
            {
                Rotation.Pestilence = 1;
                availableBlood--;
            }
            nextRand = rand.NextDouble();
            if (nextRand < 1d / 3d)
            {
                Rotation.BloodStrike = availableBlood;
                Rotation.HeartStrike = 0;
                Rotation.BloodBoil   = 0;
            }
            else if (nextRand < 2d / 3d)
            {
                Rotation.BloodStrike = 0;
                Rotation.HeartStrike = availableBlood;
                Rotation.BloodBoil   = 0;
            }
            else
            {
                Rotation.BloodStrike = 0;
                Rotation.HeartStrike = 0;
                Rotation.BloodBoil   = availableBlood;
            }
            #endregion

            #region frost and unholy runes
            nextRand = rand.NextDouble();
            if (nextRand > 0.5d && availableFrost > 0d)
            {
                Rotation.IcyTouch = 1;
                availableFrost--;
            }
            else
            {
                Rotation.IcyTouch = 0;
            }
            nextRand = rand.NextDouble();
            if (nextRand > 0.5d && availableUnholy > 0d)
            {
                Rotation.PlagueStrike = 1;
                availableUnholy--;
            }
            else
            {
                Rotation.PlagueStrike = 0;
            }
            nextRand = rand.NextDouble();
            if (nextRand < .25d)
            {
                Rotation.DeathStrike   = (availableUnholy + availableFrost) / 2f;
                Rotation.ScourgeStrike = 0;
                Rotation.Obliterate    = 0;
            }
            else if (nextRand < .5d)
            {
                Rotation.DeathStrike   = 0;
                Rotation.ScourgeStrike = (availableFrost + availableUnholy) / 2f;
                Rotation.Obliterate    = 0;
            }
            else if (nextRand < .75d)
            {
                Rotation.DeathStrike   = 0;
                Rotation.ScourgeStrike = 0;
                Rotation.Obliterate    = (availableUnholy + availableFrost) / 2f;
            }
            else
            {
                Rotation.DeathStrike   = 0;
                Rotation.ScourgeStrike = 0;
                Rotation.Obliterate    = 0;
                Rotation.PlagueStrike += availableUnholy;
                Rotation.IcyTouch     += availableFrost;
            }
            #endregion
            Rotation.AvgDiseaseMult = (Rotation.IcyTouch > 0 ? 1 : 0) + (Rotation.PlagueStrike > 0 ? 1 : 0);
            if (talents.CryptFever > 0 && (Rotation.IcyTouch > 0 || Rotation.PlagueStrike > 0))
            {
                Rotation.AvgDiseaseMult++;
            }
            double minDuration = availableBlood + availableFrost + availableUnholy;
            minDuration /= 6;
            minDuration *= 10 - (Rotation.presence == CalculationOptionsDPSDK.Presence.Unholy ? talents.ImprovedUnholyPresence * .5 : 0);
        }