public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); Stats baseStats = BaseStats.GetBaseStats(character); dictValues.Add("Health", BasicStats.Health.ToString()); dictValues.Add("Stamina", BasicStats.Stamina.ToString()); float ResilienceCap = 0.15f, ResilienceFromRating = StatConversion.GetCritReductionFromResilience(1); float Resilience = StatConversion.GetCritReductionFromResilience(BasicStats.Resilience); dictValues.Add("Resilience", string.Format("{0}*-{1}% Damage from DoT and Mana Drains\n\r-{1}% Chance to be crit\r\n-{2}% Damage from Crits.\r\n{3}", BasicStats.Resilience.ToString(), (Resilience * 100f).ToString("0.00"), (Resilience * 100f * 2.2f).ToString("0.00"), (Resilience > ResilienceCap)?(string.Format("{0} rating above cap", ((float)Math.Floor((Resilience - ResilienceCap) / ResilienceFromRating)).ToString("0"))):(string.Format("{0} rating below cap", ((float)Math.Ceiling((ResilienceCap - Resilience) / ResilienceFromRating)).ToString("0"))))); dictValues.Add("Mana", BasicStats.Mana.ToString()); dictValues.Add("Intellect", BasicStats.Intellect.ToString()); dictValues.Add("Spirit", Math.Floor(BasicStats.Spirit).ToString("0")); dictValues.Add("Spell Power", string.Format("{0}*{1} from Inner Fire", Math.Floor(BasicStats.SpellPower).ToString("0"), BasicStats.PriestInnerFire * CalculationsHealPriest.GetInnerFireSpellPowerBonus(character))); //dictValues.Add("Healing", Math.Floor(BasicStats.SpellPower * 1.88f).ToString("0")); dictValues.Add("In FSR MP5", string.Format("{0}*{1} from MP5\r\n{2} from Meditation\r\n{3} Outside FSR\r\n{4} OFSR w/MP5", (BasicStats.Mp5 + RegenInFSR).ToString("0"), BasicStats.Mp5.ToString("0"), RegenInFSR.ToString("0"), RegenOutFSR.ToString("0"), (BasicStats.Mp5 + RegenOutFSR).ToString("0"))); dictValues.Add("Spell Crit", string.Format("{0}%*{1}% from Intellect\r\n{2}% from {6} Crit rating\r\n{3}% from Focused Will\r\n{4}% Class Base\r\n{5}% from Buffs", (BasicStats.SpellCrit * 100f).ToString("0.00"), (StatConversion.GetSpellCritFromIntellect(BasicStats.Intellect) * 100f).ToString("0.00"), (StatConversion.GetSpellCritFromRating(BasicStats.CritRating) * 100f).ToString("0.00"), character.PriestTalents.FocusedWill.ToString("0"), (baseStats.SpellCrit * 100f).ToString("0.00"), (BasicStats.SpellCrit * 100f - baseStats.SpellCrit * 100f - StatConversion.GetSpellCritFromRating(BasicStats.CritRating) * 100f - StatConversion.GetSpellCritFromIntellect(BasicStats.Intellect) * 100f - character.PriestTalents.FocusedWill * 1f).ToString("0.00"), BasicStats.CritRating)); dictValues.Add("Healing Crit", string.Format("{0}%*{1} ({1}%) points in Holy Specialization\r\n{2} ({3}%) points in Renewed Hope", ((BasicStats.SpellCrit * 100f) + character.PriestTalents.HolySpecialization * 1f + character.PriestTalents.RenewedHope * 2f).ToString("0.00"), character.PriestTalents.HolySpecialization, character.PriestTalents.RenewedHope, character.PriestTalents.RenewedHope * 2)); dictValues.Add("Spell Haste", string.Format("{0}%*{1}% from {2} Haste rating\r\n{3}% ({6}) points in Enlightenment\r\n{4}% from Buffs\r\n{5}s Global Cooldown", (BasicStats.SpellHaste * 100f).ToString("0.00"), (StatConversion.GetSpellHasteFromRating(BasicStats.HasteRating) * 100f).ToString("0.00"), BasicStats.HasteRating.ToString(), (character.PriestTalents.Enlightenment * 2).ToString("0"), (((1 + BasicStats.SpellHaste) / (1 + StatConversion.GetSpellHasteFromRating(BasicStats.HasteRating)) / (1 + character.PriestTalents.Enlightenment * 0.02f) - 1) * 100f).ToString("0.00"), Math.Max(1.0f, 1.5f / (1 + BasicStats.SpellHaste)).ToString("0.00"), character.PriestTalents.Enlightenment)); dictValues.Add("Armor", string.Format("{0}*{1}% Damage Reduction.", (BasicStats.Armor + BasicStats.BonusArmor).ToString("0"), (StatConversion.GetArmorDamageReduction(80, (BasicStats.Armor + BasicStats.BonusArmor), 0f, 0f, 0f) * 100f).ToString("0.00"))); float[] Resistances = { 0, BasicStats.ArcaneResistance + BasicStats.ArcaneResistanceBuff, BasicStats.FireResistance + BasicStats.FireResistanceBuff, BasicStats.FrostResistance + BasicStats.FrostResistanceBuff, BasicStats.NatureResistance + BasicStats.NatureResistanceBuff, BasicStats.ShadowResistance + BasicStats.ShadowResistanceBuff, }; string[] ResistanceNames = { "None", "Arcane", "Fire", "Frost", "Nature", "Shadow", }; string ResistanceString = "*Resistances:"; float MaxResist = Resistances[0]; int MaxResistIndex = 0; float AvgResist = 0f; for (int x = 1; x < Resistances.Length; x++) { AvgResist += Resistances[x]; if (Resistances[x] > MaxResist) { MaxResist = Resistances[x]; MaxResistIndex = x; } ResistanceString += string.Format("\r\n{0} : {1}", ResistanceNames[x], Resistances[x]); } AvgResist /= (Resistances.Length - 1); if (AvgResist == 0) { ResistanceString = "None" + ResistanceString; } else { string ResistanceName = (MaxResist == AvgResist) ? "All" : ResistanceNames[MaxResistIndex]; ResistanceString = string.Format("{0} : {1}", ResistanceName, MaxResist.ToString("0")) + ResistanceString; ResistanceString += string.Format("\r\n\r\nResist ({0}):", ResistanceName); ResistanceString += string.Format("\r\n{0}", StatConversion.GetResistanceTableString(character.Level + 3, character.Level, MaxResist, 0)); } dictValues.Add("Resistance", ResistanceString); BaseSolver solver; if ((character.CalculationOptions as CalculationOptionsHealPriest).Role == eRole.CUSTOM) { solver = new AdvancedSolver(BasicStats, character); } else { solver = new Solver(BasicStats, character); } solver.Calculate(this); dictValues.Add("Role", string.Format("{0}*{1}", solver.Role, solver.ActionList)); dictValues.Add("Burst", string.Format("{0}", HPSBurstPoints.ToString("0"))); dictValues.Add("Sustained", string.Format("{0}", HPSSustainPoints.ToString("0"))); dictValues.Add("Renew", new Renew(BasicStats, character).ToString()); dictValues.Add("Flash Heal", new FlashHeal(BasicStats, character).ToString()); dictValues.Add("Greater Heal", new Heal(BasicStats, character).ToString()); dictValues.Add("PoH", new PrayerOfHealing(BasicStats, character).ToString()); dictValues.Add("Binding Heal", new BindingHeal(BasicStats, character).ToString()); dictValues.Add("Prayer of Mending", new PrayerOfMending(BasicStats, character).ToString()); dictValues.Add("Power Word Shield", new PowerWordShield(BasicStats, character).ToString()); dictValues.Add("Holy Nova", new HolyNova(BasicStats, character).ToString()); if (character.PriestTalents.CircleOfHealing > 0) { dictValues.Add("CoH", new CircleOfHealing(BasicStats, character).ToString()); } else { dictValues.Add("CoH", "- *No required talents"); } if (character.PriestTalents.Lightwell > 0) { dictValues.Add("Lightwell", new Lightwell(BasicStats, character).ToString()); } else { dictValues.Add("Lightwell", "- *No required talents"); } if (character.PriestTalents.Penance > 0) { dictValues.Add("Penance", new Penance(BasicStats, character).ToString()); } else { dictValues.Add("Penance", "- *No required talents"); } if (Race == CharacterRace.Draenei) { dictValues.Add("Gift of the Naaru", new GiftOfTheNaaru(BasicStats, character).ToString()); } else { dictValues.Add("Gift of the Naaru", "-"); } dictValues.Add("Divine Hymn", new DivineHymn(BasicStats, character).ToString()); dictValues.Add("Resurrection", new Resurrection(BasicStats, character).ToString()); return(dictValues); }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); Buff activeBuff; string s; Stats baseStats = BaseStats.GetBaseStats(Character); #region General dictValues["Health"] = BasicStats.Health.ToString("0"); dictValues["Mana"] = BasicStats.Mana.ToString("0"); dictValues["Item Level"] = String.Format("{0}*Lowest: {1}\nHighest: {2}", Character.AvgWornItemLevel.ToString("0"), Character.MinWornItemLevel.ToString("0"), Character.MaxWornItemLevel.ToString("0")); dictValues["Speed"] = String.Format("{0}%*{0}% Run speed", ((1f + BasicStats.MovementSpeed) * 100f).ToString("0")); #endregion #region Attributes dictValues["Strength"] = BasicStats.Strength.ToString(); dictValues["Agility"] = BasicStats.Agility.ToString(); dictValues["Stamina"] = BasicStats.Stamina.ToString(); dictValues["Intellect"] = BasicStats.Intellect.ToString(); dictValues["Spirit"] = BasicStats.Spirit.ToString(); #endregion #region Spell #region Spell Power s = String.Empty; float intPower = BasicStats.Intellect - 10; if (BasicStats.InnerFire) { s += String.Format("\n{0} from Inner Fire", PriestInformation.GetInnerFireSpellPowerBonus(Character)); } activeBuff = GetActiveBuffsByGroup("Spell Power"); if (activeBuff != null) { s += makeActiveBuffTextPercent(activeBuff, activeBuff.Stats.BonusSpellPowerMultiplier); } dictValues["Spell Power"] = String.Format("{0}*{1} from {2} Intellect{3}", BasicStats.SpellPower.ToString("0"), intPower.ToString("0"), BasicStats.Intellect.ToString("0"), s ); #endregion #region Haste s = String.Empty; if (Character.PriestTalents.Darkness > 0) { s += String.Format("\n{0}% from {1} points in Darkness", Character.PriestTalents.Darkness, Character.PriestTalents.Darkness); } activeBuff = GetActiveBuffsByGroup("Spell Haste"); if (activeBuff != null) { s += makeActiveBuffTextPercent(activeBuff, activeBuff.Stats.SpellHaste); } activeBuff = GetActiveBuffsByGroup("Dark Intent"); if (activeBuff != null) { s += makeActiveBuffTextPercent(activeBuff, activeBuff.Stats.SpellHaste); } dictValues["Haste"] = String.Format("{0}%*{1}% from {2} Haste Rating{3}", (BasicStats.SpellHaste * 100f).ToString("0.00"), (StatConversion.GetSpellHasteFromRating(BasicStats.HasteRating) * 100f).ToString("0.00"), BasicStats.HasteRating.ToString("0"), s ); #endregion dictValues["Hit"] = (BasicStats.SpellHit * 100f).ToString("0.00"); dictValues["Penetration"] = BasicStats.SpellPenetration.ToString("0"); #region Mana Regen float manaRegen = StatConversion.GetSpiritRegenSec(BasicStats.Spirit, BasicStats.Intellect) * 5f; s = String.Format("\n{0} Mana per 5 sec from Base Mana Regeneration", (baseStats.Mana * 0.05f).ToString("0")); activeBuff = GetActiveBuffsByGroup("Mana Regeneration"); if (activeBuff != null) { s += makeActiveBuffText(activeBuff, activeBuff.Stats.Mp5); } dictValues["Mana Regen"] = String.Format("{0}*{1} from Spirit based regen{2}", (manaRegen + BasicStats.Mp5).ToString("0"), manaRegen.ToString("0"), s ); dictValues["Combat Regen"] = String.Format("{0}*{1} from Spirit based regen{2}", (manaRegen * BasicStats.SpellCombatManaRegeneration + BasicStats.Mp5).ToString("0"), (manaRegen * BasicStats.SpellCombatManaRegeneration).ToString("0"), s ); #endregion #region Crit s = String.Empty; activeBuff = GetActiveBuffsByGroup("Critical Strike Chance"); if (activeBuff != null) { s += makeActiveBuffTextPercent(activeBuff, activeBuff.Stats.SpellCrit); } activeBuff = GetActiveBuffsByGroup("Focus Magic, Spell Critical Strike Chance"); if (activeBuff != null) { s += makeActiveBuffTextPercent(activeBuff, activeBuff.Stats.SpellCrit); } dictValues["Crit Chance"] = String.Format("{0}%*{1}% from {2} Crit Rating\n{3}% from {4} Intellect\n{5}% from Priest base{6}", (BasicStats.SpellCrit * 100f).ToString("0.00"), (StatConversion.GetSpellCritFromRating(BasicStats.CritRating) * 100f).ToString("0.00"), BasicStats.CritRating.ToString("0"), (StatConversion.GetSpellCritFromIntellect(BasicStats.Intellect) * 100f).ToString("0.00"), BasicStats.Intellect.ToString("0"), (baseStats.SpellCrit * 100f).ToString("0.00"), s ); #endregion #region Mastery s = string.Empty; float masteryBase = 0, masteryBonus = 0; if (BasicStats.PriestSpec == ePriestSpec.Spec_Disc) { masteryBase = PriestInformation.DisciplineMasteryBase; masteryBonus = PriestInformation.DisciplineMasteryEffect * 100f; s += String.Format("\n\nEach point of mastery increases the potency of Absorbs by an additional {0}%.", masteryBonus.ToString("0.00")); } else if (BasicStats.PriestSpec == ePriestSpec.Spec_Holy) { masteryBase = PriestInformation.HolyMasteryBase; masteryBonus = PriestInformation.HolyMasteryEffect * 100f; s += String.Format("\n\nEach point of mastery provides an additional {0}% healing over 6 sec.", masteryBonus.ToString("0.00")); } dictValues["Mastery"] = String.Format("{0}%*{1}% from {2} Mastery Rating\n{3}% from {4} Base Mastery{5}", ((StatConversion.GetMasteryFromRating(BasicStats.MasteryRating) + masteryBase) * masteryBonus).ToString("0.00"), (StatConversion.GetMasteryFromRating(BasicStats.MasteryRating) * masteryBonus).ToString("0.00"), BasicStats.MasteryRating.ToString("0"), (masteryBase * masteryBonus).ToString("0.00"), masteryBase.ToString("0"), s ); #endregion #endregion #region Defense dictValues["Armor"] = String.Format("{0}*{1}% physical damage reduction from same level target", BasicStats.Armor.ToString("0"), (StatConversion.GetDamageReductionFromArmor(Character.Level, BasicStats.Armor) * 100f).ToString("0.00")); dictValues["Dodge"] = String.Format("{0}%", (BasicStats.Dodge * 100f).ToString("0.00")); dictValues["Resilience"] = String.Format("{0}*{1}% damage reduction on attacks from other players\n{2}% damage reduction from spells", BasicStats.Resilience.ToString("0"), (StatConversion.GetDamageReductionFromResilience(BasicStats.Resilience) * 100f).ToString("0.00"), (Character.PriestTalents.InnerSanctum * 2f).ToString("0")); #endregion #region Resistance string resistTxt = "{0}*PvP\n{1}\n\nBoss\n{2}"; string[] resistList = { "Arcane", "Fire", "Frost", "Nature", "Shadow" }; float[] resistances = { BasicStats.ArcaneResistance + BasicStats.ArcaneResistanceBuff, BasicStats.FireResistance + BasicStats.FireResistanceBuff, BasicStats.FrostResistance + BasicStats.FrostResistanceBuff, BasicStats.NatureResistance + BasicStats.NatureResistanceBuff, BasicStats.ShadowResistance + BasicStats.ShadowResistanceBuff }; for (int x = 0; x < resistList.Length; x++) { dictValues[resistList[x]] = String.Format(resistTxt, resistances[x].ToString("0"), StatConversion.GetResistanceTableString(Character.Level, Character.Level, resistances[x], 0f), StatConversion.GetResistanceTableString(Character.Level + 3, Character.Level, resistances[x], 0f) ); } #endregion #region Model CalculationOptionsHealPriest calcOpts = Character.CalculationOptions as CalculationOptionsHealPriest; if (calcOpts != null) { PriestSolver solver = PriestModels.GetModel(this, calcOpts, true); solver.Solve(); List <string> reqs = solver.MeetsRequirements(); string disp; if (reqs.Count > 0) { disp = String.Format("{0}\n\n{1}", solver.Name, String.Join("\n", reqs)); } else { disp = solver.Name; } dictValues["Role"] = disp; dictValues["Burst Goal"] = this.BurstGoal.ToString("0"); dictValues["Sust. Goal"] = this.SustainGoal.ToString("0"); dictValues["Mana Goal"] = this.ManaGoal.ToString("0"); dictValues["Burst"] = this.BurstPoints.ToString("0"); dictValues["Sustained"] = this.SustainPoints.ToString("0"); dictValues["Mana "] = this.ManaPoints.ToString("0"); } #endregion #region Holy Spells SpellHeal spellHeal = new SpellHeal(Character, BasicStats); dictValues["Heal"] = String.Format("{0}*{1}", spellHeal.HPS().ToString("0"), spellHeal.ToString()); SpellGreaterHeal spellGreaterHeal = new SpellGreaterHeal(Character, BasicStats); dictValues["Greater Heal"] = String.Format("{0}*{1}", spellGreaterHeal.HPS().ToString("0"), spellGreaterHeal.ToString()); SpellFlashHeal spellFlashHeal = new SpellFlashHeal(Character, BasicStats); dictValues["Flash Heal"] = String.Format("{0}*{1}", spellFlashHeal.HPS().ToString("0"), spellFlashHeal.ToString()); SpellBindingHeal spellBindingHeal = new SpellBindingHeal(Character, BasicStats); dictValues["Binding Heal"] = String.Format("{0}*{1}", spellBindingHeal.HPS().ToString("0"), spellBindingHeal.ToString()); SpellRenew spellRenew = new SpellRenew(Character, BasicStats); dictValues["Renew"] = String.Format("{0}*{1}", spellRenew.HPS().ToString("0"), spellRenew.ToString()); if (Character.PriestTalents.Lightwell > 0) { SpellLightwell spellLW = new SpellLightwell(Character, BasicStats); dictValues["Lightwell"] = String.Format("{0}*{1}", spellLW.HPS().ToString("0"), spellLW.ToString()); } else { dictValues["Lightwell"] = "N/A*You do not have the talent required."; } SpellPrayerOfHealing spellProH = new SpellPrayerOfHealing(Character, BasicStats); dictValues["ProH"] = String.Format("{0}*{1}", spellProH.HPS().ToString("0"), spellProH.ToString()); SpellHolyNova spellHolyNova = new SpellHolyNova(Character, BasicStats); dictValues["Holy Nova"] = String.Format("NYI*{1}", spellHolyNova.HPS().ToString("0"), spellHolyNova.ToString()); if (Character.PriestTalents.CircleOfHealing > 0) { SpellCircleOfHealing spellCoH = new SpellCircleOfHealing(Character, BasicStats); dictValues["CoH"] = String.Format("{0}*{1}", spellCoH.HPS().ToString("0"), spellCoH.ToString()); } else { dictValues["CoH"] = "N/A*You do not have the talent required."; } if (BasicStats.PriestSpec == ePriestSpec.Spec_Disc) { SpellPenance spellPenance = new SpellPenance(Character, BasicStats); dictValues["Penance"] = String.Format("{0}*{1}", spellPenance.HPS().ToString("0"), spellPenance.ToString()); } else { dictValues["Penance"] = "N/A*You do not have the correct Talent specialization."; } if (Character.PriestTalents.Revelations > 0) { SpellSerenity spellSerenity = new SpellSerenity(Character, BasicStats); dictValues["HW Serenity"] = String.Format("{0}*{1}", spellSerenity.HPS().ToString("0"), spellSerenity.ToString()); SpellSanctuary spellSanctuary = new SpellSanctuary(Character, BasicStats); dictValues["HW Sanctuary"] = String.Format("{0}*{1}", spellSanctuary.HPS().ToString("0"), spellSanctuary.ToString()); } else { dictValues["HW Serenity"] = "N/A*You do not have the talent required."; dictValues["HW Sanctuary"] = "N/A*You do not have the talent required."; } SpellPrayerOfMending spellProM = new SpellPrayerOfMending(Character, BasicStats, 1); dictValues["ProM"] = String.Format("{0}*{1}", spellProM.HPS().ToString("0"), spellProM.ToString()); spellProM = new SpellPrayerOfMending(Character, BasicStats); dictValues["ProM 5 Hits"] = String.Format("{0}*{1}", spellProM.HPS().ToString("0"), spellProM.ToString()); SpellPowerWordShield spellPWS = new SpellPowerWordShield(Character, BasicStats); dictValues["PWS"] = String.Format("{0}*{1}", spellPWS.HPS().ToString("0"), spellPWS.ToString()); SpellDivineHymn spellDivineHymn = new SpellDivineHymn(Character, BasicStats); dictValues["Divine Hymn"] = String.Format("{0}*{1}", spellDivineHymn.HPS().ToString("0"), spellDivineHymn.ToString()); if (Character.Race == CharacterRace.Draenei) { SpellGiftOfTheNaaru spellGoat = new SpellGiftOfTheNaaru(Character, BasicStats); dictValues["Gift of the Naaru"] = String.Format("{0}*{1}", spellGoat.HPS().ToString("0"), spellGoat.ToString()); } else { dictValues["Gift of the Naaru"] = "N/A*You are not a spacegoat!"; } SpellResurrection spellResurrection = new SpellResurrection(Character, BasicStats); dictValues["Resurrection"] = String.Format("{0}*{1}", spellResurrection.CastTime.ToString("0.00"), spellResurrection.ToString()); #endregion #region Shadow Spells #endregion return(dictValues); }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); int levelDifference = TargetLevel - CharacterLevel; float baseMiss = StatConversion.WHITE_MISS_CHANCE_CAP[levelDifference] - BasicStats.PhysicalHit; float baseDodge = StatConversion.WHITE_DODGE_CHANCE_CAP[levelDifference] - StatConversion.GetDodgeParryReducFromExpertise(BasicStats.Expertise); float baseParry = StatConversion.WHITE_PARRY_CHANCE_CAP[levelDifference] - StatConversion.GetDodgeParryReducFromExpertise(BasicStats.Expertise); float capMiss = (float)Math.Ceiling(baseMiss * StatConversion.RATING_PER_PHYSICALHIT); float capDodge = (float)Math.Ceiling(baseDodge * 400f * StatConversion.RATING_PER_EXPERTISE); float capParry = (float)Math.Ceiling(baseParry * 400f * StatConversion.RATING_PER_EXPERTISE); string tipMiss = string.Empty; if (BasicStats.HitRating > capMiss) { tipMiss = string.Format("*Over the cap by {0} Hit Rating", BasicStats.HitRating - capMiss); } else if (BasicStats.HitRating < capMiss) { tipMiss = string.Format("*Under the cap by {0} Hit Rating", capMiss - BasicStats.HitRating); } else { tipMiss = "*Exactly at the cap"; } string tipDodgeParry = string.Empty; if (BasicStats.ExpertiseRating > capDodge) { tipDodgeParry = string.Format("*Over the dodge cap by {0} Expertise Rating\r\n", BasicStats.ExpertiseRating - capDodge); } else if (BasicStats.ExpertiseRating < capDodge) { tipDodgeParry = string.Format("*Under the dodge cap by {0} Expertise Rating\r\n", capDodge - BasicStats.ExpertiseRating); } else { tipDodgeParry = "*Exactly at the dodge cap"; } if (BasicStats.ExpertiseRating > capParry) { tipDodgeParry += string.Format("Over the parry cap by {0} Expertise Rating", BasicStats.ExpertiseRating - capParry); } else if (BasicStats.ExpertiseRating < capParry) { tipDodgeParry += string.Format("Under the parry cap by {0} Expertise Rating", capParry - BasicStats.ExpertiseRating); } else { tipDodgeParry += "Exactly at the parry cap"; } int armorCap = (int)Math.Ceiling(6502.5f * TargetLevel - 474502.5f); float levelDifferenceAvoidance = 0.002f * levelDifference; float targetCritReduction = StatConversion.NPC_LEVEL_CRIT_MOD[levelDifference]; /*int defToCap = 0, resToCap = 0; * if (CritReduction < targetCritReduction) * { * //while (((float)Math.Floor((BasicStats.DefenseRating + defToCap) / (123f / 52f)) * 0.04f) * //+ BasicStats.Resilience / (2050f / 52f) + BasicStats.CritChanceReduction < targetCritReduction) * // defToCap++; * //while (((float)Math.Floor(BasicStats.DefenseRating / (123f / 52f)) * 0.04f) * //+ (BasicStats.Resilience + resToCap) / (2050f / 52f) + BasicStats.CritChanceReduction < targetCritReduction) * // resToCap++; * while (((float)Math.Floor(StatConversion.GetDefenseFromRating(BasicStats.DefenseRating + defToCap)) * 0.0004f) + StatConversion.GetCritReductionFromResilience(BasicStats.Resilience) + BasicStats.CritChanceReduction < targetCritReduction) + defToCap++; + while (((float)Math.Floor(StatConversion.GetDefenseFromRating(BasicStats.DefenseRating)) * 0.0004f) + StatConversion.GetCritReductionFromResilience(BasicStats.Resilience + resToCap) + BasicStats.CritChanceReduction < targetCritReduction) + resToCap++; + } + else if (CritReduction > targetCritReduction) + { + //while (((float)Math.Floor((BasicStats.DefenseRating + defToCap) / (123f / 52f)) * 0.04f) + //+ BasicStats.Resilience / (2050f / 52f) + BasicStats.CritChanceReduction > targetCritReduction) + // defToCap--; + //while (((float)Math.Floor(BasicStats.DefenseRating / (123f / 52f)) * 0.04f) + //+ (BasicStats.Resilience + resToCap) / (2050f / 52f) + BasicStats.CritChanceReduction > targetCritReduction) + // resToCap--; + + while (((float)Math.Floor(StatConversion.GetDefenseFromRating(BasicStats.DefenseRating + defToCap)) * 0.0004f) + StatConversion.GetCritReductionFromResilience(BasicStats.Resilience) + BasicStats.CritChanceReduction > targetCritReduction) + defToCap--; + while (((float)Math.Floor(StatConversion.GetDefenseFromRating(BasicStats.DefenseRating)) * 0.0004f) + StatConversion.GetCritReductionFromResilience(BasicStats.Resilience + resToCap) + BasicStats.CritChanceReduction > targetCritReduction) + resToCap--; + defToCap++; + resToCap++; + }*/ // Changed to not just give a resist rating, but a breakdown of the resulting resist values in the tooltip string tipResist = string.Empty; tipResist = StatConversion.GetResistanceTableString(TargetLevel, CharacterLevel, BasicStats.NatureResistance, 0); dictValues.Add("Nature Resist", BasicStats.NatureResistance.ToString() + "*" + tipResist); tipResist = StatConversion.GetResistanceTableString(TargetLevel, CharacterLevel, BasicStats.ArcaneResistance, 0); dictValues.Add("Arcane Resist", BasicStats.ArcaneResistance.ToString() + "*" + tipResist); tipResist = StatConversion.GetResistanceTableString(TargetLevel, CharacterLevel, BasicStats.FrostResistance, 0); dictValues.Add("Frost Resist", BasicStats.FrostResistance.ToString() + "*" + tipResist); tipResist = StatConversion.GetResistanceTableString(TargetLevel, CharacterLevel, BasicStats.FireResistance, 0); dictValues.Add("Fire Resist", BasicStats.FireResistance.ToString() + "*" + tipResist); tipResist = StatConversion.GetResistanceTableString(TargetLevel, CharacterLevel, BasicStats.ShadowResistance, 0); dictValues.Add("Shadow Resist", BasicStats.ShadowResistance.ToString() + "*" + tipResist); dictValues.Add("Health", BasicStats.Health.ToString()); dictValues.Add("Agility", BasicStats.Agility.ToString()); dictValues.Add("Armor", BasicStats.Armor.ToString()); dictValues.Add("Stamina", BasicStats.Stamina.ToString()); dictValues.Add("Dodge Rating", BasicStats.DodgeRating.ToString()); dictValues.Add("Mastery", string.Format("{0}*{1} Mastery Rating", StatConversion.GetMasteryFromRating(BasicStats.MasteryRating) + 8f, BasicStats.MasteryRating.ToString())); dictValues.Add("Resilience", BasicStats.Resilience.ToString()); dictValues.Add("Dodge", Dodge.ToString("0.000%")); dictValues.Add("Miss", Miss.ToString("0.000%")); if (BasicStats.Armor == armorCap) { dictValues.Add("Armor Damage Reduction", DamageReductionFromArmor.ToString("0.000%") + string.Format("*Exactly at the armor cap against level {0} mobs.", TargetLevel)); } else if (BasicStats.Armor > armorCap) { dictValues.Add("Armor Damage Reduction", DamageReductionFromArmor.ToString("0.000%") + string.Format("*Over the armor cap by {0} armor.", BasicStats.Armor - armorCap)); } else { dictValues.Add("Armor Damage Reduction", DamageReductionFromArmor.ToString("0.000%") + string.Format("*Short of the armor cap by {0} armor.", armorCap - BasicStats.Armor)); } dictValues.Add("Total Damage Reduction", TotalConstantDamageReduction.ToString("0.000%")); dictValues.Add("Avoidance PreDR", AvoidancePreDR.ToString("0.000%")); dictValues.Add("Avoidance PostDR", AvoidancePostDR.ToString("0.000%")); dictValues.Add("Total Mitigation", TotalMitigation.ToString("0.000%")); dictValues.Add("Damage Taken", DamageTaken.ToString("0.000%")); dictValues.Add("Savage Defense", string.Format( "{0} ~ {1}*{0} chance to absorb incoming hit\r\n{1} absorbed per hit\r\n{2} of incoming damage absorbed", SavageDefenseChance.ToString("0.000%"), SavageDefenseValue, SavageDefensePercent.ToString("0.000%"))); dictValues.Add("Chance to be Crit", ((0.05f + levelDifferenceAvoidance) - CritReduction).ToString("0.000%")); dictValues.Add("Overall Points", OverallPoints.ToString()); dictValues.Add("Mitigation Points", MitigationPoints.ToString()); dictValues.Add("Survival Points", string.Format("{0}*{1} Before Soft Cap", SurvivabilityPoints.ToString(), SurvivalPointsRaw.ToString())); dictValues.Add("Threat Points", ThreatPoints.ToString()); dictValues["Nature Survival"] = NatureSurvivalPoints.ToString(); dictValues["Frost Survival"] = FrostSurvivalPoints.ToString(); dictValues["Fire Survival"] = FireSurvivalPoints.ToString(); dictValues["Shadow Survival"] = ShadowSurvivalPoints.ToString(); dictValues["Arcane Survival"] = ArcaneSurvivalPoints.ToString(); dictValues["Strength"] = BasicStats.Strength.ToString(); dictValues["Attack Power"] = string.Format("{0}*{1} with Vengeance", (BasicStats.AttackPower - AverageVengeanceAP), BasicStats.AttackPower); dictValues["Average Vengeance AP"] = AverageVengeanceAP.ToString("N1"); dictValues["Crit Rating"] = BasicStats.CritRating.ToString(); dictValues["Hit Rating"] = BasicStats.HitRating.ToString() + tipMiss; dictValues["Expertise Rating"] = BasicStats.ExpertiseRating.ToString() + tipDodgeParry; dictValues["Haste Rating"] = string.Format("{0}*{1}sec Attack Speed", BasicStats.HasteRating, AttackSpeed.ToString("0.000")); //dictValues["Armor Penetration Rating"] = BasicStats.ArmorPenetrationRating.ToString(); dictValues["Avoided Attacks"] = String.Format("{0}*{1} Missed\r\n{2} Dodged\r\n{3} Parried", AvoidedAttacks.ToString("0.000%"), MissedAttacks.ToString("0.000%"), DodgedAttacks.ToString("0.000%"), ParriedAttacks.ToString("0.000%")); dictValues["Highest DPS Rotation"] = HighestDPSRotation.Name; dictValues["Highest TPS Rotation"] = HighestTPSRotation.Name; dictValues["Swipe Rotation"] = ""; dictValues["Custom Rotation"] = ""; //string rotationFormat = "{0} DPS, {1} TPS*{2}"; //dictValues["Highest DPS Rotation"] = String.Format(rotationFormat, Math.Round(HighestDPSRotation.DPS), Math.Round(HighestDPSRotation.TPS), GetRotationTooltip(HighestDPSRotation.Name)); //dictValues["Highest TPS Rotation"] = String.Format(rotationFormat, Math.Round(HighestTPSRotation.DPS), Math.Round(HighestTPSRotation.TPS), GetRotationTooltip(HighestTPSRotation.Name)); //dictValues["Swipe Rotation"] = String.Format(rotationFormat, Math.Round(SwipeRotation.DPS), Math.Round(SwipeRotation.TPS), GetRotationTooltip(SwipeRotation.Name)); //dictValues["Custom Rotation"] = String.Format(rotationFormat, Math.Round(CustomRotation.DPS), Math.Round(CustomRotation.TPS), GetRotationTooltip(CustomRotation.Name)); dictValues["Melee"] = Abilities.MeleeStats.ToString(); dictValues["Maul"] = Abilities.MaulStats.ToString(); dictValues["Mangle"] = Abilities.MangleStats.ToString(); dictValues["Lacerate"] = Abilities.LacerateStats.ToString(); dictValues["Pulverize"] = Abilities.PulverizeStats.ToString(); dictValues["Swipe"] = Abilities.SwipeStats.ToString(); dictValues["Thrash"] = Abilities.ThrashStats.ToString(); dictValues["Faerie Fire"] = Abilities.FaerieFireStats.ToString(); dictValues["Thorns"] = Abilities.ThornsStats.ToString(); //string attackFormat = "{0} Dmg, {1} Threat*Per Hit: {0} Damage, {1} Threat\r\nPer Average Swing: {2} Damage, {3} Threat"; //string attackFormatWithRage = attackFormat + "\r\nThreat Per Rage: {4}\r\nDamage Per Rage: {5}"; //dictValues["Melee"] = String.Format(attackFormat, MeleeDamageRaw, MeleeThreatRaw, MeleeDamageAverage, MeleeThreatAverage); //dictValues["Maul"] = String.Format(attackFormatWithRage, MaulDamageRaw, MaulThreatRaw, MaulDamageAverage, MaulThreatAverage, MaulTPR, MaulDPR); //dictValues["Mangle"] = String.Format(attackFormatWithRage, MangleDamageRaw, MangleThreatRaw, MangleDamageAverage, MangleThreatAverage, MangleTPR, MangleDPR); //dictValues["Swipe"] = String.Format(attackFormatWithRage, SwipeDamageRaw, SwipeThreatRaw, SwipeDamageAverage, SwipeThreatAverage, SwipeTPR, SwipeDPR); //dictValues["Faerie Fire"] = String.Format(attackFormat, FaerieFireDamageRaw, FaerieFireThreatRaw, FaerieFireDamageAverage, FaerieFireThreatAverage); //dictValues["Lacerate"] = String.Format(attackFormatWithRage, LacerateDamageRaw, LacerateThreatRaw, LacerateDamageAverage, LacerateThreatAverage, LacerateTPR, LacerateDPR); //dictValues["Lacerate DoT Tick"] = String.Format(attackFormat, LacerateDotDamageRaw, LacerateDotThreatRaw, LacerateDotDamageAverage, LacerateDotThreatAverage).Replace("Swing", "Tick"); return(dictValues); }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); CalculationOptionsShadowPriest calcOpts = character.CalculationOptions as CalculationOptionsShadowPriest; BossOptions BossOpts = character.BossOptions; Stats baseStats = BaseStats.GetBaseStats(character.Level, character.Class, character.Race); bool Ptr = calcOpts.PTR; dictValues.Add("Health", BasicStats.Health.ToString()); float ResilienceCap = 0.15f, ResilienceFromRating = StatConversion.GetCritReductionFromResilience(1); float Resilience = StatConversion.GetCritReductionFromResilience(BasicStats.Resilience); dictValues.Add("Resilience", string.Format("{0}*-{1}% Damage from DoT and Mana Drains\n\r-{1}% Chance to be crit\r\n-{2}% Damage from Crits.\r\n{3}", BasicStats.Resilience.ToString(), (Resilience * 100f).ToString("0.00"), (Resilience * 100f * 2.2f).ToString("0.00"), (Resilience > ResilienceCap) ? (string.Format("{0} rating above cap", ((float)Math.Floor((Resilience - ResilienceCap) / ResilienceFromRating)).ToString("0"))) : (string.Format("{0} rating below cap", ((float)Math.Ceiling((ResilienceCap - Resilience) / ResilienceFromRating)).ToString("0"))))); dictValues.Add("Stamina", BasicStats.Stamina.ToString()); dictValues.Add("Mana", BasicStats.Mana.ToString()); dictValues.Add("Intellect", BasicStats.Intellect.ToString()); dictValues.Add("Spirit", Math.Floor(BasicStats.Spirit).ToString("0")); dictValues.Add("Spell Power", String.Format("{0}*{1} Bonus Shadow\r\n{2} Bonus Holy\r\n{3} from Inner Fire", Math.Floor(BasicStats.SpellPower), Math.Floor(BasicStats.SpellPower + BasicStats.SpellShadowDamageRating), Math.Floor(BasicStats.SpellPower /*+ BasicStats.SpellHolyDamageRating*/), BasicStats.PriestInnerFire * CalculationsShadowPriest.GetInnerFireSpellPowerBonus(character))); dictValues.Add("Regen", String.Format("{0}*MP5: {1}\r\nOutFSR: {2}", RegenInFSR.ToString("0"), BasicStats.Mp5.ToString(), RegenOutFSR.ToString("0"))); dictValues.Add("Crit", string.Format("{0}%*{1}% from {2} Spell Crit rating\r\n{3}% from Intellect\r\n{4}% from Focused Will\r\n{5}% from Base Crit\r\n{6}% from Buffs\r\n{7}% on Mind Blast, Mind Flay and Mind Sear.\r\n{8}% on VT, SW:P and DP\r\n{9}% on Smite, Holy Fire and Penance.", (BasicStats.SpellCrit * 100f).ToString("0.00"), (StatConversion.GetSpellCritFromRating(BasicStats.CritRating) * 100f).ToString("0.00"), BasicStats.CritRating.ToString("0"), (StatConversion.GetSpellCritFromIntellect(BasicStats.Intellect) * 100f).ToString("0.00"), character.PriestTalents.FocusedWill, (baseStats.SpellCrit * 100f).ToString("0.00"), (BasicStats.SpellCrit * 100f - StatConversion.GetSpellCritFromRating(BasicStats.CritRating) * 100f - StatConversion.GetSpellCritFromIntellect(BasicStats.Intellect) * 100f - baseStats.SpellCrit * 100f - character.PriestTalents.FocusedWill).ToString("0.00"), (BasicStats.SpellCrit * 100f + character.PriestTalents.MindMelt * 2f).ToString("0.00"), (BasicStats.SpellCrit * 100f + character.PriestTalents.MindMelt * 3f).ToString("0.00"), (BasicStats.SpellCrit * 100f + character.PriestTalents.HolySpecialization * 1f).ToString("0.00"))); #if RAWR3 || SILVERLIGHT float Hit = 100 - (StatConversion.GetSpellMiss(character.Level - BossOpts.Level, false) * 100); #else float Hit = 100 - (StatConversion.GetSpellMiss(-calcOpts.TargetLevel, false) * 100); #endif float BonusHit = BasicStats.SpellHit * 100f; float RacialHit = 0; string RacialText = ""; if (character.Race == CharacterRace.Draenei) { RacialHit = 1; RacialText = "1% from Draenei Racial\r\n"; if (!character.ActiveBuffsContains("Heroic Presence")) { BonusHit += 1; } } float DebuffHit = character.PriestTalents.Misery * 1f; if (character.ActiveBuffsConflictingBuffContains("Spell Hit Chance Taken")) { DebuffHit = 3f; } else { BonusHit += DebuffHit; } float RHitRating = 0.01f / StatConversion.GetSpellHitFromRating(1); float ShadowFocusHit = character.PriestTalents.ShadowFocus * 1f; float HitShadow = Hit + BonusHit + ShadowFocusHit; float HitHoly = Hit + BonusHit; dictValues.Add("Hit", string.Format("{0}%*{1}% from {2} Hit Rating\r\n{3}% from Buffs\r\n{4}% from {5} points in Misery\r\n{6}% from {7} points in Shadow Focus\r\n{8}{9}% Hit with Shadow spells, {10}\r\n{11}% Hit with Holy spells, {12}", BonusHit.ToString("0.00"), (StatConversion.GetSpellHitFromRating(BasicStats.HitRating) * 100f).ToString("0.00"), BasicStats.HitRating, (BonusHit - StatConversion.GetSpellHitFromRating(BasicStats.HitRating) * 100f - RacialHit - DebuffHit).ToString("0.00"), DebuffHit, character.PriestTalents.Misery, ShadowFocusHit, character.PriestTalents.ShadowFocus, RacialText, HitShadow.ToString("0.00"), (HitShadow > 100f) ? string.Format("{0} hit rating above cap", Math.Floor((HitShadow - 100f) * RHitRating)) : string.Format("{0} hit rating below cap", Math.Ceiling((100f - HitShadow) * RHitRating)), HitHoly.ToString("0.00"), (HitHoly > 100f) ? string.Format("{0} hit rating above cap", Math.Floor((HitHoly - 100f) * RHitRating)) : string.Format("{0} hit rating below cap", Math.Ceiling((100f - HitHoly) * RHitRating)))); dictValues.Add("Haste", string.Format("{0}%*{1}% from {2} Haste rating\r\n{3}% ({6}) points in Enlightenment\r\n{4}% from Buffs\r\n{5}s Global Cooldown", (BasicStats.SpellHaste * 100f).ToString("0.00"), (StatConversion.GetSpellHasteFromRating(BasicStats.HasteRating) * 100f).ToString("0.00"), BasicStats.HasteRating.ToString(), (character.PriestTalents.Enlightenment * 2).ToString("0"), (((1f + BasicStats.SpellHaste) / (1f + StatConversion.GetSpellHasteFromRating(BasicStats.HasteRating)) / (1f + character.PriestTalents.Enlightenment * 0.02f) - 1f) * 100f).ToString("0.00"), Math.Max(1.0f, 1.5f / (1 + BasicStats.SpellHaste)).ToString("0.00"), character.PriestTalents.Enlightenment)); dictValues.Add("Armor", string.Format("{0}*{1}% Damage Reduction.", (BasicStats.Armor + BasicStats.BonusArmor).ToString("0"), (StatConversion.GetArmorDamageReduction(80, (BasicStats.Armor + BasicStats.BonusArmor), 0f, 0f, 0f) * 100f).ToString("0.00"))); float[] Resistances = { 0, BasicStats.ArcaneResistance + BasicStats.ArcaneResistanceBuff, BasicStats.FireResistance + BasicStats.FireResistanceBuff, BasicStats.FrostResistance + BasicStats.FrostResistanceBuff, BasicStats.NatureResistance + BasicStats.NatureResistanceBuff, BasicStats.ShadowResistance + BasicStats.ShadowResistanceBuff, }; string[] ResistanceNames = { "None", "Arcane", "Fire", "Frost", "Nature", "Shadow", }; string ResistanceString = "*Resistances:"; float MaxResist = Resistances[0]; int MaxResistIndex = 0; float AvgResist = 0f; for (int x = 1; x < Resistances.Length; x++) { AvgResist += Resistances[x]; if (Resistances[x] > MaxResist) { MaxResist = Resistances[x]; MaxResistIndex = x; } ResistanceString += string.Format("\r\n{0} : {1}", ResistanceNames[x], Resistances[x]); } AvgResist /= (Resistances.Length - 1); if (AvgResist == 0) { ResistanceString = "None" + ResistanceString; } else { string ResistanceName = (MaxResist == AvgResist) ? "All" : ResistanceNames[MaxResistIndex]; ResistanceString = string.Format("{0} : {1}", ResistanceName, MaxResist.ToString("0")) + ResistanceString; ResistanceString += string.Format("\r\n\r\nResist ({0}):", ResistanceName); ResistanceString += string.Format("\r\n{0}", StatConversion.GetResistanceTableString(character.Level + 3, character.Level, MaxResist, 0)); } dictValues.Add("Resistance", ResistanceString); SolverBase solver = GetSolver(character, BasicStats); solver.Calculate(this); dictValues.Add("Rotation", string.Format("{0}*{1}", solver.Name, solver.Rotation)); if (solver.SpellSimulation != null) { String s = "Spell Cast List:"; int i = 0; foreach (Spell spell in solver.SpellSimulation) { if (i++ % 10 == 0) { s += "\r\n"; } s += ", " + spell.Name; } s += "\r\n---Repeat---"; dictValues.Add("Castlist", string.Format("{0}*{1}", solver.SpellSimulation.Count, s)); } else { dictValues.Add("Castlist", "Empty"); } dictValues.Add("DPS", string.Format("{0}*Damage Pr Second", solver.DPS.ToString("0"))); //dictValues.Add("SustainDPS", string.Format("{0}*Mana restrained DPS", solver.SustainDPS.ToString("0"))); float baseMana = BaseStats.GetBaseStats(character).Mana; dictValues.Add("SW Pain", new ShadowWordPain(BasicStats, character, baseMana, Ptr).ToString()); DevouringPlague dp = new DevouringPlague(BasicStats, character, baseMana, Ptr); dictValues.Add("Devouring Plague", dp.ToString()); if (dp.ImprovedDP != null) { dictValues.Add("Imp. Devouring Plague", dp.ImprovedDP.ToString()); } else { dictValues.Add("Imp. Devouring Plague", "- *No required talents"); } dictValues.Add("SW Death", new ShadowWordDeath(BasicStats, character, baseMana, Ptr).ToString()); dictValues.Add("Mind Blast", new MindBlast(BasicStats, character, baseMana, Ptr).ToString()); dictValues.Add("PW Shield", new PowerWordShield(BasicStats, character, baseMana, Ptr).ToString()); if (character.PriestTalents.VampiricTouch > 0) { dictValues.Add("Vampiric Touch", new VampiricTouch(BasicStats, character, baseMana, Ptr).ToString()); } else { dictValues.Add("Vampiric Touch", "- *No required talents"); } if (character.PriestTalents.MindFlay > 0) { dictValues.Add("Mind Flay", new MindFlay(BasicStats, character, baseMana, Ptr).ToString()); } else { dictValues.Add("Mind Flay", "- *No required talents"); } dictValues.Add("Shadowfiend", new Shadowfiend(BasicStats, character, baseMana, Ptr).ToString()); dictValues.Add("Smite", new Smite(BasicStats, character, baseMana, Ptr).ToString()); dictValues.Add("Holy Fire", new HolyFire(BasicStats, character, baseMana, Ptr).ToString()); if (character.PriestTalents.Penance > 0) { dictValues.Add("Penance", new Penance(BasicStats, character, baseMana, Ptr).ToString()); } else { dictValues.Add("Penance", "- *No required talents"); } return(dictValues); }