Esempio n. 1
0
 public void Assign(Enums.ShortFX iFX)
 {
     if (iFX.Present)
     {
         this.Index = iFX.Index;
         this.Value = iFX.Value;
         this.Sum   = iFX.Sum;
     }
     else
     {
         this.Index = new int[0];
         this.Value = new float[0];
         this.Sum   = 0.0f;
     }
 }
        string[] GetDamageData(int powerLocation)
        {
            IPower enhancedPower = MainModule.MidsController.Toon.GetEnhancedPower(powerLocation);
            float  damageValue   = enhancedPower.FXGetDamageValue();
            float  rechargeTime  = enhancedPower.RechargeTime;
            float  num           = (float)(Math.Ceiling((double)(enhancedPower.CastTimeReal / 0.132f)) + 1.0) * 0.132f;
            float  endCost       = enhancedPower.EndCost;

            Enums.ShortFX effectMag  = enhancedPower.GetEffectMag(Enums.eEffectType.DamageBuff, Enums.eToWho.Self, false);
            Enums.ShortFX effectMag2 = enhancedPower.GetEffectMag(Enums.eEffectType.Resistance, Enums.eToWho.Target, false);
            effectMag.Multiply();
            effectMag2.Multiply();
            float num2 = damageValue / num;

            string[] strArray;
            if (damageValue != 0f)
            {
                string[] array = new string[]
                {
                    num2.ToString(),
                         damageValue.ToString(),
                         rechargeTime.ToString(),
                         num.ToString(),
                         endCost.ToString(),
                         effectMag.Sum.ToString(),
                         effectMag2.Sum.ToString(),
                         powerLocation.ToString()
                };
                strArray = array;
            }
            else
            {
                string[] array = new string[]
                {
                    "-",
                    "-",
                    rechargeTime.ToString(),
                    num.ToString(),
                    endCost.ToString(),
                    effectMag.Sum.ToString(),
                    effectMag2.Sum.ToString(),
                    powerLocation.ToString()
                };
                strArray = array;
            }
            return(strArray);
        }
Esempio n. 3
0
        string[] GetDamageData(int powerLocation)
        {
            IPower enhancedPower = MainModule.MidsController.Toon.GetEnhancedPower(powerLocation);
            float  damageValue   = enhancedPower.FXGetDamageValue();
            float  rechargeTime  = enhancedPower.RechargeTime;
            float  num1          = (float)(Math.Ceiling((double)enhancedPower.CastTimeReal / 0.131999999284744) + 1.0) * 0.132f;
            float  endCost       = enhancedPower.EndCost;

            Enums.ShortFX effectMag1 = enhancedPower.GetEffectMag(Enums.eEffectType.DamageBuff, Enums.eToWho.Self, false);
            Enums.ShortFX effectMag2 = enhancedPower.GetEffectMag(Enums.eEffectType.Resistance, Enums.eToWho.Target, false);
            effectMag1.Multiply();
            effectMag2.Multiply();
            float num2 = damageValue / num1;

            string[] strArray;
            if (damageValue != 0.0)
            {
                strArray = new string[8]
                {
                    num2.ToString(),
                        damageValue.ToString(),
                        rechargeTime.ToString(),
                        num1.ToString(),
                        endCost.ToString(),
                        effectMag1.Sum.ToString(),
                        effectMag2.Sum.ToString(),
                        powerLocation.ToString()
                }
            }
            ;
            else
            {
                strArray = new string[8]
                {
                    "-",
                    "-",
                    rechargeTime.ToString(),
                    num1.ToString(),
                    endCost.ToString(),
                    effectMag1.Sum.ToString(),
                    effectMag2.Sum.ToString(),
                    powerLocation.ToString()
                }
            };
            return(strArray);
        }

        void lvPower_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            this.lvPower.Sort();
        }

        frmDPSCalc.PowerList[] IncrementRecharge(
            frmDPSCalc.PowerList[] List,
            float Time)
        {
            for (int index1 = 0; index1 < List.Length; ++index1)
            {
                int index2 = index1;
                List[index2].RechargeTimer -= Time;
            }
            return(List);
        }

        void CalculateDPS()
        {
            if (this.ibAutoMode.TextOff == "Automagical")
            {
                frmDPSCalc.PowerList[] array = new frmDPSCalc.PowerList[this.lvPower.Items.Count - 1];
                int length = 0;
                for (int index = 1; index < this.lvPower.Items.Count; ++index)
                {
                    if (this.lvPower.Items[0].Checked || this.lvPower.Items[index].Checked)
                    {
                        array[length].PowerName = this.lvPower.Items[index].Text;
                        if (this.lvPower.Items[index].SubItems[1].Text != "-")
                        {
                            array[length].Damage = float.Parse(this.lvPower.Items[index].SubItems[2].Text);
                            if (!this.chkDamageBuffs.Checked)
                            {
                                IPower basePower = MainModule.MidsController.Toon.GetBasePower(int.Parse(this.lvPower.Items[index].SubItems[8].Text), -1);
                                array[length].Damage += basePower.FXGetDamageValue() * (this.GlobalDamageBuff / 100f);
                            }
                            array[length].DPA      = float.Parse(this.lvPower.Items[index].SubItems[1].Text);
                            array[length].HidenDPA = float.Parse(this.lvPower.Items[index].SubItems[1].Text);
                        }
                        array[length].Recharge         = float.Parse(this.lvPower.Items[index].SubItems[3].Text);
                        array[length].Animation        = float.Parse(this.lvPower.Items[index].SubItems[4].Text);
                        array[length].Endurance        = float.Parse(this.lvPower.Items[index].SubItems[5].Text);
                        array[length].DamageBuff       = float.Parse(this.lvPower.Items[index].SubItems[6].Text);
                        array[length].ResistanceDeBuff = float.Parse(this.lvPower.Items[index].SubItems[7].Text);
                        array[length].RechargeTimer    = -1f;
                        if ((double)array[length].DamageBuff > 0.0 && (double)array[length].DPA != 0.0)
                        {
                            IPower basePower = MainModule.MidsController.Toon.GetBasePower(int.Parse(this.lvPower.Items[index].SubItems[8].Text), -1);
                            array[length].HidenDPA = basePower.FXGetDamageValue();
                            array[length].HidenDPA = array[length].HidenDPA * (array[length].DamageBuff / array[length].Recharge) / array[length].Animation;
                        }
                        ++length;
                    }
                }
                if (length < this.lvPower.Items.Count - 1)
                {
                    frmDPSCalc.PowerList[] powerListArray = array;
                    array = new frmDPSCalc.PowerList[length];
                    for (int index = 0; index < length; ++index)
                    {
                        array[index] = powerListArray[index];
                    }
                }
                if (array.Length > 1)
                {
                    Array.Sort(array, (x, y) => x.HidenDPA.CompareTo(y.HidenDPA));
                    float num1 = array[length - 1].Recharge + 5f;
                    int   num2 = length - 1;
                    while ((double)num1 > 0.0 && num2 > 0)
                    {
                        num1 -= array[num2--].Animation;
                    }
                    frmDPSCalc.PowerList[] List = new frmDPSCalc.PowerList[length - num2];
                    int num3 = 0;
                    for (int index = 0; index < length - num2; ++index)
                    {
                        if ((double)array[length - 1 - index].Recharge <= 20.0)
                        {
                            List[num3++] = array[length - 1 - index];
                        }
                    }
                    float num4 = 0.0f;
                    for (int index = 0; index < List.Length; ++index)
                    {
                        if ((double)num4 < (double)List[index].Recharge)
                        {
                            num4 = List[index].Recharge;
                        }
                    }
                    frmDPSCalc.PowerList[] AttackChain = new frmDPSCalc.PowerList[20];
                    int index1 = 1;
                    int index2 = 1;
                    AttackChain[0] = List[0];
                    float animation = AttackChain[0].Animation;
                    List[0].RechargeTimer = List[0].Recharge;
                    while ((double)animation < (double)num4 + 1.0)
                    {
                        for (int index3 = index1; index3 >= 0; --index3)
                        {
                            if (index1 >= List.Length)
                            {
                                animation += 0.01f;
                                List       = this.IncrementRecharge(List, 0.01f);
                            }
                            else if ((double)List[index3].RechargeTimer <= 0.0)
                            {
                                index1 = index3;
                            }
                        }
                        if (index1 >= List.Length)
                        {
                            --index1;
                            animation += 0.01f;
                            List       = this.IncrementRecharge(List, 0.01f);
                        }
                        while ((double)List[index1].RechargeTimer > 0.0)
                        {
                            ++index1;
                            if (index1 >= List.Length)
                            {
                                index1     = 0;
                                animation += 0.01f;
                                List       = this.IncrementRecharge(List, 0.01f);
                            }
                        }
                        AttackChain[index2] = List[index1];
                        animation          += AttackChain[index2].Animation;
                        List = this.IncrementRecharge(List, AttackChain[index2].Animation);
                        List[index1].RechargeTimer = List[index1].Recharge;
                        ++index1;
                        ++index2;
                    }
                    this.FillAttackChainWindow(AttackChain);
                }
                else if (array.Length == 1)
                {
                    this.tbDPSOutput.Text = "You cannot make an attack chain from one attack";
                }
                else
                {
                    this.tbDPSOutput.Text = "Come on Kiddo, gotta pick something :)";
                }
            }
            else
            {
                float num1 = 0.0f;
                float num2 = 0.0f;
                float num3 = 0.0f;
                bool  flag = true;
                for (int index = 0; index < this.GlobalPowerList.Length; ++index)
                {
                    if ((double)this.GlobalPowerList[index].Damage > 0.0)
                    {
                        num1 += this.GlobalPowerList[index].Damage;
                        num2 += this.GlobalPowerList[index].Endurance;
                        num3 += this.GlobalPowerList[index].Animation;
                        this.GlobalPowerList[index].RechargeTimer = this.GlobalPowerList[index].Recharge;
                    }
                    float animation = this.GlobalPowerList[index].Animation;
                }
                var powerListArray = new PowerList[this.GlobalPowerList.Length * 2];
                int num4           = 0;
                for (int index = 0; index < powerListArray.Length; ++index)
                {
                    if (index > this.GlobalPowerList.Length - 1)
                    {
                        num4 = index - (this.GlobalPowerList.Length - 1) - 1;
                    }
                    powerListArray[index] = this.GlobalPowerList[num4++];
                }
                for (int index1 = 0; index1 < powerListArray.Length; ++index1)
                {
                    for (int index2 = index1 + 1; index2 < powerListArray.Length; ++index2)
                    {
                        if (powerListArray[index1].PowerName != powerListArray[index2].PowerName)
                        {
                            powerListArray[index1].RechargeTimer -= powerListArray[index2].Animation;
                        }
                        else if ((double)powerListArray[index1].RechargeTimer > 0.0)
                        {
                            flag = false;
                        }
                    }
                }
                for (int index1 = powerListArray.Length - 1; index1 >= 0; --index1)
                {
                    for (int index2 = index1 - 1; index2 >= 0; --index2)
                    {
                        if (powerListArray[index1].PowerName != powerListArray[index2].PowerName)
                        {
                            powerListArray[index1].RechargeTimer -= powerListArray[index2].Animation;
                        }
                        else if ((double)powerListArray[index1].RechargeTimer > 0.0)
                        {
                            flag = false;
                        }
                    }
                }
                if (!flag)
                {
                    this.lblHeader.ForeColor = System.Drawing.Color.Red;
                    this.lblHeader.Text      = "Impossible Chain";
                }
                else
                {
                    this.lblHeader.ForeColor = System.Drawing.Color.FromArgb(192, 192, (int)byte.MaxValue);
                    this.lblHeader.Text      = "You may select -All Powers- or just the powers you want to consider.";
                }
                this.lblDPSNum.Text = (num1 / num3).ToString();
                this.lblEPSNum.Text = (num2 / num3).ToString();
            }
        }
Esempio n. 4
0
 // Token: 0x0600010A RID: 266 RVA: 0x0000A4E0 File Offset: 0x000086E0
 public ItemPair(string iName, string iValue, bool iAlternate, bool iProbability, bool iSpecialCase, Enums.ShortFX iTagID)
 {
     this.Name              = iName;
     this.Value             = iValue;
     this.AlternateColour   = iAlternate;
     this.ProbColour        = iProbability;
     this.VerySpecialColour = iSpecialCase;
     this.TagID.Assign(iTagID);
     this.SpecialTip = "";
 }