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); }
// // 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); }