示例#1
0
文件: Charting.cs 项目: tsebalj1/rawr
        public static ICollection <ComparisonCalculationBase> CalculateMAPSChart(Character character, CalculationsRestoSham baseCalculations)
        {
            List <ComparisonCalculationBase> list = new List <ComparisonCalculationBase>();
            CharacterCalculationsRestoSham   calc = baseCalculations.GetCharacterCalculations(character) as CharacterCalculationsRestoSham;

            if (calc == null)
            {
                calc = new CharacterCalculationsRestoSham();
            }

            StatRelativeWeight[] stats = new StatRelativeWeight[] {
                new StatRelativeWeight("Intellect", new Stats()
                {
                    Intellect = 10f
                }),
                new StatRelativeWeight("Haste Rating", new Stats()
                {
                    HasteRating = 10f
                }),
                new StatRelativeWeight("Spellpower", new Stats()
                {
                    SpellPower = 10f
                }),
                new StatRelativeWeight("MP5", new Stats()
                {
                    Mp5 = 10f
                }),
                new StatRelativeWeight("Crit Rating", new Stats()
                {
                    CritRating = 10f
                })
            };

            // Get the percentage total healing is changed by a change in a single stat:
            foreach (StatRelativeWeight weight in stats)
            {
                CharacterCalculationsRestoSham statCalc = (CharacterCalculationsRestoSham)baseCalculations.GetCharacterCalculations(character, null, weight.Stat);
                weight.Change = (statCalc.MAPS - calc.MAPS);
            }

            // Create the chart data points:
            foreach (StatRelativeWeight weight in stats)
            {
                ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(weight.Name);
                comp.OverallPoints = weight.Change;
                comp.SubPoints     = new float[] { 0f, weight.Change, 0f };
                comp.Description   = string.Format("If you added 10 more {0}.", weight.Name);
                list.Add(comp);
            }

            return(list);
        }
示例#2
0
文件: Charting.cs 项目: tsebalj1/rawr
        public static ICollection <ComparisonCalculationBase> CalculateSequencesChart(Character character, CalculationsRestoSham baseCalculations)
        {
            List <ComparisonCalculationBase> list            = new List <ComparisonCalculationBase>();
            CalculationOptionsRestoSham      originalOptions = character.CalculationOptions as CalculationOptionsRestoSham;

            if (originalOptions == null)
            {
                originalOptions = new CalculationOptionsRestoSham();
            }

            CalculationOptionsRestoSham opts = originalOptions;

            string[] styles = new string[] { "CH Spam", "HW Spam", "LHW Spam", "RT+HW", "RT+CH", "RT+LHW" };
            string[] descs  = new string[] {
                "All chain heal, all the time.  \nMana available for use per minute added to sustained.",
                "All healing wave, all the time  \nMana available for use per minute added to sustained.",
                "All lesser healing wave, all the time  \nMana available for use per minute added to sustained.",
                "Riptide + Healing Wave.  \nMana available for use per minute added to sustained.",
                "Riptide + Chain Heal.  \nMana available for use per minute added to sustained.",
                "Riptide + Lesser Healing Wave.\nMana available for use per minute added to sustained."
            };
            for (int i = 0; i < styles.Length; i++)
            {
                opts.SustStyle  = styles[i];
                opts.BurstStyle = styles[i];
                character.CalculationOptions = opts;
                CharacterCalculationsRestoSham statCalc = (CharacterCalculationsRestoSham)baseCalculations.GetCharacterCalculations(character);

                // normalize the mana a bit to make a better chart
                float mana = statCalc.ManaUsed / (opts.FightLength);

                ComparisonCalculationRestoSham hsComp = new ComparisonCalculationRestoSham(styles[i]);
                hsComp.OverallPoints = statCalc.BurstHPS + statCalc.SustainedHPS + mana;
                hsComp.SubPoints     = new float[] { statCalc.BurstHPS, statCalc.SustainedHPS + mana, 0f };
                hsComp.Description   = descs[i];
                list.Add(hsComp);
            }

            return(list);
        }
示例#3
0
        //
        // Data for custom charts:
        //
        public override ComparisonCalculationBase[] GetCustomChartData(Character character, string chartName)
        {
            CharacterCalculationsRestoSham calc = GetCharacterCalculations(character) as CharacterCalculationsRestoSham;

            if (calc == null)
            {
                calc = new CharacterCalculationsRestoSham();
            }

            CalculationOptionsRestoSham options = character.CalculationOptions as CalculationOptionsRestoSham;

            if (options == null)
            {
                options = new CalculationOptionsRestoSham();
            }

            List <ComparisonCalculationBase> list = new List <ComparisonCalculationBase>();

            switch (chartName)
            {
            case "Stat Relative Weights":
                StatRelativeWeight[] stats = new StatRelativeWeight[] {
                    new StatRelativeWeight("Int", new Stats()
                    {
                        Intellect = 1f
                    }),
                    new StatRelativeWeight("Spirit", new Stats()
                    {
                        Spirit = 1f
                    }),
                    new StatRelativeWeight("+Heal", new Stats()
                    {
                        Healing = 1f
                    }),
                    new StatRelativeWeight("Mp5", new Stats()
                    {
                        Mp5 = 1f
                    }),
                    new StatRelativeWeight("Spell Crit", new Stats()
                    {
                        SpellCritRating = 1f
                    })
                };

                // Get the percentage total healing is changed by a change in a single stat:

                float healPct = 0f;
                foreach (StatRelativeWeight weight in stats)
                {
                    CharacterCalculationsRestoSham statCalc = (CharacterCalculationsRestoSham)GetCharacterCalculations(character, null, weight.Stat);
                    weight.PctChange = (statCalc.TotalHealed - calc.TotalHealed) / calc.TotalHealed;
                    if (weight.Name == "+Heal")
                    {
                        healPct = weight.PctChange;
                    }
                }

                // Create the chart data points:

                foreach (StatRelativeWeight weight in stats)
                {
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(weight.Name);
                    comp.OverallPoints = weight.PctChange / healPct;
                    comp.SubPoints[0]  = comp.OverallPoints;
                    list.Add(comp);
                }

                break;

            case "Healing Spell Ranks":
                // Healing Wave ranks:

                for (int i = 1; i <= 12; i++)
                {
                    HealingWave hw = new HealingWave(i);
                    hw.Calcluate(calc.BasicStats, character);
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(hw.FullName);
                    comp.OverallPoints = hw.AverageHealed + hw.HealingWay;
                    comp.SubPoints[0]  = hw.AverageHealed;
                    comp.SubPoints[3]  = hw.HealingWay;
                    list.Add(comp);
                }

                // Lesser Healing Wave ranks:

                for (int i = 1; i <= 7; i++)
                {
                    LesserHealingWave lhw = new LesserHealingWave(i);
                    lhw.Calcluate(calc.BasicStats, character);
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(lhw.FullName);
                    comp.OverallPoints = comp.SubPoints[0] = lhw.AverageHealed;
                    list.Add(comp);
                }

                // Chain Heal ranks:

                for (int i = 1; i <= 5; i++)
                {
                    ChainHeal ch = new ChainHeal(i);
                    ch.Calcluate(calc.BasicStats, character);
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(ch.FullName);
                    comp.OverallPoints = ch.TotalHealed;
                    for (int j = 0; j < 3; j++)
                    {
                        comp.SubPoints[j] = ch.HealsOnTargets[j];
                    }
                    list.Add(comp);
                }

                // The Draenei racial:

                if (character.Race == Character.CharacterRace.Draenei)
                {
                    GiftOfTheNaaru gift = new GiftOfTheNaaru();
                    gift.Calcluate(calc.BasicStats, character);
                    ComparisonCalculationRestoSham comp = new ComparisonCalculationRestoSham(gift.FullName);
                    comp.OverallPoints = comp.SubPoints[0] = gift.AverageHealed;
                    list.Add(comp);
                }

                break;
            }

            ComparisonCalculationBase[] retVal = new ComparisonCalculationBase[list.Count];
            if (list.Count > 0)
            {
                list.CopyTo(retVal);
            }
            return(retVal);
        }