/// <param name="stats"> /// This should already have buffStats factored in. /// </param> public CharacterCalculationsWarlock(Character character, Stats stats, Stats petBuffs) { Character = character; CalcOpts = character.CalculationOptions as CalculationOptionsWarlock; BossOpts = character.BossOptions; Talents = character.WarlockTalents; Stats = stats; PreProcStats = Stats.Clone(); PetBuffs = petBuffs; BaseMana = BaseStats.GetBaseStats(character).Mana; BaseIntellect = BaseStats.GetBaseStats(character).Intellect; Spells = new Dictionary <string, Spell>(); CastSpells = new Dictionary <string, Spell>(); HitChance = Math.Min(1f, CalcOpts.GetBaseHitRate() / 100f + CalcSpellHit()); int temp; if (character.SetBonusCount.TryGetValue("Shadowflame Regalia", out temp)) { Warlock_T11_2P = (temp >= 2); Warlock_T11_4P = (temp >= 4); } if (!CalcOpts.Pet.Equals("None") && (Demonology || !CalcOpts.Pet.Equals("Felguard"))) { Type type = Type.GetType("Rawr.Warlock." + CalcOpts.Pet); Pet = (Pet)Activator.CreateInstance(type, new object[] { this }); } float personalDps = CalcPersonalDps(); float petDps = CalcPetDps(); SubPoints = new float[] { personalDps, petDps }; OverallPoints = personalDps + petDps; }
/// <summary> /// Builds a dictionary containing the values to display for each of the /// calculations defined in CharacterDisplayCalculationLabels. The key /// should be the Label of each display calculation, and the value /// should be the value to display, optionally appended with '*' /// followed by any string you'd like displayed as a tooltip on the /// value. /// </summary> /// <returns> /// A Dictionary<string, string> containing the values to display for /// each of the calculations defined in /// CharacterDisplayCalculationLabels. /// </returns> public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); dictValues.Add("Personal DPS", string.Format("{0:0}", PersonalDps)); dictValues.Add("Pet DPS", string.Format("{0:0}", PetDps)); dictValues.Add("Total DPS", string.Format("{0:0}", OverallPoints)); dictValues.Add("Health", string.Format("{0:0}*{1:0} stamina", CalcHealth(), CalcStamina())); dictValues.Add("Mana", string.Format("{0:0}*{1:0} intellect", CalcMana(), CalcIntellect())); dictValues.Add("Spell Power", string.Format("{0:0.0}*{1:0.0}\tBefore Procs", CalcSpellPower(), StatUtils.CalcSpellPower(PreProcStats, BaseIntellect, CalcOpts.PlayerLevel))); #region Hit Rating float onePercentOfHitRating = (1 / StatUtils.GetSpellHitFromRating(1, CalcOpts.PlayerLevel)); float hitFromRating = StatUtils.GetSpellHitFromRating(Stats.HitRating, CalcOpts.PlayerLevel); float hitFromBuffs = (CalcSpellHit() - hitFromRating); float targetHit = CalcOpts.GetBaseHitRate() / 100f; float totalHit = targetHit + CalcSpellHit(); float missChance = totalHit > 1 ? 0 : (1 - totalHit); dictValues.Add( "Hit Rating", string.Format( "{0}*{1:0.00%} Hit Chance (max 100%) | {2:0.00%} Miss Chance \r\n\r\n" + "{3:0.00%}\t Base Hit Chance on a Level {4:0} target\r\n" + "{5:0.00%}\t from {6:0} Hit Rating [gear, food and/or flasks]\r\n" + "{7:0.00%}\t from Buffs: Racial and/or Spell Hit Chance Taken\r\n\r\n" + "You are {8} hit rating {9} the hard cap [no hit from gear, talents or buffs]\r\n\r\n", Stats.HitRating, totalHit, missChance, targetHit, CalcOpts.TargetLevel, hitFromRating, Stats.HitRating, hitFromBuffs, Math.Ceiling(Math.Abs((totalHit - 1) * onePercentOfHitRating)), (totalHit > 1) ? "above" : "below")); #endregion dictValues.Add("Crit Chance", string.Format("{0:0.00%}*{1:0.00%}\tBefore Procs", CalcSpellCrit(), StatUtils.CalcSpellCrit(PreProcStats, BaseIntellect, CalcOpts.PlayerLevel))); dictValues.Add("Average Haste", string.Format( "{0:0.00}%*" + "{1:0.00}%\tfrom {2:0.0} Haste rating\r\n" + "{3:0.00}%\tfrom Buffs\r\n" + "{4:0.0}ish%\tfrom Procs\r\n" + "\r\n" + "{5:0.00}s\tGlobal Cooldown\r\n", (AvgHaste - 1f) * 100f, StatUtils.GetSpellHasteFromRating(Stats.HasteRating, CalcOpts.PlayerLevel) * 100f, Stats.HasteRating, Stats.SpellHaste * 100f, (AvgHaste - StatUtils.CalcSpellHaste(PreProcStats, CalcOpts.PlayerLevel)) * 100f, Math.Max(1.0f, 1.5f / AvgHaste))); dictValues.Add("Mastery", string.Format("{0:0.0}*from {1:0.0} Mastery Rating", CalcMastery(), Stats.MasteryRating)); if (Pet == null) { dictValues.Add("Pet Mana", "-"); dictValues.Add("Basic Melee Damage", "-"); dictValues.Add("Basic Melee DPS", "-"); dictValues.Add("Attack Power", "-"); dictValues.Add("Basic Melee Speed", "-"); dictValues.Add("Spell Damage", "-"); } else { dictValues.Add("Pet Mana", string.Format("{0:0.0}", Pet.CalcMana())); dictValues.Add("Basic Melee Damage", string.Format("{0:0.0}", Pet.CalcMeleeDamage())); dictValues.Add("Basic Melee DPS", string.Format("{0:0.0}", Pet.CalcMeleeDps())); dictValues.Add("Attack Power", string.Format("{0:0.0}", Pet.CalcAttackPower())); dictValues.Add("Basic Melee Speed", string.Format("{0:0.0}", Pet.CalcMeleeSpeed())); dictValues.Add("Spell Damage", string.Format("{0:0.0}", Pet.CalcSpellPower())); } if (Pet is Felhunter) { dictValues.Add("Shadow Bite (Fel Hunter)", string.Format("{0:0.0}", Pet.GetSpecialDamage())); } else { dictValues.Add("Shadow Bite (Fel Hunter)", "-"); } if (Pet is Imp) { dictValues.Add("Fire Bolt (Imp)", string.Format("{0:0.0}", Pet.GetSpecialDamage())); } else { dictValues.Add("Fire Bolt (Imp)", "-"); } if (Pet is Succubus) { dictValues.Add("Lash of Pain (Succubus)", string.Format("{0:0.0}", Pet.GetSpecialDamage())); } else { dictValues.Add("Lash of Pain (Succubus)", "-"); } if (Pet is Felguard) { dictValues.Add("Legion Strike (Felguard)", string.Format("{0:0.0}", Pet.GetSpecialDamage())); } else { dictValues.Add("Legion Strike (Felguard)", "-"); } // Spell Stats foreach (string spellName in Spell.ALL_SPELLS) { if (CastSpells.ContainsKey(spellName)) { dictValues.Add(spellName, CastSpells[spellName].GetToolTip()); } else { dictValues.Add(spellName, "-"); } } return(dictValues); }