Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Compare the output of an ability either Threat or Damage.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <param name="t">Using Death Runes will be total Rune Cost.</param>
        /// <param name="bThreat">True if Threat, False if Damage</param>
        /// <returns></returns>
        public static int CompareXPerCost(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.CastTime:
                aRunes = a.CastTime;
                bRunes = b.CastTime;
                break;

            case DKCostTypes.CooldownTime:
                aRunes = a.Cooldown;
                bRunes = b.Cooldown;
                break;

            case DKCostTypes.DurationTime:
                aRunes = a.uDuration;
                foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility)
                {
                    aRunes += TriggerByA.uDuration;
                }
                bRunes = b.uDuration;
                foreach (AbilityDK_Base TriggerByB in b.ml_TriggeredAbility)
                {
                    bRunes += TriggerByB.uDuration;
                }
                break;

            case DKCostTypes.RunicPower:
                aRunes = a.RunicPower;
                bRunes = b.RunicPower;
                break;

            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.GetTotalThreat();
                        if (a.ml_TriggeredAbility != null)
                        {
                            foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility)
                            {
                                avalue += TriggerByA.GetTotalThreat();
                            }
                        }
                        avalue /= aRunes;
                        bvalue  = b.GetTotalThreat();
                        if (b.ml_TriggeredAbility != null)
                        {
                            foreach (AbilityDK_Base TriggerByA in b.ml_TriggeredAbility)
                            {
                                bvalue += TriggerByA.GetTotalThreat();
                            }
                        }
                        bvalue /= bRunes;
                    }
                    else
                    {
                        // Let's expand this to include triggered values as well.
                        avalue = a.TotalDamage;
                        if (a.ml_TriggeredAbility != null)
                        {
                            foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility)
                            {
                                avalue += TriggerByA.TotalDamage;
                            }
                        }
                        avalue /= aRunes;
                        bvalue  = b.TotalDamage;
                        if (b.ml_TriggeredAbility != null)
                        {
                            foreach (AbilityDK_Base TriggerByA in b.ml_TriggeredAbility)
                            {
                                bvalue += TriggerByA.TotalDamage;
                            }
                        }
                        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);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Compare the output of an ability either Threat or Damage.
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <param name="t">Using Death Runes will be total Rune Cost.</param>
        /// <param name="bThreat">True if Threat, False if Damage</param>
        /// <returns></returns>
        public static int CompareXPerCost(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.CastTime:
                    aRunes = a.CastTime;
                    bRunes = b.CastTime;
                    break;
                case DKCostTypes.CooldownTime:
                    aRunes = a.Cooldown;
                    bRunes = b.Cooldown;
                    break;
                case DKCostTypes.DurationTime:
                    aRunes = a.uDuration;
                    foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility)
                    {
                        aRunes += TriggerByA.uDuration;
                    }
                    bRunes = b.uDuration;
                    foreach (AbilityDK_Base TriggerByB in b.ml_TriggeredAbility)
                    {
                        bRunes += TriggerByB.uDuration;
                    }
                    break;
                case DKCostTypes.RunicPower:
                    aRunes = a.RunicPower;
                    bRunes = b.RunicPower;
                    break;
                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.GetTotalThreat();
                        if (a.ml_TriggeredAbility != null)
                        {
                            foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility)
                            {
                                avalue += TriggerByA.GetTotalThreat();
                            }
                        }
                        avalue /= aRunes;
                        bvalue = b.GetTotalThreat();
                        if (b.ml_TriggeredAbility != null)
                        {
                            foreach (AbilityDK_Base TriggerByA in b.ml_TriggeredAbility)
                            {
                                bvalue += TriggerByA.GetTotalThreat();
                            }
                        }
                        bvalue /= bRunes;
                    }
                    else
                    {
                        // Let's expand this to include triggered values as well.
                        avalue = a.TotalDamage;
                        if (a.ml_TriggeredAbility != null)
                        {
                            foreach (AbilityDK_Base TriggerByA in a.ml_TriggeredAbility)
                            {
                                avalue += TriggerByA.TotalDamage;
                            }
                        }
                        avalue /= aRunes;
                        bvalue = b.TotalDamage;
                        if (b.ml_TriggeredAbility != null)
                        {
                            foreach (AbilityDK_Base TriggerByA in b.ml_TriggeredAbility)
                            {
                                bvalue += TriggerByA.TotalDamage;
                            }
                        }
                        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;
        }
Ejemplo n.º 4
0
 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();
 }