Esempio n. 1
0
        // Add calculated values to the values dictionary.
        // These values are then available for display via the CharacterDisplayCalculationLabels
        // member defined in CalculationsRetribution.cs
        // While possible, there's little reason to add values to the dictionary that are not being
        // used by the CharacterDisplayCalculationLabels.
        public override Dictionary <string, string> GetCharacterDisplayCalculationValues()
        {
            Dictionary <string, string> dictValues = new Dictionary <string, string>();

            // Status text
            dictValues["Status"] = string.Format("{0} dps", DPSPoints.ToString("N0"));

            // Basic stats
            dictValues["Health"]        = BasicStats.Health.ToString("N0");
            dictValues["Mana"]          = BasicStats.Mana.ToString("N0");
            dictValues["Strength"]      = BasicStats.Strength.ToString("N0");
            dictValues["Agility"]       = string.Format("{0:0}", BasicStats.Agility);
            dictValues["Attack Power"]  = BasicStats.AttackPower.ToString("N0");
            dictValues["Crit Chance"]   = string.Format("{0:P}*{1:0} crit rating", BasicStats.PhysicalCrit, BasicStats.CritRating);
            dictValues["Miss Chance"]   = string.Format("{0:P}*{1:P} hit ({2:0} rating)\n", ToMiss, BasicStats.PhysicalHit, BasicStats.HitRating);
            dictValues["Dodge Chance"]  = string.Format("{0:P}*{1:P} expertise ({2:0} rating)", ToBeDodged, BasicStats.Expertise * .0025f, BasicStats.ExpertiseRating);
            dictValues["Melee Haste"]   = string.Format("{0:P}*{1:0} haste rating", BasicStats.PhysicalHaste, BasicStats.HasteRating);
            dictValues["Weapon Damage"] = WeaponDamage.ToString("N2");
            dictValues["Attack Speed"]  = AttackSpeed.ToString("N2");

            // DPS Breakdown
            dictValues["Total DPS"]         = OverallPoints.ToString("N0");
            dictValues["White"]             = string.Format("{0}*{1}", WhiteDPS.ToString("N0"), WhiteSkill.ToString());
            dictValues["Seal"]              = string.Format("{0}*{1}", SealDPS.ToString("N0"), SealSkill.ToString());
            dictValues["Crusader Strike"]   = string.Format("{0}*{1}", CrusaderStrikeDPS.ToString("N0"), CrusaderStrikeSkill.ToString());
            dictValues["Judgement"]         = string.Format("{0}*{1}", JudgementDPS.ToString("N0"), JudgementSkill.ToString());
            dictValues["Consecration"]      = string.Format("{0}*{1}", ConsecrationDPS.ToString("N0"), ConsecrationSkill.ToString());
            dictValues["Exorcism"]          = string.Format("{0}*{1}", ExorcismDPS.ToString("N0"), ExorcismSkill.ToString());
            dictValues["Divine Storm"]      = string.Format("{0}*{1}", DivineStormDPS.ToString("N0"), DivineStormSkill.ToString());
            dictValues["Hammer of Wrath"]   = string.Format("{0}*{1}", HammerOfWrathDPS.ToString("N0"), HammerOfWrathSkill.ToString());
            dictValues["Hand of Reckoning"] = string.Format("{0}*{1}", HandOfReckoningDPS.ToString("N0"), HandOfReckoningSkill.ToString());
            dictValues["Other"]             = OtherDPS.ToString("N0");

            // Rotation Info:
            dictValues["Chosen Rotation"] = Rotation == null ?
                                            "n/a" :
                                            SimulatorParameters.ShortRotationString(Rotation); // TODO: Remove dependancy on SimulatorParameters.
            dictValues["Average SoV Stack"]  = AverageSoVStack.ToString("N2");
            dictValues["SoV Overtake"]       = string.Format("{0} sec", SoVOvertake.ToString("N2"));
            dictValues["Crusader Strike CD"] =
                Solution.GetAbilityEffectiveCooldown(Ability.CrusaderStrike).ToString("N2");
            dictValues["Judgement CD"] =
                Solution.GetAbilityEffectiveCooldown(Ability.Judgement).ToString("N2");
            dictValues["Consecration CD"] =
                Solution.GetAbilityEffectiveCooldown(Ability.Consecration).ToString("N2");
            dictValues["Exorcism CD"] =
                Solution.GetAbilityEffectiveCooldown(Ability.Exorcism).ToString("N2");
            dictValues["Divine Storm CD"] =
                Solution.GetAbilityEffectiveCooldown(Ability.DivineStorm).ToString("N2");
            dictValues["Hammer of Wrath CD"] =
                Solution.GetAbilityEffectiveCooldown(Ability.HammerOfWrath).ToString("N2");

            return(dictValues);
        }
Esempio n. 2
0
        private void showRotation(int number)
        {
            CalculationOptionsRetribution calcOpts = Character.CalculationOptions as CalculationOptionsRetribution;
            List <string> abilityList = new List <string>(calcOpts.Rotations[number].Length);

            foreach (Ability ability in calcOpts.Rotations[number])
            {
                abilityList.Add(SimulatorParameters.AbilityString(ability));
            }
            listRotation.Items.Clear();
            listRotation.Items.AddRange(abilityList.ToArray());
        }
Esempio n. 3
0
        private void buildRotationCombo()
        {
            bool wasLoading = loading;

            loading = true;
            int oldIndex = cmbRotations.SelectedIndex;
            CalculationOptionsRetribution calcOpts = Character.CalculationOptions as CalculationOptionsRetribution;
            List <string> rotationList             = new List <string>(calcOpts.Rotations.Count);

            foreach (Ability[] rotation in calcOpts.Rotations)
            {
                rotationList.Add(SimulatorParameters.RotationString(rotation));
            }
            cmbRotations.DataSource    = rotationList;
            cmbRotations.SelectedIndex = oldIndex;
            loading = wasLoading;
        }
Esempio n. 4
0
        protected override void LoadCalculationOptions()
        {
            loading = true;
            if (Character.CalculationOptions == null)
            {
                Character.CalculationOptions = new CalculationOptionsRetribution();
            }

            CalculationOptionsRetribution calcOpts = Character.CalculationOptions as CalculationOptionsRetribution;

            cmbMobType.SelectedIndex = (int)calcOpts.Mob;

            if (calcOpts.Seal == SealOf.Blood)
            {
                calcOpts.Seal = SealOf.Vengeance;
                Character.OnCalculationsInvalidated();
            }
            cmbSeal.SelectedIndex = (int)calcOpts.Seal - 1;

            cmbLength.Value = (decimal)calcOpts.FightLength;

            nudTimeUnder20.Value  = (decimal)(calcOpts.TimeUnder20 * 100);
            nudInFront.Value      = (decimal)(calcOpts.InFront * 100);
            nudConsEff.Value      = (decimal)(calcOpts.ConsEff * 100);
            nudHoR.Value          = (decimal)(calcOpts.HoREff * 100);
            nudTargetSwitch.Value = (decimal)calcOpts.TargetSwitches;
            nudTargets.Value      = (decimal)calcOpts.Targets;

            chkBloodlust.Checked = calcOpts.Bloodlust;

            nudDelay.Value        = (decimal)calcOpts.Delay;
            nudWait.Value         = (decimal)calcOpts.Wait;
            nudStackTrinket.Value = (decimal)calcOpts.StackTrinketReset;
            nudTargetLevel.Value  = (decimal)calcOpts.TargetLevel;

            nudJudge.Value   = (decimal)calcOpts.JudgeCD;
            nudCS.Value      = (decimal)calcOpts.CSCD;
            nudDS.Value      = (decimal)calcOpts.DSCD;
            nudCons.Value    = (decimal)calcOpts.ConsCD;
            nudExo.Value     = (decimal)calcOpts.ExoCD;
            nudJudge20.Value = (decimal)calcOpts.JudgeCD20;
            nudCS20.Value    = (decimal)calcOpts.CSCD20;
            nudDS20.Value    = (decimal)calcOpts.DSCD20;
            nudCons20.Value  = (decimal)calcOpts.ConsCD20;
            nudExo20.Value   = (decimal)calcOpts.ExoCD20;
            nudHoW20.Value   = (decimal)calcOpts.HoWCD20;

            if (calcOpts.Rotations.Count == 0)
            {
                calcOpts.Rotations.Add(SimulatorParameters.DefaultRotation());
            }
            butDelRotation.Enabled = calcOpts.Rotations.Count > 1;
            buildRotationCombo();
            cmbRotations.SelectedIndex = 0;
            showRotation(0);

            if (calcOpts.SimulateRotation)
            {
                radRotSim.Checked = true;
            }
            else
            {
                radEffectiveCD.Checked = true;
            }
            SetSimulateRotation(calcOpts.SimulateRotation);

            textExperimental.Text = calcOpts.Experimental;
            CalculationsRetribution.Experimental = calcOpts.Experimental;

#if DEBUG
            buttonStatGraph.Visible = true;
            buttonEcdGraph.Visible  = true;
#else
            buttonStatGraph.Visible = true;
            buttonEcdGraph.Visible  = true;
#endif
            loading = false;
        }
Esempio n. 5
0
        private static RotationSolution SimulateRotationCore(SimulatorParameters rot)
        {
            const int timeUnitsPerSecond = 100000;
            const int meleeAbilityGcd    = (int)(1.5m * timeUnitsPerSecond);

            int fightLength = (int)(rot.SimulationTime * timeUnitsPerSecond);
            int spellGcd    = (int)(rot.SpellGCD * timeUnitsPerSecond);

            SimulatorAbility.Delay = (int)(rot.Delay * timeUnitsPerSecond);
            SimulatorAbility.Wait  = (int)(rot.Wait * timeUnitsPerSecond);

            SimulatorAbility[] abilities = new SimulatorAbility[(int)Ability.Last + 1];

            abilities[(int)Ability.Judgement] = new SimulatorAbility(
                (10 - rot.ImpJudgements - (rot.T7_4pc ? 1 : 0)) * timeUnitsPerSecond,
                meleeAbilityGcd);
            abilities[(int)Ability.CrusaderStrike] = new SimulatorAbility(
                4 * timeUnitsPerSecond,
                meleeAbilityGcd);
            abilities[(int)Ability.DivineStorm] = new SimulatorAbility(
                (int)(rot.DivineStormCooldown * timeUnitsPerSecond),
                meleeAbilityGcd);
            abilities[(int)Ability.Consecration] = new SimulatorAbility(
                (rot.GlyphConsecrate ? 10 : 8) * timeUnitsPerSecond,
                spellGcd);
            abilities[(int)Ability.Exorcism] = new SimulatorAbility(
                15 * timeUnitsPerSecond,
                spellGcd);
            abilities[(int)Ability.HammerOfWrath] = new SimulatorAbility(
                6 * timeUnitsPerSecond,
                meleeAbilityGcd);

            int gcdFinishTime = 0;
            int currentTime   = 0;

            while (currentTime < fightLength)
            {
                if (currentTime >= gcdFinishTime)
                {
                    foreach (Ability ability in rot.Priorities)
                    {
                        if (abilities[(int)ability].ShouldAbilityBeUsedNext(currentTime))
                        {
                            if (abilities[(int)ability].CanAbilityBeUsedNow(currentTime))
                            {
                                gcdFinishTime = abilities[(int)ability].UseAbility(currentTime);
                            }

                            break;
                        }
                    }
                }

                int nextTime = fightLength;
                if (currentTime >= gcdFinishTime)
                {
                    foreach (Ability ability in rot.Priorities)
                    {
                        int nextUseTime = abilities[(int)ability].GetNextUseTime(currentTime);
                        if (nextUseTime > currentTime)
                        {
                            nextTime = Math.Min(nextTime, nextUseTime);
                        }
                    }
                }
                else
                {
                    nextTime = Math.Min(nextTime, gcdFinishTime);
                }

                currentTime = nextTime;
            }

            float            fightLengthInSeconds = ((float)fightLength) / timeUnitsPerSecond;
            RotationSolution solution             = new RotationSolution();

            foreach (Ability ability in rot.Priorities)
            {
                solution.SetAbilityUsagePerSecond(
                    ability,
                    abilities[(int)ability].Uses / fightLengthInSeconds);
                solution.SetAbilityEffectiveCooldown(
                    ability,
                    abilities[(int)ability].EffectiveCooldown() / timeUnitsPerSecond);
            }

            return(solution);
        }
Esempio n. 6
0
 public static RotationSolution SimulateRotation(SimulatorParameters rot)
 {
     return(solutionCache.GetResult(rot));
 }