Пример #1
0
        static Power()
        {
            switch (Settings.OS)
            {
                case Settings.OSType.Mac:
                    _instance = new MacPower();
                    break;
                case Settings.OSType.Linux:
                    _instance = new LinuxPower();
                    break;
                default:
                    _instance = new WindowsPower();
                    break;
            }

            Bus.Subscribe(Bus.Channel.Power, ParseBus);
        }
Пример #2
0
        public string Generate(BinarySwitchPower? power, IPower value)
        {
            if (power != BinarySwitchPower.On || value == null)
            {
                return null;
            }

            foreach (var step in _steps)
            {
                //TODO: add comparison to IPower interface
                if (value.Value <= step.Item1.Value)
                {
                    return step.Item2;
                }
            }

            return null;
        }
Пример #3
0
 public void Init(IPower power)
 {
     Power = power;
     WriteLineWithColor($"方法注入{power.GetType().Name}类型");
 }
Пример #4
0
 public PowerJob(IPower power, IPowerContext powerContext)
 {
     _power        = power;
     _powerContext = powerContext;
 }
Пример #5
0
 public DocPickup(String name, String text, IPower powerScript)
 {
     this.text        = text;
     this.name        = name;
     this.powerScript = powerScript;
 }
 public static string GetRollOverTextLocalized(this IPower item, ILanguages languages,
                                               string language = "English")
 {
     return(languages["stringtablex"][language][item.Rolloverid].Text);
 }
Пример #7
0
 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);
                         frmDPSCalc.PowerList[] array2 = array;
                         int num9 = length;
                         array2[num9].Damage = array2[num9].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 (array[length].DamageBuff > 0f && array[length].DPA != 0f)
                 {
                     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 <frmDPSCalc.PowerList>(array, (frmDPSCalc.PowerList x, frmDPSCalc.PowerList y) => x.HidenDPA.CompareTo(y.HidenDPA));
             float num10 = array[length - 1].Recharge + 5f;
             float num   = num10;
             int   num2  = length - 1;
             while (num > 0f && num2 > 0)
             {
                 num -= array[num2--].Animation;
             }
             frmDPSCalc.PowerList[] List = new frmDPSCalc.PowerList[length - num2];
             int num3 = 0;
             for (int index = 0; index < length - num2; index++)
             {
                 if (array[length - 1 - index].Recharge <= 20f)
                 {
                     List[num3++] = array[length - 1 - index];
                 }
             }
             float num4 = 0f;
             for (int index = 0; index < List.Length; index++)
             {
                 if (num4 < List[index].Recharge)
                 {
                     num4 = List[index].Recharge;
                 }
             }
             frmDPSCalc.PowerList[] AttackChain = new frmDPSCalc.PowerList[20];
             int index2 = 1;
             int index3 = 1;
             AttackChain[0] = List[0];
             float animation = AttackChain[0].Animation;
             List[0].RechargeTimer = List[0].Recharge;
             while (animation < num4 + 1f)
             {
                 for (int index = index2; index >= 0; index--)
                 {
                     if (index2 >= List.Length)
                     {
                         animation += 0.01f;
                         List       = this.IncrementRecharge(List, 0.01f);
                     }
                     else if (List[index].RechargeTimer <= 0f)
                     {
                         index2 = index;
                     }
                 }
                 if (index2 >= List.Length)
                 {
                     index2--;
                     animation += 0.01f;
                     List       = this.IncrementRecharge(List, 0.01f);
                 }
                 while (List[index2].RechargeTimer > 0f)
                 {
                     index2++;
                     if (index2 >= List.Length)
                     {
                         index2     = 0;
                         animation += 0.01f;
                         List       = this.IncrementRecharge(List, 0.01f);
                     }
                 }
                 AttackChain[index3] = List[index2];
                 animation          += AttackChain[index3].Animation;
                 List = this.IncrementRecharge(List, AttackChain[index3].Animation);
                 List[index2].RechargeTimer = List[index2].Recharge;
                 index2++;
                 index3++;
             }
             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 num5 = 0f;
         float num6 = 0f;
         float num7 = 0f;
         bool  flag = true;
         for (int index = 0; index < this.GlobalPowerList.Length; index++)
         {
             if (this.GlobalPowerList[index].Damage > 0f)
             {
                 num5 += this.GlobalPowerList[index].Damage;
                 num6 += this.GlobalPowerList[index].Endurance;
                 num7 += this.GlobalPowerList[index].Animation;
                 this.GlobalPowerList[index].RechargeTimer = this.GlobalPowerList[index].Recharge;
             }
             float animation = this.GlobalPowerList[index].Animation;
         }
         frmDPSCalc.PowerList[] powerListArray2 = new frmDPSCalc.PowerList[this.GlobalPowerList.Length * 2];
         int num8 = 0;
         for (int index = 0; index < powerListArray2.Length; index++)
         {
             if (index > this.GlobalPowerList.Length - 1)
             {
                 num8 = index - (this.GlobalPowerList.Length - 1) - 1;
             }
             powerListArray2[index] = this.GlobalPowerList[num8++];
         }
         for (int index = 0; index < powerListArray2.Length; index++)
         {
             for (int index4 = index + 1; index4 < powerListArray2.Length; index4++)
             {
                 if (powerListArray2[index].PowerName != powerListArray2[index4].PowerName)
                 {
                     frmDPSCalc.PowerList[] array3 = powerListArray2;
                     int num11 = index;
                     array3[num11].RechargeTimer = array3[num11].RechargeTimer - powerListArray2[index4].Animation;
                 }
                 else if (powerListArray2[index].RechargeTimer > 0f)
                 {
                     flag = false;
                 }
             }
         }
         for (int index = powerListArray2.Length - 1; index >= 0; index--)
         {
             for (int index4 = index - 1; index4 >= 0; index4--)
             {
                 if (powerListArray2[index].PowerName != powerListArray2[index4].PowerName)
                 {
                     frmDPSCalc.PowerList[] array4 = powerListArray2;
                     int num12 = index;
                     array4[num12].RechargeTimer = array4[num12].RechargeTimer - powerListArray2[index4].Animation;
                 }
                 else if (powerListArray2[index].RechargeTimer > 0f)
                 {
                     flag = false;
                 }
             }
         }
         if (!flag)
         {
             this.lblHeader.ForeColor = Color.Red;
             this.lblHeader.Text      = "Impossible Chain";
         }
         else
         {
             this.lblHeader.ForeColor = Color.FromArgb(192, 192, 255);
             this.lblHeader.Text      = "You may select -All Powers- or just the powers you want to consider.";
         }
         this.lblDPSNum.Text = (num5 / num7).ToString();
         this.lblEPSNum.Text = (num6 / num7).ToString();
     }
 }
 public void Deactivate(IPower entity)
 {
     entity.Active = false;
     Update(entity);
 }
Пример #9
0
 [InjectionMethod]//方法注入
 public void Init(IPower power)
 {
     this.Power = power;
 }
Пример #10
0
    /*
     * void OnGUI()
     * {
     *  int y = 1;
     *  Rect r;
     *  foreach (PowerPickups p in activePowers) {
     *      r = new Rect(0, Screen.height - 20 * y, 100, 20);
     *      GUI.Box(r, p.getName());
     *      r = new Rect(100, Screen.height - 20 * y, 100, 20);
     *      if (p.powerScript != null)
     *      {
     *          GUI.Box(r, p.powerScript.getName());
     *      }
     *      else {
     *          GUI.Box(r, "NULL");
     *      }
     *      y++;
     *  }
     *  r = new Rect(0, Screen.height - 20 * y, 150, 20);
     *  GUI.Box(r, "Power List Inventory");
     * }
     */
    //Loads the temporary inventory into inventory
    void Start()
    {
        //Reload non-power inventory
        inventoryList.Clear();
        inventoryList = tempInventory.inventoryPickup;
        //Reload power inventory
        Debug.Log("--------------------------------------------------------");
        powerManager = GameObject.Find("Player").GetComponent <Powers>();
        clearPowerSet();
        HashSet <PowerPickups> oldInventory = tempInventory.powerPickup;
        HashSet <PowerPickups> newInventory = new HashSet <PowerPickups>();

        foreach (PowerPickups p in oldInventory)
        {
            if (p.getName().Equals("Circular"))
            {
                //PowerPickups circular = GameObject.Find("Circular");
                newInventory.Add(new PowerPickups("Circular", GameObject.Find("Player").GetComponent <Echo> (), circularAudioLog, circularText));
            }
            else if (p.getName().Equals("Movement"))
            {
                newInventory.Add(new PowerPickups("Movement", GameObject.Find("Player").GetComponent <Movement> (), movementAudioLog, movementText));
            }
            else if (p.getName().Equals("Flashlight"))
            {
                newInventory.Add(new PowerPickups("Flashlight", GameObject.Find("Player").GetComponent <Flashlight> (), flashlightAudioLog, flashlightText));
            }
            else if (p.getName().Equals("Ray"))
            {
                newInventory.Add(new PowerPickups("Ray", GameObject.Find("Player").GetComponent <Ray> (), rayAudioLog, rayText));
            }
            else if (p.getName().Equals("Atium"))
            {
                newInventory.Add(new PowerPickups("Atium", GameObject.Find("Player").GetComponent <Atium> (), atiumAudioLog, atiumText));
            }
            else
            {
                Debug.Log("Temp Inventory Loading Error");
            }
        }
        Debug.Log("Starting Scene: (" + newInventory.Count + ", " + tempInventory.powerPickup.Count + ")");
        mergePowerSet(newInventory);
        IPower movementScript = GameObject.Find("Player").GetComponent <Movement>();

        Debug.Log("Starting Inventory");
        Debug.Log("Movement scripts name : " + movementScript.getName());
        PowerPickups movementPickup = new PowerPickups("Movement", movementScript, movementAudioLog, movementText);

        addToPowerSet(movementPickup);


        Debug.Log("loaded level on player end!");
        if (Title.g_save != null)
        {
            float x = Title.g_save.x;
            float y = Title.g_save.y;
            LinkedList <string> powers = Title.g_save.powers;
            Title.g_save = null;
            Transform t = GetComponent <Transform>();
            t.position = new Vector2(x, y);
            Inventory i = GameObject.Find("Player").GetComponent <Inventory>();
            foreach (string p in powers)
            {
                i.addToPowerSet(new PowerPickups(p, GameObject.Find("Player").GetComponent(p) as IPower, null, null));
                GameObject pickup = GameObject.Find(p);
                if (pickup != null)
                {
                    Destroy(pickup);
                }
            }
        }
    }
Пример #11
0
 public void Init(IPower power)
 {
     Power = power;
 }
Пример #12
0
 public Headphone(IPower power)
 {
     Console.WriteLine($"{this.GetType().Name} 被构造。。。");
 }
Пример #13
0
        bool ParseClasses(string iFileName)
        {
            StreamReader iStream;

            try
            {
                iStream = new StreamReader(iFileName);
            }
            catch (Exception ex)
            {
                Exception ex2 = ex;
                Interaction.MsgBox(ex2.Message, MsgBoxStyle.Critical, "Power CSV Not Opened");
                return(false);
            }
            this.BusyMsg("Working...");
            base.Enabled = false;
            int num  = 0;
            int num2 = 0;
            int num3 = 0;
            int num4 = 0;
            int num5 = DatabaseAPI.Database.Enhancements.Length - 1;

            for (int index = 0; index <= num5; index++)
            {
                IEffect[] effectArray = new IEffect[0];
                if (DatabaseAPI.Database.Enhancements[index].Power != null)
                {
                    DatabaseAPI.Database.Enhancements[index].Power.Effects = effectArray;
                }
            }
            string str = "";
            string str2;

            do
            {
                str2 = FileIO.ReadLineUnlimited(iStream, '\0');
                if (str2 != null)
                {
                    num3++;
                    if (num3 >= 101)
                    {
                        this.BusyMsg(Strings.Format(num, "###,##0") + " records parsed.");
                        Application.DoEvents();
                        num3 = 0;
                    }
                    num++;
                    string[] array = CSV.ToArray(str2);
                    if (array.Length > 0 && (!str2.StartsWith("#") & array[0].StartsWith("Boosts.")))
                    {
                        bool   flag   = true;
                        string uidEnh = array[0];
                        int    index2 = DatabaseAPI.NidFromUidEnhExtended(uidEnh);
                        if (index2 < 0)
                        {
                            flag = false;
                        }
                        if (flag)
                        {
                            num4++;
                            IPower power = DatabaseAPI.Database.Enhancements[index2].Power;
                            power.FullName = uidEnh;
                            string[] strArray = power.FullName.Split(new char[]
                            {
                                '.'
                            });
                            power.GroupName = strArray[0];
                            power.SetName   = strArray[1];
                            power.PowerName = strArray[2];
                            IPower    power2      = power;
                            IEffect[] effectArray = (IEffect[])Utils.CopyArray(power2.Effects, new IEffect[power.Effects.Length + 1]);
                            power2.Effects = effectArray;
                            power.Effects[power.Effects.Length - 1] = new Effect(DatabaseAPI.Database.Enhancements[index2].Power);
                            power.Effects[power.Effects.Length - 1].ImportFromCSV(str2);
                        }
                        else
                        {
                            num2++;
                            str = str + uidEnh + "\r\n";
                        }
                    }
                }
            }while (str2 != null);
            iStream.Close();
            Clipboard.SetDataObject(str);
            Interaction.MsgBox(string.Concat(new string[]
            {
                "Import Completed!\r\nTotal Records: ",
                Conversions.ToString(num),
                "\r\nGood: ",
                Conversions.ToString(num4),
                "\r\nRejected: ",
                Conversions.ToString(num2),
                "\r\nRejected List has been placed on the clipboard. Database will be saved when you click OK"
            }), MsgBoxStyle.Information, "Import Done");
            base.Enabled = true;
            this.BusyHide();
            DatabaseAPI.SaveEnhancementDb();
            this.DisplayInfo();
            return(true);
        }
Пример #14
0
 public FlashPower(IPower next) : base(next)
 {
 }
Пример #15
0
 public void PowerOn(IPower ipower)  //IPower를 매개변수로 가져왔으므로 자식 클래스 전부 받을 수 있음
 {
     ipower.TurnOn();
 }
Пример #16
0
 public UI(ISVGAScreen screen, IMouse mouse, IPower power)
 {
     _screen = screen;
     _mouse = mouse;
     _power = power;
 }
Пример #17
0
 //[InjectionMethod]//方法注入
 public void Init1234(IPower power)
 {
     this.iPower = power;
 }
Пример #18
0
 public void UpdateData(int powerID)
 {
     PopUp.PopupData iPopup = default(PopUp.PopupData);
     if (powerID > -1)
     {
         IPower power = DatabaseAPI.Database.Power[powerID];
         int    index = iPopup.Add(null);
         iPopup.Sections[index].Add(DatabaseAPI.Database.Power[powerID].DisplayName, PopUp.Colors.Title, 1.25f, FontStyle.Bold, 0);
         iPopup.Sections[index].Add("Unbuffed Power Data", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
         index = iPopup.Add(null);
         iPopup.Sections[index].Add("Attributes:", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
         iPopup.Sections[index].Add("Power Type:", PopUp.Colors.Text, Enum.GetName(power.PowerType.GetType(), power.PowerType), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Accuracy:", PopUp.Colors.Text, this.TwoDP(power.Accuracy), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power.ActivatePeriod > 0f)
         {
             iPopup.Sections[index].Add("Activate Interval:", PopUp.Colors.Text, Conversions.ToString(power.ActivatePeriod) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power.Arc > 0)
         {
             iPopup.Sections[index].Add("Arc Radius:", PopUp.Colors.Text, Conversions.ToString(power.Arc) + "°", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power.AttackTypes != Enums.eVector.None)
         {
             int[] values = (int[])Enum.GetValues(power.AttackTypes.GetType());
             bool  flag   = true;
             int   num    = values.Length - 1;
             for (int index2 = 1; index2 <= num; index2++)
             {
                 if ((power.AttackTypes & (Enums.eVector)values[index2]) > Enums.eVector.None)
                 {
                     string iText;
                     if (flag)
                     {
                         iText = "Attack Type(s):";
                         flag  = false;
                     }
                     else
                     {
                         iText = "";
                     }
                     iPopup.Sections[index].Add(iText, PopUp.Colors.Text, Enum.GetName(power.AttackTypes.GetType(), values[index2]), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
                 }
             }
         }
         iPopup.Sections[index].Add("Cast Time:", PopUp.Colors.Text, this.TwoDP(power.CastTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Effect Area:", PopUp.Colors.Text, Enum.GetName(power.EffectArea.GetType(), power.EffectArea), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("End Cost:", PopUp.Colors.Text, this.TwoDP(power.EndCost), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Auto-Hit:", PopUp.Colors.Text, Enum.GetName(power.EntitiesAutoHit.GetType(), power.EntitiesAutoHit), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power.InterruptTime != 0f)
         {
             iPopup.Sections[index].Add("Interrupt:", PopUp.Colors.Text, this.TwoDP(power.InterruptTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         iPopup.Sections[index].Add("Level Available:", PopUp.Colors.Text, Conversions.ToString(power.Level), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Max Targets:", PopUp.Colors.Text, Conversions.ToString(power.MaxTargets), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Notify Mobs:", PopUp.Colors.Text, Enum.GetName(power.AIReport.GetType(), power.AIReport), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power.Radius != 0f)
         {
             iPopup.Sections[index].Add("Radius:", PopUp.Colors.Text, Conversions.ToString(power.Radius) + "ft", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power.Range != 0f)
         {
             iPopup.Sections[index].Add("Range:", PopUp.Colors.Text, Conversions.ToString(power.Range) + "ft", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         iPopup.Sections[index].Add("RechargeTime:", PopUp.Colors.Text, Conversions.ToString(power.RechargeTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Target:", PopUp.Colors.Text, Enum.GetName(power.EntitiesAffected.GetType(), power.EntitiesAffected), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Line of Sight:", PopUp.Colors.Text, Conversions.ToString(power.TargetLoS), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index].Add("Variable:", PopUp.Colors.Text, Conversions.ToString(power.VariableEnabled), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power.VariableEnabled)
         {
             iPopup.Sections[index].Add("Attrib:", PopUp.Colors.Text, power.VariableName, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
             iPopup.Sections[index].Add("Min:", PopUp.Colors.Text, Conversions.ToString(power.VariableMin), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
             iPopup.Sections[index].Add("Max:", PopUp.Colors.Text, Conversions.ToString(power.VariableMax), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
         }
         if (power.Effects.Length > 0)
         {
             index = iPopup.Add(null);
             iPopup.Sections[index].Add("Effects:", PopUp.Colors.Title, 1f, FontStyle.Bold, 0);
             IPower power2  = new Power(DatabaseAPI.Database.Power[powerID]);
             char[] chArray = new char[]
             {
                 '^'
             };
             int num2 = power.Effects.Length - 1;
             for (int index2 = 0; index2 <= num2; index2++)
             {
                 index = iPopup.Add(null);
                 power2.Effects[index2].Power = power2;
                 string[] strArray = power2.Effects[index2].BuildEffectString(false, "", false, false, false).Replace("[", "\r\n").Replace("\r\n", "^").Replace("  ", "").Replace("]", "").Split(chArray);
                 int      num3     = strArray.Length - 1;
                 for (int index3 = 0; index3 <= num3; index3++)
                 {
                     if (index3 == 0)
                     {
                         iPopup.Sections[index].Add(strArray[index3], PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 1);
                     }
                     else
                     {
                         iPopup.Sections[index].Add(strArray[index3], PopUp.Colors.Disabled, 0.9f, FontStyle.Italic, 2);
                     }
                 }
             }
         }
     }
     else
     {
         int index = iPopup.Add(null);
         iPopup.Sections[index].Add("No Power", PopUp.Colors.Title, 1.25f, FontStyle.Bold, 0);
     }
     this.pInfo.SetPopup(iPopup);
     this.pInfo.Width = base.ClientSize.Width;
 }
 public void Update(IPower entity)
 {
     Context.SetModified(entity);
 }
Пример #20
0
 public UI(ISVGAScreen screen, IMouse mouse, IPower power)
 {
     _screen = screen;
     _mouse  = mouse;
     _power  = power;
 }
Пример #21
0
 public void Init(IPower power)
 {
     throw new NotImplementedException();
 }
Пример #22
0
 public Microphone(IPower power)
 {
     Console.WriteLine("Microphone 被构造");
 }
 public void UpdateData(int powerID)
 {
     PopUp.PopupData iPopup = new PopUp.PopupData();
     if (powerID > -1)
     {
         IPower power1 = DatabaseAPI.Database.Power[powerID];
         int    index1 = iPopup.Add();
         iPopup.Sections[index1].Add(DatabaseAPI.Database.Power[powerID].DisplayName, PopUp.Colors.Title, 1.25f);
         iPopup.Sections[index1].Add("Unbuffed Power Data", PopUp.Colors.Title);
         int index2 = iPopup.Add();
         iPopup.Sections[index2].Add("Attributes:", PopUp.Colors.Title);
         iPopup.Sections[index2].Add("Power Type:", PopUp.Colors.Text, Enum.GetName(power1.PowerType.GetType(), power1.PowerType), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Accuracy:", PopUp.Colors.Text, TwoDP(power1.Accuracy), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power1.ActivatePeriod > 0.0)
         {
             iPopup.Sections[index2].Add("Activate Interval:", PopUp.Colors.Text, Convert.ToString(power1.ActivatePeriod) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power1.Arc > 0)
         {
             iPopup.Sections[index2].Add("Arc Radius:", PopUp.Colors.Text, Convert.ToString(power1.Arc) + "°", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (power1.AttackTypes != Enums.eVector.None)
         {
             int[] values = (int[])Enum.GetValues(power1.AttackTypes.GetType());
             bool  flag   = true;
             int   num    = values.Length - 1;
             for (int index3 = 1; index3 <= num; ++index3)
             {
                 if ((power1.AttackTypes & (Enums.eVector)values[index3]) <= Enums.eVector.None)
                 {
                     continue;
                 }
                 string iText;
                 if (flag)
                 {
                     iText = "Attack Type(s):";
                     flag  = false;
                 }
                 else
                 {
                     iText = "";
                 }
                 iPopup.Sections[index2].Add(iText, PopUp.Colors.Text, Enum.GetName(power1.AttackTypes.GetType(), values[index3]), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
             }
         }
         iPopup.Sections[index2].Add("Cast Time:", PopUp.Colors.Text, TwoDP(power1.CastTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Effect Area:", PopUp.Colors.Text, Enum.GetName(power1.EffectArea.GetType(), power1.EffectArea), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Text, TwoDP(power1.EndCost), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Auto-Hit:", PopUp.Colors.Text, Enum.GetName(power1.EntitiesAutoHit.GetType(), power1.EntitiesAutoHit), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (Math.Abs(power1.InterruptTime) > float.Epsilon)
         {
             iPopup.Sections[index2].Add("Interrupt:", PopUp.Colors.Text, TwoDP(power1.InterruptTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         iPopup.Sections[index2].Add("Level Available:", PopUp.Colors.Text, Convert.ToString(power1.Level), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Max Targets:", PopUp.Colors.Text, Convert.ToString(power1.MaxTargets), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Notify Mobs:", PopUp.Colors.Text, Enum.GetName(power1.AIReport.GetType(), power1.AIReport), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (Math.Abs(power1.Radius) > float.Epsilon)
         {
             iPopup.Sections[index2].Add("Radius:", PopUp.Colors.Text, Convert.ToString(power1.Radius) + "ft", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         if (Math.Abs(power1.Range) > float.Epsilon)
         {
             iPopup.Sections[index2].Add("Range:", PopUp.Colors.Text, Convert.ToString(power1.Range) + "ft", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         }
         iPopup.Sections[index2].Add("RechargeTime:", PopUp.Colors.Text, Convert.ToString(power1.RechargeTime) + "s", PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Target:", PopUp.Colors.Text, Enum.GetName(power1.EntitiesAffected.GetType(), power1.EntitiesAffected), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Line of Sight:", PopUp.Colors.Text, Convert.ToString(power1.TargetLoS), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         iPopup.Sections[index2].Add("Variable:", PopUp.Colors.Text, Convert.ToString(power1.VariableEnabled), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 1);
         if (power1.VariableEnabled)
         {
             iPopup.Sections[index2].Add("Attrib:", PopUp.Colors.Text, power1.VariableName, PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
             iPopup.Sections[index2].Add("Min:", PopUp.Colors.Text, Convert.ToString(power1.VariableMin), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
             iPopup.Sections[index2].Add("Max:", PopUp.Colors.Text, Convert.ToString(power1.VariableMax), PopUp.Colors.Text, 0.9f, FontStyle.Bold, 2);
         }
         if (power1.Effects.Length > 0)
         {
             int index3 = iPopup.Add();
             iPopup.Sections[index3].Add("Effects:", PopUp.Colors.Title);
             IPower power2  = new Power(DatabaseAPI.Database.Power[powerID]);
             char[] chArray = { '^' };
             int    num1    = power1.Effects.Length - 1;
             for (int index4 = 0; index4 <= num1; ++index4)
             {
                 int index5 = iPopup.Add();
                 power2.Effects[index4].SetPower(power2);
                 string[] strArray = power2.Effects[index4].BuildEffectString().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[index5].Add(strArray[index6], PopUp.Colors.Effect, 0.9f, FontStyle.Bold, 1);
                     }
                     else
                     {
                         iPopup.Sections[index5].Add(strArray[index6], PopUp.Colors.Disabled, 0.9f, FontStyle.Italic, 2);
                     }
                 }
             }
         }
     }
     else
     {
         int index = iPopup.Add();
         iPopup.Sections[index].Add("No Power", PopUp.Colors.Title, 1.25f);
     }
     pInfo.SetPopup(iPopup);
     pInfo.Width = ClientSize.Width;
 }
        void MiniPowerInfo(int pIDX)
        {
            if (this._locked)
            {
                return;
            }
            IPower power1 = new Power(this._myPowers[pIDX]);

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

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

                case Enums.ePowerType.Toggle:
                    str = "(Toggle)";
                    break;
                }
                iPopup.Sections[index1].Add(power1.DisplayName, PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                iPopup.Sections[index1].Add(str + " " + power1.DescShort, PopUp.Colors.Text, 0.9f, System.Drawing.FontStyle.Bold, 0);
                int index2 = iPopup.Add(null);
                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, System.Drawing.FontStyle.Bold, 1);
                    }
                    else
                    {
                        iPopup.Sections[index2].Add("End Cost:", PopUp.Colors.Title, Utilities.FixDP(power1.EndCost), PopUp.Colors.Title, 0.9f, System.Drawing.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, System.Drawing.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, System.Drawing.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, System.Drawing.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, System.Drawing.FontStyle.Bold, 1);
                }
                if (power1.Arc > 0)
                {
                    iPopup.Sections[index2].Add("Arc:", PopUp.Colors.Title, Conversions.ToString(power1.Arc) + "°", PopUp.Colors.Title, 0.9f, System.Drawing.FontStyle.Bold, 1);
                }
                else if (power1.Radius > 0.0)
                {
                    iPopup.Sections[index2].Add("Radius:", PopUp.Colors.Title, Conversions.ToString(power1.Radius) + "ft", PopUp.Colors.Title, 0.9f, System.Drawing.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, System.Drawing.FontStyle.Bold, 1);
                }
                IPower power2 = power1;
                if (power2.Effects.Length > 0)
                {
                    iPopup.Sections[index2].Add("Effects:", PopUp.Colors.Title, 1f, System.Drawing.FontStyle.Bold, 0);
                    char[] chArray = new char[1] {
                        '^'
                    };
                    int num1 = power2.Effects.Length - 1;
                    for (int index3 = 0; index3 <= num1; ++index3)
                    {
                        int index4 = iPopup.Add(null);
                        power1.Effects[index3].SetPower(power1);
                        string[] strArray = power1.Effects[index3].BuildEffectString(false, "", false, false, false).Replace("[", "\r\n").Replace("\r\n", "^").Replace("  ", string.Empty).Replace("]", string.Empty).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, System.Drawing.FontStyle.Bold, 1);
                            }
                            else
                            {
                                iPopup.Sections[index4].Add(strArray[index5], PopUp.Colors.Disabled, 0.9f, System.Drawing.FontStyle.Italic, 2);
                            }
                        }
                    }
                }
                this.PopInfo.SetPopup(iPopup);
                this.ChangedScrollFrameContents();
            }
        }
 public static string GetDisplayNameLocalized(this IPower item, ILanguages languages,
                                              string language = "English")
 {
     return(languages["stringtablex"][language][item.Displaynameid].Text);
 }
Пример #26
0
 public void PowerOn(IPower machine)
 {
     machine.TurnOn();
 }
Пример #27
0
 public void INIT(IPower power)
 {
     this.power = power;
 }
Пример #28
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();
                }
            }
        }
Пример #29
0
 public void SetCurrentPower(IPower p)
 {
     CurrentPower = p;
 }
Пример #30
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(enhancedPower.CastTimeReal / 0.131999999284744) + 1.0) * 0.132f;
            float  endCost       = enhancedPower.EndCost;

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

            string[] strArray;
            if (Math.Abs(damageValue) > float.Epsilon)
            {
                strArray = new[]
                {
                    num2.ToString(CultureInfo.InvariantCulture), damageValue.ToString(CultureInfo.InvariantCulture),
                    rechargeTime.ToString(CultureInfo.InvariantCulture), num1.ToString(CultureInfo.InvariantCulture),
                    endCost.ToString(CultureInfo.InvariantCulture), effectMag1.Sum.ToString(CultureInfo.InvariantCulture),
                    effectMag2.Sum.ToString(CultureInfo.InvariantCulture), powerLocation.ToString()
                }
            }
            ;
            else
            {
                strArray = new[]
                {
                    "-", "-", rechargeTime.ToString(CultureInfo.InvariantCulture), num1.ToString(CultureInfo.InvariantCulture),
                    endCost.ToString(CultureInfo.InvariantCulture), effectMag1.Sum.ToString(CultureInfo.InvariantCulture),
                    effectMag2.Sum.ToString(CultureInfo.InvariantCulture), powerLocation.ToString()
                }
            };
            return(strArray);
        }

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

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

            return(List);
        }

        void CalculateDPS()
        {
            if (ibAutoMode.TextOff == "Automagical")
            {
                PowerList[] array  = new PowerList[lvPower.Items.Count - 1];
                int         length = 0;
                for (int index = 1; index < lvPower.Items.Count; ++index)
                {
                    if (!lvPower.Items[0].Checked && !lvPower.Items[index].Checked)
                    {
                        continue;
                    }
                    array[length].PowerName = lvPower.Items[index].Text;
                    if (lvPower.Items[index].SubItems[1].Text != "-")
                    {
                        array[length].Damage = float.Parse(lvPower.Items[index].SubItems[2].Text);
                        if (!chkDamageBuffs.Checked)
                        {
                            IPower basePower = MainModule.MidsController.Toon.GetBasePower(int.Parse(lvPower.Items[index].SubItems[8].Text));
                            array[length].Damage += basePower.FXGetDamageValue() * (GlobalDamageBuff / 100f);
                        }

                        array[length].DPA      = float.Parse(lvPower.Items[index].SubItems[1].Text);
                        array[length].HidenDPA = float.Parse(lvPower.Items[index].SubItems[1].Text);
                    }

                    array[length].Recharge         = float.Parse(lvPower.Items[index].SubItems[3].Text);
                    array[length].Animation        = float.Parse(lvPower.Items[index].SubItems[4].Text);
                    array[length].Endurance        = float.Parse(lvPower.Items[index].SubItems[5].Text);
                    array[length].DamageBuff       = float.Parse(lvPower.Items[index].SubItems[6].Text);
                    array[length].ResistanceDeBuff = float.Parse(lvPower.Items[index].SubItems[7].Text);
                    array[length].RechargeTimer    = -1f;
                    if (array[length].DamageBuff > 0.0 && Math.Abs(array[length].DPA) > float.Epsilon)
                    {
                        IPower basePower = MainModule.MidsController.Toon.GetBasePower(int.Parse(lvPower.Items[index].SubItems[8].Text));
                        array[length].HidenDPA = basePower.FXGetDamageValue();
                        array[length].HidenDPA = array[length].HidenDPA * (array[length].DamageBuff / array[length].Recharge) /
                                                 array[length].Animation;
                    }

                    ++length;
                }

                if (length < lvPower.Items.Count - 1)
                {
                    PowerList[] powerListArray = array;
                    array = new 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 (num1 > 0.0 && num2 > 0)
                    {
                        num1 -= array[num2--].Animation;
                    }
                    PowerList[] List = new PowerList[length - num2];
                    int         num3 = 0;
                    for (int index = 0; index < length - num2; ++index)
                    {
                        if (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 (num4 < (double)List[index].Recharge)
                        {
                            num4 = List[index].Recharge;
                        }
                    }

                    PowerList[] AttackChain = new PowerList[20];
                    int         index1      = 1;
                    int         index2      = 1;
                    AttackChain[0] = List[0];
                    float animation = AttackChain[0].Animation;
                    List[0].RechargeTimer = List[0].Recharge;
                    while (animation < num4 + 1.0)
                    {
                        for (int index3 = index1; index3 >= 0; --index3)
                        {
                            if (index1 >= List.Length)
                            {
                                animation += 0.01f;
                                List       = IncrementRecharge(List, 0.01f);
                            }
                            else if (List[index3].RechargeTimer <= 0.0)
                            {
                                index1 = index3;
                            }
                        }

                        if (index1 >= List.Length)
                        {
                            --index1;
                            animation += 0.01f;
                            List       = IncrementRecharge(List, 0.01f);
                        }

                        while (List[index1].RechargeTimer > 0.0)
                        {
                            ++index1;
                            if (index1 < List.Length)
                            {
                                continue;
                            }
                            index1     = 0;
                            animation += 0.01f;
                            List       = IncrementRecharge(List, 0.01f);
                        }

                        AttackChain[index2] = List[index1];
                        animation          += AttackChain[index2].Animation;
                        List = IncrementRecharge(List, AttackChain[index2].Animation);
                        List[index1].RechargeTimer = List[index1].Recharge;
                        ++index1;
                        ++index2;
                    }

                    FillAttackChainWindow(AttackChain);
                }
                else if (array.Length == 1)
                {
                    tbDPSOutput.Text = "You cannot make an attack chain from one attack";
                }
                else
                {
                    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 < GlobalPowerList.Length; ++index)
                {
                    if (GlobalPowerList[index].Damage > 0.0)
                    {
                        num1 += GlobalPowerList[index].Damage;
                        num2 += GlobalPowerList[index].Endurance;
                        num3 += GlobalPowerList[index].Animation;
                        GlobalPowerList[index].RechargeTimer = GlobalPowerList[index].Recharge;
                    }

                    float animation = GlobalPowerList[index].Animation;
                }

                var powerListArray = new PowerList[GlobalPowerList.Length * 2];
                int num4           = 0;
                for (int index = 0; index < powerListArray.Length; ++index)
                {
                    if (index > GlobalPowerList.Length - 1)
                    {
                        num4 = index - (GlobalPowerList.Length - 1) - 1;
                    }
                    powerListArray[index] = 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 (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 (powerListArray[index1].RechargeTimer > 0.0)
                        {
                            flag = false;
                        }
                    }
                }

                if (!flag)
                {
                    lblHeader.ForeColor = Color.Red;
                    lblHeader.Text      = "Impossible Chain";
                }
                else
                {
                    lblHeader.ForeColor = Color.FromArgb(192, 192, byte.MaxValue);
                    lblHeader.Text      = "You may select -All Powers- or just the powers you want to consider.";
                }

                lblDPSNum.Text = (num1 / num3).ToString(CultureInfo.InvariantCulture);
                lblEPSNum.Text = (num2 / num3).ToString(CultureInfo.InvariantCulture);
            }
        }
        bool ParseClasses(string iFileName)
        {
            StreamReader iStream;

            try
            {
                iStream = new StreamReader(iFileName);
            }
            catch (Exception ex)
            {
                ProjectData.SetProjectError(ex);
                int num = (int)Interaction.MsgBox(ex.Message, MsgBoxStyle.Critical, "Power CSV Not Opened");
                ProjectData.ClearProjectError();
                return(false);
            }
            BusyMsg("Working...");
            Enabled = false;
            int num1 = 0;
            int num2 = 0;
            int num3 = 0;
            int num4 = 0;
            int num5 = DatabaseAPI.Database.Enhancements.Length - 1;

            for (int index = 0; index <= num5; ++index)
            {
                IEffect[] effectArray = new IEffect[0];
                if (DatabaseAPI.Database.Enhancements[index].GetPower() is IPower power)
                {
                    power.Effects = effectArray;
                }
            }
            string str1 = "";
            string str2;

            do
            {
                str2 = FileIO.ReadLineUnlimited(iStream, char.MinValue);
                if (str2 == null)
                {
                    continue;
                }
                ++num3;
                if (num3 >= 101)
                {
                    BusyMsg(Strings.Format(num1, "###,##0") + " records parsed.");
                    Application.DoEvents();
                    num3 = 0;
                }
                ++num1;
                string[] array = CSV.ToArray(str2);
                if (array.Length <= 0 || !(!str2.StartsWith("#") & array[0].StartsWith("Boosts.")))
                {
                    continue;
                }
                bool   flag   = true;
                string uidEnh = array[0];
                int    index  = DatabaseAPI.NidFromUidEnhExtended(uidEnh);
                if (index < 0)
                {
                    flag = false;
                }
                if (flag)
                {
                    ++num4;
                    IPower power1 = DatabaseAPI.Database.Enhancements[index].GetPower();
                    power1.FullName = uidEnh;
                    string[] strArray = power1.FullName.Split('.');
                    power1.GroupName = strArray[0];
                    power1.SetName   = strArray[1];
                    power1.PowerName = strArray[2];
                    IEffect[] effectArray = (IEffect[])Utils.CopyArray(power1.Effects, new IEffect[power1.Effects.Length + 1]);
                    power1.Effects = effectArray;
                    // this creates a reference cycle - power has an effect, that effect refers to the power
                    power1.Effects[power1.Effects.Length - 1] = new Effect(power1);
                    power1.Effects[power1.Effects.Length - 1].ImportFromCSV(str2);
                }
                else
                {
                    ++num2;
                    str1 = str1 + uidEnh + "\r\n";
                }
            }while (str2 != null);
            iStream.Close();
            Clipboard.SetDataObject(str1);
            Interaction.MsgBox(("Import Completed!\r\nTotal Records: " + Convert.ToString(num1) + "\r\nGood: " + Convert.ToString(num4) + "\r\nRejected: " + Convert.ToString(num2) + "\r\nRejected List has been placed on the clipboard. Database will be saved when you click OK"), MsgBoxStyle.Information, "Import Done");
            Enabled = true;
            BusyHide();
            var serializer = MyApplication.GetSerializer();

            DatabaseAPI.SaveEnhancementDb(serializer);
            DisplayInfo();
            return(true);
        }
Пример #32
0
        public void AddStep(IPower value, string name)
        {
            _steps.Add(new Tuple<IPower, string>(value, name));

            _steps.Sort((x, y) => x.Item1.Value.CompareTo(y.Item1.Value));
        }
Пример #33
0
 public static void Fire(IPower power)
 {
     power.ThrowPower();
 }
 protected bool Deactivate(IPower entity)
 {
     // Deactivate it
     PowersRepository.Deactivate(entity);
     // Try to Save Changes
     PowersRepository.SaveChanges();
     // Finished!
     return true;
 }
Пример #35
0
 public AppleHeadPhone(IPower power)
 {
 }
 public void Remove(IPower entity)
 {
     Context.Powers.Remove((Power)entity);
 }
 void IEnhancement.SetPower(IPower power) => this._power = power;
Пример #38
0
 public void Init(IHeadphone headphone, IMicrophone microphone, IPower power)
 {
     this.iHeadphone  = headphone;
     this.iMicrophone = microphone;
     this.iPower      = power;
 }
 protected bool Remove(IPower entity)
 {
     if (entity == null) { return true; } // No entity found to remove, consider it passed
     // Remove it
     PowersRepository.Remove(entity);
     // Try to Save Changes
     PowersRepository.SaveChanges();
     // Finished!
     return true;
 }
 public void Add(IPower entity)
 {
     Context.Powers.Add((Power)entity);
 }