コード例 #1
0
    public string GetEnhancementStringLong()
    {
        string str1;

        if (this.Enh < 0)
        {
            str1 = string.Empty;
        }
        else
        {
            StringBuilder stringBuilder = new StringBuilder();
            bool          flag1         = false;
            bool          flag2         = false;
            bool          flag3         = false;
            bool          flag4         = false;
            bool          flag5         = false;
            IEnhancement  enhancement   = DatabaseAPI.Database.Enhancements[this.Enh];
            if (enhancement.Effect.Length == 0)
            {
                str1 = enhancement.Desc;
            }
            else
            {
                foreach (Enums.sEffect sEffect in enhancement.Effect)
                {
                    if (sEffect.Mode == Enums.eEffMode.FX)
                    {
                        flag1 = true;
                    }
                    if (sEffect.Mode == Enums.eEffMode.Enhancement && sEffect.Schedule != Enums.eSchedule.None)
                    {
                        float scheduleMult = this.GetScheduleMult(enhancement.TypeID, sEffect.Schedule);
                        if ((double)sEffect.Multiplier > 0.0)
                        {
                            scheduleMult *= sEffect.Multiplier;
                        }
                        Enums.eEnhance id = (Enums.eEnhance)sEffect.Enhance.ID;
                        string         str2;
                        if (id == Enums.eEnhance.Mez)
                        {
                            Enums.eMez subId = (Enums.eMez)sEffect.Enhance.SubID;
                            str2 = Enum.GetName(subId.GetType(), subId);
                        }
                        else
                        {
                            str2 = Enum.GetName(id.GetType(), id);
                        }
                        if (sEffect.Enhance.ID == 7 || sEffect.Enhance.ID == 8 || sEffect.Enhance.ID == 17)
                        {
                            str2  = !flag2 ? "Heal" : string.Empty;
                            flag2 = true;
                        }
                        else if (sEffect.Enhance.ID == 10 || sEffect.Enhance.ID == 11 && !flag5)
                        {
                            str2  = !flag3 ? "Jump" : string.Empty;
                            flag3 = true;
                        }
                        else if (sEffect.Enhance.ID == 5 || sEffect.Enhance.ID == 16)
                        {
                            str2  = !flag4 ? "EndMod" : string.Empty;
                            flag4 = true;
                        }
                        else if (((enhancement.Name.IndexOf("Slow", StringComparison.Ordinal) > -1 ? 1 : 0) & (sEffect.BuffMode != Enums.eBuffDebuff.DeBuffOnly ? 0 : (sEffect.Enhance.ID == 6 || sEffect.Enhance.ID == 11 ? 1 : (sEffect.Enhance.ID == 19 ? 1 : 0)))) != 0 || sEffect.Enhance.ID == 21)
                        {
                            str2  = !flag5 ? "Slow Movement" : string.Empty;
                            flag5 = true;
                        }
                        if (!string.IsNullOrEmpty(str2))
                        {
                            if (stringBuilder.Length > 0)
                            {
                                stringBuilder.Append("\n");
                            }
                            stringBuilder.AppendFormat("{0}  enhancement (Sched. {1}: {2}%)", str2, Enum.GetName(sEffect.Schedule.GetType(), sEffect.Schedule), (scheduleMult * 100f).ToString((IFormatProvider)NumberFormatInfo.CurrentInfo));
                        }
                    }
                }
                if (!flag1)
                {
                    str1 = stringBuilder.ToString();
                }
                else
                {
                    IPower power = new Power(enhancement.GetPower());
                    power.ApplyGrantPowerEffects();
                    int[] returnMask = new int[0];
                    for (int index1 = 0; index1 <= power.Effects.Length - 1; ++index1)
                    {
                        if (power.Effects[index1].EffectType == Enums.eEffectType.GrantPower)
                        {
                            if (stringBuilder.Length > 0)
                            {
                                stringBuilder.Append("\n");
                            }
                            stringBuilder.Append(power.Effects[index1].BuildEffectString(true, "", false, false, false));
                            string empty = string.Empty;
                            for (int idEffect = 0; idEffect <= power.Effects.Length - 1; ++idEffect)
                            {
                                power.Effects[idEffect].Stacking = Enums.eStacking.Yes;
                                power.Effects[idEffect].Buffable = true;
                                if (power.Effects[idEffect].Absorbed_EffectID == index1)
                                {
                                    power.GetEffectStringGrouped(idEffect, ref empty, ref returnMask, false, false, false);
                                }
                                if (returnMask.Length > 0)
                                {
                                    if (stringBuilder.Length > 0)
                                    {
                                        stringBuilder.Append("\n");
                                    }
                                    stringBuilder.AppendFormat("  {0}", empty);
                                    break;
                                }
                            }
                            for (int index2 = 0; index2 <= power.Effects.Length - 1; ++index2)
                            {
                                bool flag6 = false;
                                for (int index3 = 0; index3 <= returnMask.Length - 1; ++index3)
                                {
                                    if (returnMask[index3] == index2)
                                    {
                                        flag6 = true;
                                        break;
                                    }
                                }
                                if (power.Effects[index2].Absorbed_EffectID == index1 && !flag6)
                                {
                                    if (stringBuilder.Length > 0)
                                    {
                                        stringBuilder.Append("\n");
                                    }
                                    power.Effects[index2].Stacking = Enums.eStacking.Yes;
                                    power.Effects[index2].Buffable = true;
                                    stringBuilder.AppendFormat("  {0}", power.Effects[index2].BuildEffectString(false, "", false, false, false));
                                }
                            }
                        }
                        else if (!power.Effects[index1].Absorbed_Effect && power.Effects[index1].EffectType != Enums.eEffectType.Enhancement)
                        {
                            if (stringBuilder.Length > 0)
                            {
                                stringBuilder.Append("\n");
                            }
                            stringBuilder.Append(power.Effects[index1].BuildEffectString(true, "", false, false, false));
                        }
                    }
                    str1 = stringBuilder.ToString().Replace("Slf", "Self").Replace("Tgt", "Target");
                }
            }
        }
        return(str1);
    }
        public void miniPowerInfo(int pIDX)
        {
            if (Locked)
            {
                return;
            }
            IPower power1 = new Power(myPowers[pIDX]);

            power1.AbsorbPetEffects();
            power1.ApplyGrantPowerEffects();
            PopUp.PopupData iPopup = new PopUp.PopupData();
            if (pIDX < 0)
            {
                PopInfo.SetPopup(iPopup);
                ChangedScrollFrameContents();
            }
            else
            {
                int    index1 = iPopup.Add();
                string str1   = "";
                switch (power1.PowerType)
                {
                case Enums.ePowerType.Click:
                    if (power1.ClickBuff)
                    {
                        str1 = "(Click)";
                    }
                    break;

                case Enums.ePowerType.Auto_:
                    str1 = "(Auto)";
                    break;

                case Enums.ePowerType.Toggle:
                    str1 = "(Toggle)";
                    break;
                }
                iPopup.Sections[index1].Add(power1.DisplayName, PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
                iPopup.Sections[index1].Add(str1 + " " + power1.DescShort, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 0);
                string str2 = power1.DescLong.Replace("<br>", "\r\n");
                iPopup.Sections[index1].Add(str1 + " " + str2, PopUp.Colors.Common, 1f, FontStyle.Regular);
                int index2 = iPopup.Add();
                if (power1.EndCost > 0.0)
                {
                    if (power1.ActivatePeriod > 0.0)
                    {
                        iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power1.EndCost / power1.ActivatePeriod) + "/s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    else
                    {
                        iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power1.EndCost), PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                }
                if (power1.EntitiesAutoHit == Enums.eEntity.None | power1.Range > 20.0 & power1.I9FXPresentP(Enums.eEffectType.Mez, Enums.eMez.Taunt))
                {
                    iPopup.Sections[index2].Add("Accuracy:", PopUp.Colors.Title, Utilities.FixDP((float)(MidsContext.Config.BaseAcc * (double)power1.Accuracy * 100.0)) + "%", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.RechargeTime > 0.0)
                {
                    iPopup.Sections[index2].Add("Recharge:", PopUp.Colors.Title, Utilities.FixDP(power1.RechargeTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                int   durationEffectId = power1.GetDurationEffectID();
                float iNum             = 0.0f;
                if (durationEffectId > -1)
                {
                    iNum = power1.Effects[durationEffectId].Duration;
                }
                if (power1.PowerType != Enums.ePowerType.Toggle & power1.PowerType != Enums.ePowerType.Auto_ && iNum > 0.0)
                {
                    iPopup.Sections[index2].Add("Duration:", PopUp.Colors.Title, Utilities.FixDP(iNum) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.Range > 0.0)
                {
                    iPopup.Sections[index2].Add("Range:", PopUp.Colors.Title, Utilities.FixDP(power1.Range) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.Arc > 0)
                {
                    iPopup.Sections[index2].Add("Arc:", PopUp.Colors.Title, Convert.ToString(power1.Arc) + "°", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                else if (power1.Radius > 0.0)
                {
                    iPopup.Sections[index2].Add("Radius:", PopUp.Colors.Title, Convert.ToString(power1.Radius) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                if (power1.CastTime > 0.0)
                {
                    iPopup.Sections[index2].Add("Cast Time:", PopUp.Colors.Title, Utilities.FixDP(power1.CastTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                }
                IPower power2 = power1;
                if (power2.Effects.Length > 0)
                {
                    iPopup.Sections[index2].Add("Effects:", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
                    char[] chArray = { '^' };
                    int    num1    = power2.Effects.Length - 1;
                    for (int index3 = 0; index3 <= num1; ++index3)
                    {
                        if (!((power2.Effects[index3].EffectType != Enums.eEffectType.GrantPower | power2.Effects[index3].Absorbed_Effect) &
                              power2.Effects[index3].EffectType != Enums.eEffectType.RevokePower &
                              power2.Effects[index3].EffectType != Enums.eEffectType.SetMode))
                        {
                            continue;
                        }
                        int index4 = iPopup.Add();
                        power1.Effects[index3].SetPower(power1);
                        string[] strArray = power1.Effects[index3].BuildEffectString().Replace("[", "\r\n").Replace("\r\n", "^").Replace("  ", "").Replace("]", "").Split(chArray);
                        int      num2     = strArray.Length - 1;
                        for (int index5 = 0; index5 <= num2; ++index5)
                        {
                            if (index5 == 0)
                            {
                                iPopup.Sections[index4].Add(strArray[index5], PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 1);
                            }
                            else
                            {
                                iPopup.Sections[index4].Add(strArray[index5], PopUp.Colors.Disabled, 0.9f, FontStyle.Italic, 2);
                            }
                        }
                    }
                }
                PopInfo.SetPopup(iPopup);
                ChangedScrollFrameContents();
            }
        }
コード例 #3
0
        public void miniPowerInfo(int pIDX)
        {
            if (!this.Locked)
            {
                IPower power = new Power(this.myPowers[pIDX]);
                power.AbsorbPetEffects(-1);
                power.ApplyGrantPowerEffects();
                PopUp.PopupData iPopup = default(PopUp.PopupData);
                if (pIDX < 0)
                {
                    this.PopInfo.SetPopup(iPopup);
                    this.ChangedScrollFrameContents();
                }
                else
                {
                    int    index4 = iPopup.Add(null);
                    string str    = "";
                    switch (power.PowerType)
                    {
                    case Enums.ePowerType.Click:
                        if (power.ClickBuff)
                        {
                            str = "(Click)";
                        }
                        break;

                    case Enums.ePowerType.Auto_:
                        str = "(Auto)";
                        break;

                    case Enums.ePowerType.Toggle:
                        str = "(Toggle)";
                        break;
                    }
                    iPopup.Sections[index4].Add(power.DisplayName, PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
                    iPopup.Sections[index4].Add(str + " " + power.DescShort, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 0);
                    string str2 = power.DescLong.Replace("<br>", "\r\n");
                    iPopup.Sections[index4].Add(str + " " + str2, PopUp.Colors.Common, 1f, FontStyle.Regular, 0);
                    index4 = iPopup.Add(null);
                    if (power.EndCost > 0f)
                    {
                        if (power.ActivatePeriod > 0f)
                        {
                            iPopup.Sections[index4].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power.EndCost / power.ActivatePeriod) + "/s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                        }
                        else
                        {
                            iPopup.Sections[index4].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power.EndCost), PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                        }
                    }
                    if (power.EntitiesAutoHit == Enums.eEntity.None | (power.Range > 20f & power.I9FXPresentP(Enums.eEffectType.Mez, Enums.eMez.Taunt)))
                    {
                        iPopup.Sections[index4].Add("Accuracy:", PopUp.Colors.Title, Utilities.FixDP(MidsContext.Config.BaseAcc * power.Accuracy * 100f) + "%", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    if (power.RechargeTime > 0f)
                    {
                        iPopup.Sections[index4].Add("Recharge:", PopUp.Colors.Title, Utilities.FixDP(power.RechargeTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    int   durationEffectId = power.GetDurationEffectID();
                    float iNum             = 0f;
                    if (durationEffectId > -1)
                    {
                        iNum = power.Effects[durationEffectId].Duration;
                    }
                    if ((power.PowerType != Enums.ePowerType.Toggle & power.PowerType != Enums.ePowerType.Auto_) && iNum > 0f)
                    {
                        iPopup.Sections[index4].Add("Duration:", PopUp.Colors.Title, Utilities.FixDP(iNum) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    if (power.Range > 0f)
                    {
                        iPopup.Sections[index4].Add("Range:", PopUp.Colors.Title, Utilities.FixDP(power.Range) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    if (power.Arc > 0)
                    {
                        iPopup.Sections[index4].Add("Arc:", PopUp.Colors.Title, Conversions.ToString(power.Arc) + "°", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    else if (power.Radius > 0f)
                    {
                        iPopup.Sections[index4].Add("Radius:", PopUp.Colors.Title, Conversions.ToString(power.Radius) + "ft", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    if (power.CastTime > 0f)
                    {
                        iPopup.Sections[index4].Add("Cast Time:", PopUp.Colors.Title, Utilities.FixDP(power.CastTime) + "s", PopUp.Colors.Title, 0.9f, FontStyle.Bold, 1);
                    }
                    IPower power2 = power;
                    if (power2.Effects.Length > 0)
                    {
                        iPopup.Sections[index4].Add("Effects:", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
                        char[] chArray = new char[]
                        {
                            '^'
                        };
                        int num = power2.Effects.Length - 1;
                        for (int index5 = 0; index5 <= num; index5++)
                        {
                            if ((power2.Effects[index5].EffectType != Enums.eEffectType.GrantPower | power2.Effects[index5].Absorbed_Effect) & power2.Effects[index5].EffectType != Enums.eEffectType.RevokePower & power2.Effects[index5].EffectType != Enums.eEffectType.SetMode)
                            {
                                index4 = iPopup.Add(null);
                                power.Effects[index5].Power = power;
                                string[] strArray = power.Effects[index5].BuildEffectString(false, "", false, false, false).Replace("[", "\r\n").Replace("\r\n", "^").Replace("  ", "").Replace("]", "").Split(chArray);
                                int      num2     = strArray.Length - 1;
                                for (int index6 = 0; index6 <= num2; index6++)
                                {
                                    if (index6 == 0)
                                    {
                                        iPopup.Sections[index4].Add(strArray[index6], PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 1);
                                    }
                                    else
                                    {
                                        iPopup.Sections[index4].Add(strArray[index6], PopUp.Colors.Disabled, 0.9f, FontStyle.Italic, 2);
                                    }
                                }
                            }
                        }
                    }
                    this.PopInfo.SetPopup(iPopup);
                    this.ChangedScrollFrameContents();
                }
            }
        }
コード例 #4
0
        public string GetEnhancementStringLong()
        {
            string str1;

            if (Enh < 0)
            {
                str1 = string.Empty;
            }
            else
            {
                var stringBuilder = new StringBuilder();
                var flag1         = false;
                var flag2         = false;
                var flag3         = false;
                var flag4         = false;
                var flag5         = false;
                var enhancement   = DatabaseAPI.Database.Enhancements[Enh];
                if (enhancement.Effect.Length == 0)
                {
                    str1 = enhancement.Desc;
                }
                else
                {
                    foreach (var sEffect in enhancement.Effect)
                    {
                        switch (sEffect.Mode)
                        {
                        case Enums.eEffMode.FX:
                            flag1 = true;
                            break;

                        case Enums.eEffMode.Enhancement when sEffect.Schedule != Enums.eSchedule.None:
                        {
                            var scheduleMult = GetScheduleMult(enhancement.TypeID, sEffect.Schedule);
                            if (sEffect.Multiplier > 0.0)
                            {
                                scheduleMult *= sEffect.Multiplier;
                            }

                            var    id = (Enums.eEnhance)sEffect.Enhance.ID;
                            string str2;
                            if (id == Enums.eEnhance.Mez)
                            {
                                var subId = (Enums.eMez)sEffect.Enhance.SubID;
                                str2 = Enum.GetName(subId.GetType(), subId);
                            }
                            else
                            {
                                str2 = Enum.GetName(id.GetType(), id);
                            }

                            switch (sEffect.Enhance.ID)
                            {
                            case 7:
                            case 8:
                            case 17:
                                str2  = !flag2 ? "Heal" : string.Empty;
                                flag2 = true;
                                break;

                            case 10:
                            case 11 when !flag5:
                                str2  = !flag3 ? "Jump" : string.Empty;
                                flag3 = true;
                                break;

                            case 5:
                            case 16:
                                str2  = !flag4 ? "EndMod" : string.Empty;
                                flag4 = true;
                                break;

                            default:
                            {
                                if (((enhancement.Name.IndexOf("Slow", StringComparison.Ordinal) > -1 ? 1 : 0) &
                                     (sEffect.BuffMode != Enums.eBuffDebuff.DeBuffOnly ? 0 :
                                      sEffect.Enhance.ID == 6 || sEffect.Enhance.ID == 11 ? 1 :
                                      sEffect.Enhance.ID == 19 ? 1 : 0)) != 0 || sEffect.Enhance.ID == 21)
                                {
                                    str2  = !flag5 ? "Slow Movement" : string.Empty;
                                    flag5 = true;
                                }

                                break;
                            }
                            }

                            if (!string.IsNullOrEmpty(str2))
                            {
                                if (stringBuilder.Length > 0)
                                {
                                    stringBuilder.Append("\n");
                                }
                                stringBuilder.AppendFormat("{0}  enhancement (Sched. {1}: {2}%)", str2,
                                                           Enum.GetName(sEffect.Schedule.GetType(), sEffect.Schedule),
                                                           (scheduleMult * 100f).ToString(NumberFormatInfo.CurrentInfo));
                            }

                            break;
                        }

                        case Enums.eEffMode.PowerEnh:
                            break;

                        case Enums.eEffMode.PowerProc:
                            break;

                        default:
                            throw new ArgumentOutOfRangeException();
                        }
                    }

                    if (!flag1)
                    {
                        str1 = stringBuilder.ToString();
                    }
                    else
                    {
                        IPower power = new Power(enhancement.GetPower());
                        power.ApplyGrantPowerEffects();
                        var returnMask = new int[0];
                        for (var index1 = 0; index1 <= power.Effects.Length - 1; ++index1)
                        {
                            if (power.Effects[index1].EffectType == Enums.eEffectType.GrantPower && power.Effects[index1].CanGrantPower())
                            {
                                if (stringBuilder.Length > 0)
                                {
                                    stringBuilder.Append("\n");
                                }

                                stringBuilder.Append(power.Effects[index1].BuildEffectString(true, "", false, false, false, true));
                                var empty = string.Empty;
                                for (var idEffect = 0; idEffect <= power.Effects.Length - 1; ++idEffect)
                                {
                                    power.Effects[idEffect].Stacking = Enums.eStacking.Yes;
                                    power.Effects[idEffect].Buffable = true;
                                    if (power.Effects[idEffect].Absorbed_EffectID == index1)
                                    {
                                        power.GetEffectStringGrouped(idEffect, ref empty, ref returnMask, false, false);
                                    }

                                    if (returnMask.Length <= 0)
                                    {
                                        continue;
                                    }

                                    if (stringBuilder.Length > 0)
                                    {
                                        stringBuilder.Append("\n");
                                    }

                                    stringBuilder.AppendFormat("  {0}", empty);
                                    break;
                                }

                                for (var index2 = 0; index2 <= power.Effects.Length - 1; ++index2)
                                {
                                    var flag6 = false;
                                    for (var index3 = 0; index3 <= returnMask.Length - 1; ++index3)
                                    {
                                        if (returnMask[index3] != index2)
                                        {
                                            continue;
                                        }
                                        flag6 = true;
                                        break;
                                    }

                                    if (power.Effects[index2].Absorbed_EffectID != index1 || flag6)
                                    {
                                        continue;
                                    }

                                    if (stringBuilder.Length > 0)
                                    {
                                        stringBuilder.Append("\n");
                                    }

                                    power.Effects[index2].Stacking = Enums.eStacking.Yes;
                                    power.Effects[index2].Buffable = true;
                                    stringBuilder.AppendFormat("  {0}", power.Effects[index2].BuildEffectString());
                                }
                            }
                            else if (!power.Effects[index1].Absorbed_Effect && power.Effects[index1].EffectType != Enums.eEffectType.Enhancement)
                            {
                                if (stringBuilder.Length > 0)
                                {
                                    stringBuilder.Append("\n");
                                }

                                stringBuilder.Append(power.Effects[index1].BuildEffectString(true, "", false, false, false, true));
                            }
                        }

                        str1 = stringBuilder.ToString().Replace("Slf", "Self").Replace("Tgt", "Target");
                    }
                }
            }

            return(str1);
        }