private void PostData(AbilityDK_Base ability) { int i = ability.AbilityIndex; m_Calcs.DPUdamSub[i] = ability.GetTotalDamage(); m_Calcs.DPUthreatSub[i] = ability.GetTotalThreat(); m_Calcs.DPUdpsSub[i] = ability.GetDPS(); m_Calcs.DPUtpsSub[i] = ability.GetTPS(); }
public static int CompareValuePSPerRune(AbilityDK_Base a, AbilityDK_Base b, DKCostTypes t, bool bThreat) { int ic = 0; float aRunes = 1; float bRunes = 1; // Sum of cost: switch (t) { case DKCostTypes.Blood: aRunes = a.AbilityCost[(int)DKCostTypes.Blood]; bRunes = b.AbilityCost[(int)DKCostTypes.Blood]; break; case DKCostTypes.Frost: aRunes = a.AbilityCost[(int)DKCostTypes.Frost]; bRunes = b.AbilityCost[(int)DKCostTypes.Frost]; break; case DKCostTypes.UnHoly: aRunes = a.AbilityCost[(int)DKCostTypes.UnHoly]; bRunes = b.AbilityCost[(int)DKCostTypes.UnHoly]; break; case DKCostTypes.Death: aRunes = a.AbilityCost[(int)DKCostTypes.Blood] + a.AbilityCost[(int)DKCostTypes.Frost] + a.AbilityCost[(int)DKCostTypes.UnHoly]; bRunes = b.AbilityCost[(int)DKCostTypes.Blood] + b.AbilityCost[(int)DKCostTypes.Frost] + b.AbilityCost[(int)DKCostTypes.UnHoly]; break; case DKCostTypes.RunicPower: aRunes = a.RunicPower; bRunes = b.RunicPower; break; case DKCostTypes.CastTime: case DKCostTypes.CooldownTime: case DKCostTypes.DurationTime: default: aRunes = 1; bRunes = 1; break; } if (aRunes != 0 || bRunes != 0) { if (aRunes != 0 && bRunes != 0) { float avalue = 0; float bvalue = 0; if (bThreat) { // Let's expand this to include triggered values as well. avalue = a.GetTPS(); if (a.ml_TriggeredAbility != null) { foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility) { avalue += TriggerByA.GetTPS(); } } avalue /= aRunes; bvalue = b.GetTPS(); if (b.ml_TriggeredAbility != null) { foreach (AbilityDK_Base TriggerByA in b.ml_TriggeredAbility) { bvalue += TriggerByA.GetTPS(); } } bvalue /= bRunes; } else { // Let's expand this to include triggered values as well. avalue = a.GetDPS(); if (a.ml_TriggeredAbility != null) { foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility) { avalue += TriggerByA.GetDPS(); } } avalue /= aRunes; bvalue = b.GetDPS(); if (b.ml_TriggeredAbility != null) { foreach (AbilityDK_Base TriggerByA in b.ml_TriggeredAbility) { bvalue += TriggerByA.GetDPS(); } } bvalue /= bRunes; } if (avalue != bvalue) { // This is setup where we want a descending order. if (avalue > bvalue) { ic = -1; } else { ic = 1; } } } else // one of them are 0 { if (aRunes > bRunes) { ic = -1; } else { ic = 1; } } } return(ic); }
public static int CompareValuePSPerRune(AbilityDK_Base a, AbilityDK_Base b, DKCostTypes t, bool bThreat) { int ic = 0; float aRunes = 1; float bRunes = 1; // Sum of cost: switch (t) { case DKCostTypes.Blood: aRunes = a.AbilityCost[(int)DKCostTypes.Blood]; bRunes = b.AbilityCost[(int)DKCostTypes.Blood]; break; case DKCostTypes.Frost: aRunes = a.AbilityCost[(int)DKCostTypes.Frost]; bRunes = b.AbilityCost[(int)DKCostTypes.Frost]; break; case DKCostTypes.UnHoly: aRunes = a.AbilityCost[(int)DKCostTypes.UnHoly]; bRunes = b.AbilityCost[(int)DKCostTypes.UnHoly]; break; case DKCostTypes.Death: aRunes = a.AbilityCost[(int)DKCostTypes.Blood] + a.AbilityCost[(int)DKCostTypes.Frost] + a.AbilityCost[(int)DKCostTypes.UnHoly]; bRunes = b.AbilityCost[(int)DKCostTypes.Blood] + b.AbilityCost[(int)DKCostTypes.Frost] + b.AbilityCost[(int)DKCostTypes.UnHoly]; break; case DKCostTypes.RunicPower: aRunes = a.RunicPower; bRunes = b.RunicPower; break; case DKCostTypes.CastTime: case DKCostTypes.CooldownTime: case DKCostTypes.DurationTime: default: aRunes = 1; bRunes = 1; break; } if (aRunes != 0 || bRunes != 0) { if (aRunes != 0 && bRunes != 0) { float avalue = 0; float bvalue = 0; if (bThreat) { // Let's expand this to include triggered values as well. avalue = a.GetTPS(); if (a.ml_TriggeredAbility != null) { foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility) { avalue += TriggerByA.GetTPS(); } } avalue /= aRunes; bvalue = b.GetTPS(); if (b.ml_TriggeredAbility != null) { foreach (AbilityDK_Base TriggerByA in b.ml_TriggeredAbility) { bvalue += TriggerByA.GetTPS(); } } bvalue /= bRunes; } else { // Let's expand this to include triggered values as well. avalue = a.GetDPS(); if (a.ml_TriggeredAbility != null) { foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility) { avalue += TriggerByA.GetDPS(); } } avalue /= aRunes; bvalue = b.GetDPS(); if (b.ml_TriggeredAbility != null) { foreach (AbilityDK_Base TriggerByA in b.ml_TriggeredAbility) { bvalue += TriggerByA.GetDPS(); } } bvalue /= bRunes; } if (avalue != bvalue) { // This is setup where we want a descending order. if (avalue > bvalue) ic = -1; else ic = 1; } } else // one of them are 0 { if (aRunes > bRunes) ic = -1; else ic = 1; } } return ic; }