コード例 #1
0
ファイル: PriestSolver.cs プロジェクト: rakot/rawr
        protected void DoCalcs()
        {
            float healed = 0;
            float castTime = 0, baseCastTime = 0;
            float manaCost   = 0;
            float critChance = 0;

            for (int x = 0; x < castSequence.Count; x++)
            {
                DirectHealSpell dhs = castSequence[x];
                healed       += dhs.HPC();
                baseCastTime += dhs.IsInstant ? dhs.BaseGlobalCooldown : dhs.BaseCastTime;
                castTime     += dhs.IsInstant ? dhs.GlobalCooldown : dhs.CastTime;
                manaCost     += dhs.ManaCost;
                critChance   += dhs.CritChance;
            }

            float effectiveFightLength = bossOptions.BerserkTimer * calcOpts.ActivityRatio / 100f;
            float repeats        = effectiveFightLength / baseCastTime;
            float castsPerSecond = castSequence.Count / baseCastTime;
            float critsPerSecond = critChance / baseCastTime;

            healed       *= repeats;
            baseCastTime *= repeats;
            castTime     *= repeats;
            manaCost     *= repeats;
            critChance   *= repeats;

            float manaRegen = CalcManaReg(castsPerSecond, critsPerSecond);


            float totalMana = (stats.Mana + stats.ManaRestore * (1f + stats.BonusManaPotionEffectMultiplier))
                              + manaRegen * bossOptions.BerserkTimer;

            calc.BurstGoal     = 20000f;
            calc.SustainGoal   = calc.BurstGoal * 0.5f;
            calc.ManaGoal      = manaCost;
            calc.BurstPoints   = (1f - (float)Math.Exp(-1f * (((healed / castTime)) / calc.BurstGoal))) * 100000f;
            calc.SustainPoints = (1f - (float)Math.Exp(-1f * ((healed / baseCastTime / calc.SustainGoal)))) * 100000f;
            calc.ManaPoints    = (1f - (float)Math.Exp(-1f * (totalMana / calc.ManaGoal))) * 100000f;
            calc.OverallPoints = calc.BurstPoints + calc.SustainPoints + calc.ManaPoints;

            if (verbose)
            {
                List <string> modelInfo = new List <string>();
                modelInfo.Add("The model uses the following spell rotation:");
                for (int x = 0; x < castSequence.Count; x++)
                {
                    modelInfo.Add(castSequence[x].Name);
                }

                Name = String.Format("{0}*{1}", Name, String.Join("\n", modelInfo));
            }
        }
コード例 #2
0
ファイル: PriestSolver.cs プロジェクト: rakot/rawr
        protected void DoCalcs2()
        {
            float burst = 0, sustain = 0;
            float castTime = 0, baseCastTime = 0;
            float manaSustainUse = 0;
            float critChance     = 0;

            for (int x = 0; x < castSequence.Count; x++)
            {
                DirectHealSpell dhs = castSequence[x];
                burst          += dhs.HPC();
                baseCastTime   += dhs.IsInstant ? dhs.BaseGlobalCooldown : dhs.BaseCastTime;
                castTime       += dhs.IsInstant ? dhs.GlobalCooldown : dhs.CastTime;
                manaSustainUse += dhs.ManaCost;
                critChance     += dhs.CritChance;
            }
            baseCastTime  /= (calcOpts.ActivityRatio / 100f);
            sustain        = burst / baseCastTime;
            burst         /= castTime;
            manaSustainUse = manaSustainUse / baseCastTime;
            float castsPerSecond = castSequence.Count / baseCastTime;
            float critsPerSecond = critChance / baseCastTime;

            float manaRegen = CalcManaReg(castsPerSecond, critsPerSecond);

            float manaMissing = manaSustainUse - manaRegen;
            float fullBurst   = ((stats.Mana + stats.ManaRestore) / manaMissing) / bossOptions.BerserkTimer;
            float waitCast    = 1f - fullBurst;

            if (waitCast < 0)
            {
                waitCast = 0;
            }
//            calc.SustainPoints = sustain * fullBurst
//                + sustain * ((manaRegen / manaSustainUse) * waitCast);

//            if (calc.SustainPoints > calc.BurstPoints)
//                calc.SustainPoints = calc.BurstPoints;
            //calc.BurstPoints = burst * fullBurst;
            //calc.SustainPoints = sustain * ((manaRegen / manaSustainUse) * waitCast);

            calc.BurstPoints = burst;
            if (fullBurst > 1)
            {
                calc.SustainPoints = calc.BurstPoints;
            }
            else
            {
                calc.SustainPoints = burst * fullBurst;
            }

            calc.OverallPoints = calc.BurstPoints + calc.SustainPoints + calc.ManaPoints;

            if (verbose)
            {
                List <string> modelInfo = new List <string>();
                modelInfo.Add("The model uses the following spell rotation:");
                for (int x = 0; x < castSequence.Count; x++)
                {
                    modelInfo.Add(castSequence[x].Name);
                }

                Name = String.Format("{0}*{1}", Name, String.Join("\n", modelInfo));
            }
        }