Exemple #1
0
        private void numericUpDownSkill_ValueChanged(object sender, EventArgs e)
        {
            // Get the listBoxTactics selected tactic
            PvpTact t = (PvpTact)listBoxTactics.SelectedItem;

            // Update the tactic TACT_SKILL
            t.TACT_SKILL = TACT_SKILL;

            // Check if the PvpTacticsChanged event handler is not null
            if (PvpTacticsChanged != null)
            {
                // Raise the PvpTacticsChanged event
                PvpTacticsChanged(this, new EventArgs());
            }
        }
Exemple #2
0
        private void comboBoxKite_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Get the listBoxTactics selected tactic
            PvpTact t = (PvpTact)listBoxTactics.SelectedItem;

            // Update the tactic TACT_KITE
            t.TACT_KITE = TACT_KITE;

            // Check if the PvpTacticsChanged event handler is not null
            if (PvpTacticsChanged != null)
            {
                // Raise the PvpTacticsChanged event
                PvpTacticsChanged(this, new EventArgs());
            }
        }
Exemple #3
0
        private void textBoxID_TextChanged(object sender, EventArgs e)
        {
            // Get the listBoxTactics selected tactic
            PvpTact t = (PvpTact)listBoxTactics.SelectedItem;

            // Update the tactic ID
            t.ID = TACT_ID;

            // Check if the PvpTacticsChanged event handler is not null
            if (PvpTacticsChanged != null)
            {
                // Raise the PvpTacticsChanged event
                PvpTacticsChanged(this, new EventArgs());
            }
        }
Exemple #4
0
        private void PvpTactControl_Load(object sender, EventArgs e)
        {
            // Create a new tactics array
            PvpTact[] items = new PvpTact[PVP_Tact.Tactics.Count];

            // Copy the old tactics to the new array
            PVP_Tact.Tactics.CopyTo(items, 0);

            // Clear the listBoxTactics items list
            listBoxTactics.Items.Clear();

            // Add the new tactics array to the listBoxTactics items array
            listBoxTactics.Items.AddRange(items);

            // Set the listBoxTactics selected index to 0
            listBoxTactics.SelectedIndex = 0;
        }
Exemple #5
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            // Create a new tactic object
            PvpTact t = new PvpTact("new");

            // Add the new tactic to H_Tactics and the listBoxTactics items list
            PVP_Tact.Tactics.Add(t);
            listBoxTactics.Items.Add(t);

            // Select the new tactic
            listBoxTactics.SelectedItem = t;

            // Check if the PvpTacticsChanged event handler is not null
            if (PvpTacticsChanged != null)
            {
                // Raise the PvpTacticsChanged event
                PvpTacticsChanged(this, new EventArgs());
            }
        }
Exemple #6
0
        private void textBoxID_Validated(object sender, EventArgs e)
        {
            // Check if the textBoxID text is empty
            if (textBoxID.Text == "" | textBoxID.Text == "new")
            {
                // Popup an error message for the target name
                MessageBox.Show("You must enter a name.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);

                // Change the focus to the textBoxID
                textBoxID.Focus();
            }
            // If the textBoxID text is not empty
            else
            {
                // Run through each object in the listBoxTactics items list
                foreach (object item in listBoxTactics.Items)
                {
                    // Check if the current item is not the listBoxTactics selected item
                    if (item != listBoxTactics.SelectedItem)
                    {
                        // Get the current tactic object
                        PvpTact t = (PvpTact)item;

                        // Check if the tactic ID matches the selected tactic ID
                        if (t.ID == TACT_ID)
                        {
                            // Popup a message for a unique name
                            MessageBox.Show("You must enter a unique name.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);

                            // Change the focus to textBoxID
                            textBoxID.Focus();

                            // Break out of the loop
                            break;
                        }
                    }
                }

                // Refresh the listBoxTactics control
                listBoxTactics.Refresh();
            }
        }
Exemple #7
0
        public void Open(string file)
        {
            // Load the configurations from the file
            PVP_Tact.Load(file);

            // Create a new tactics array
            PvpTact[] items = new PvpTact[PVP_Tact.Tactics.Count];

            // Copy the old tactics to the new array
            PVP_Tact.Tactics.CopyTo(items, 0);

            // Clear the listBoxTactics items list
            listBoxTactics.Items.Clear();

            // Add the new tactics array to the listBoxTactics items array
            listBoxTactics.Items.AddRange(items);

            // Set the listBoxTactics selected index to 0
            listBoxTactics.SelectedIndex = 0;
        }
Exemple #8
0
        private void comboBoxSkill_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Get the listBoxTactics selected tactic
            PvpTact t = (PvpTact)listBoxTactics.SelectedItem;

            switch (comboBoxSkill.SelectedIndex)
            {
            // If the comboBoxSkill selected index is 0
            case 0:
            {
                numericUpDownSkill.Enabled = false;
            } break;

            case 1:
            {
                numericUpDownSkill.Enabled = false;
            } break;

            case 2:
            {
                numericUpDownSkill.Enabled = true;
            } break;

            case 3:
            {
                numericUpDownSkill.Enabled = true;
                numericUpDownSkill.Value   = 5;
            } break;
            }
            // Update the tactic TACT_SKILL
            t.TACT_SKILL = TACT_SKILL;

            // Check if the PvpTacticsChanged event handler is not null
            if (PvpTacticsChanged != null)
            {
                // Raise the PvpTacticsChanged event
                PvpTacticsChanged(this, new EventArgs());
            }
        }
Exemple #9
0
        private void buttonRemove_Click(object sender, EventArgs e)
        {
            // Check if the listBoxTactics selected item is not null
            if (listBoxTactics.SelectedItem != null)
            {
                // Get the listBoxTactics selected index
                int i = listBoxTactics.SelectedIndex;

                // Get the listBoxTactics selected tactic
                PvpTact t = (PvpTact)listBoxTactics.SelectedItem;

                // Remove the tactic from PVP_Tact and the listBoxTactics items list
                PVP_Tact.Tactics.Remove(t);
                listBoxTactics.Items.Remove(t);

                // Check if the selected index is less than the number of items in the listBoxTactics items list
                if (i < listBoxTactics.Items.Count)
                {
                    // Reset the listBoxTactics selected index
                    listBoxTactics.SelectedIndex = i;
                }
                // If the selected index is not less than the number of items in the listBoxTactics items list
                else
                {
                    // Reset the listBoxTactics selected index to the previous index
                    listBoxTactics.SelectedIndex = i - 1;
                }

                // Check if the PvpTacticsChanged event handler is not null
                if (PvpTacticsChanged != null)
                {
                    // Raise the PvpTacticsChanged event
                    PvpTacticsChanged(this, new EventArgs());
                }
            }
        }
Exemple #10
0
        private void listBoxTactics_SelectedIndexChanged(object sender, EventArgs e)
        {
            // Remove event handlers
            buttonAdd.Click       -= new EventHandler(buttonAdd_Click);
            buttonRemove.Click    -= new EventHandler(buttonRemove_Click);
            textBoxID.TextChanged -= new EventHandler(textBoxID_TextChanged);
            comboBoxBasic.SelectedIndexChanged    -= new EventHandler(comboBoxBasic_SelectedIndexChanged);
            comboBoxReact.SelectedIndexChanged    -= new EventHandler(comboBoxReact_SelectedIndexChanged);
            comboBoxDebuff.SelectedIndexChanged   -= new EventHandler(comboBoxDebuff_SelectedIndexChanged);
            comboBoxSkill.SelectedIndexChanged    -= new EventHandler(comboBoxSkill_SelectedIndexChanged);
            numericUpDownSkill.ValueChanged       -= new EventHandler(numericUpDownSkill_ValueChanged);
            comboBoxPushback.SelectedIndexChanged -= new EventHandler(comboBoxPushback_SelectedIndexChanged);
            comboBoxKite.SelectedIndexChanged     -= new EventHandler(comboBoxKite_SelectedIndexChanged);
            comboBoxSize.SelectedIndexChanged     -= new EventHandler(comboBoxSize_SelectedIndexChanged);
            comboBoxRescue.SelectedIndexChanged   -= new EventHandler(comboBoxRescue_SelectedIndexChanged);

            // Check if the listBoxTactics selected item is not null
            if (listBoxTactics.SelectedItem != null)
            {
                // Get the listBoxTactics selected tactic
                PvpTact t = (PvpTact)listBoxTactics.SelectedItem;

                // Update the graphical user interface with the values of the current tactic
                TACT_ID         = t.ID;
                TACT_BASIC      = t.TACT_BASIC;
                TACT_CAST       = t.TACT_CAST;
                TACT_DEBUFF     = t.TACT_DEBUFF;
                TACT_SKILL      = t.TACT_SKILL;
                TACT_PUSHBACK   = t.TACT_PUSHBACK;
                TACT_KITE       = t.TACT_KITE;
                TACT_SKILLCLASS = t.TACT_SKILLCLASS;
                TACT_RESCUE     = t.TACT_RESCUE;

                // Check if the TACT_ID is 0
                if (TACT_ID == "new")
                {
                    // Disable buttonRemove and textBoxID
                    buttonRemove.Enabled = true;
                    textBoxID.Enabled    = true;
                }
                // If the TACT_ID is not 0
                else
                {
                    // Enable buttonRemove and textBoxID
                    textBoxID.Enabled = false;
                }
                if (TACT_ID == "0")
                {
                    buttonRemove.Enabled = false;
                }
            }

            // Add event handlers
            buttonAdd.Click       += new EventHandler(buttonAdd_Click);
            buttonRemove.Click    += new EventHandler(buttonRemove_Click);
            textBoxID.TextChanged += new EventHandler(textBoxID_TextChanged);
            comboBoxBasic.SelectedIndexChanged    += new EventHandler(comboBoxBasic_SelectedIndexChanged);
            comboBoxReact.SelectedIndexChanged    += new EventHandler(comboBoxReact_SelectedIndexChanged);
            comboBoxDebuff.SelectedIndexChanged   += new EventHandler(comboBoxDebuff_SelectedIndexChanged);
            comboBoxSkill.SelectedIndexChanged    += new EventHandler(comboBoxSkill_SelectedIndexChanged);
            numericUpDownSkill.ValueChanged       += new EventHandler(numericUpDownSkill_ValueChanged);
            comboBoxPushback.SelectedIndexChanged += new EventHandler(comboBoxPushback_SelectedIndexChanged);
            comboBoxKite.SelectedIndexChanged     += new EventHandler(comboBoxKite_SelectedIndexChanged);
            comboBoxSize.SelectedIndexChanged     += new EventHandler(comboBoxSize_SelectedIndexChanged);
            comboBoxRescue.SelectedIndexChanged   += new EventHandler(comboBoxRescue_SelectedIndexChanged);
        }
Exemple #11
0
        public static void Load(string fileName)
        {
            // Read the file contents from fileName and split them into an array of lines
            string file = File.ReadAllText(fileName);

            string[] lines = file.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);

            // Check if the file does not contain "MyPVPTact[0]"
            if (!Regex.IsMatch(file, "MyPVPTact\\[0\\]"))
            {
                // Add the default tactic to the tactics collection
                _tacts.Add(new PvpTact("0"));
            }

            // Run through each string object in the lines array
            foreach (string line in lines)
            {
                // Check if the current line contains "MyPVPTact[*]={*}"
                if (Regex.IsMatch(line, "MyPVPTact\\[(.*?)\\]=\\{(.*?)\\}"))
                {
                    // Get the set of values from the line
                    string[] values = Regex.Replace(line, "MyPVPTact\\[(.*?)\\]=\\{(.*?)\\}", "$1,$2").Split(',');

                    // Create a new tactic object
                    PvpTact t = new PvpTact(values[0]);

                    // Set the tactic properties
                    if (values[1] == "TACT_TANK")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_TANK;
                    }
                    else if (values[1] == "TACT_IGNORE")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_IGNORE;
                    }
                    else if (values[1] == "TACT_ATTACK_L")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_ATTACK_L;
                    }
                    else if (values[1] == "TACT_ATTACK_M")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_ATTACK_M;
                    }
                    else if (values[1] == "TACT_ATTACK_H")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_ATTACK_H;
                    }
                    else if (values[1] == "TACT_REACT_L")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_REACT_L;
                    }
                    else if (values[1] == "TACT_REACT_M")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_REACT_M;
                    }
                    else if (values[1] == "TACT_REACT_H")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_REACT_H;
                    }
                    else if (values[1] == "TACT_REACT_SELF")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_REACT_SELF;
                    }
                    else if (values[1] == "TACT_SNIPE_L")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_SNIPE_L;
                    }
                    else if (values[1] == "TACT_SNIPE_M")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_SNIPE_M;
                    }
                    else if (values[1] == "TACT_SNIPE_H")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_SNIPE_H;
                    }
                    else if (values[1] == "TACT_ATK_L_REACT_M")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_ATK_L_REACT_M;
                    }
                    else if (values[1] == "TACT_ATTACK_LAST")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_ATTACK_LAST;
                    }
                    else if (values[1] == "TACT_ATTACK_TOP")
                    {
                        t.TACT_BASIC = TACT_BASIC.TACT_ATTACK_TOP;
                    }

                    t.TACT_SKILL = values[2];

                    if (values[3] == "KITE_ALWAYS")
                    {
                        t.TACT_KITE = TACT_KITE.KITE_ALWAYS;
                    }
                    else if (values[3] == "KITE_REACT")
                    {
                        t.TACT_KITE = TACT_KITE.KITE_REACT;
                    }
                    else if (values[3] == "KITE_NEVER")
                    {
                        t.TACT_KITE = TACT_KITE.KITE_NEVER;
                    }

                    if (values[4] == "CAST_REACT")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_REACT;
                    }
                    else if (values[4] == "CAST_PASSIVE")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_PASSIVE;
                    }
                    else if (values[4] == "CAST_REACT_MAIN")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_REACT_MAIN;
                    }
                    else if (values[4] == "CAST_REACT_S")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_REACT_S;
                    }
                    else if (values[4] == "CAST_REACT_MOB")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_REACT_MOB;
                    }
                    else if (values[4] == "CAST_REACT_DEBUFF")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_REACT_DEBUFF;
                    }
                    else if (values[4] == "CAST_REACT_MINION")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_REACT_MINION;
                    }
                    else if (values[4] == "CAST_REACT_ANY")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_REACT_ANY;
                    }
                    else if (values[4] == "CAST_REACT_BREEZE")
                    {
                        t.TACT_CAST = TACT_CAST.CAST_REACT_BREEZE;
                    }

                    if (values[5] == "PUSH_NEVER")
                    {
                        t.TACT_PUSHBACK = TACT_PUSHBACK.PUSH_NEVER;
                    }
                    else if (values[5] == "PUSH_FRIEND")
                    {
                        t.TACT_PUSHBACK = TACT_PUSHBACK.PUSH_FRIEND;
                    }
                    else if (values[5] == "PUSH_SELF")
                    {
                        t.TACT_PUSHBACK = TACT_PUSHBACK.PUSH_SELF;
                    }

                    if (values[6] == "DEBUFF_NEVER")
                    {
                        t.TACT_DEBUFF = TACT_DEBUFF.DEBUFF_NEVER;
                    }
                    else if (values[6] == "DEBUFF_ANY_C")
                    {
                        t.TACT_DEBUFF = TACT_DEBUFF.DEBUFF_ANY_C;
                    }
                    else if (values[6] == "DEBUFF_BREEZE_C")
                    {
                        t.TACT_DEBUFF = TACT_DEBUFF.DEBUFF_BREEZE_C;
                    }
                    else if (values[6] == "DEBUFF_ANY_A")
                    {
                        t.TACT_DEBUFF = TACT_DEBUFF.DEBUFF_ANY_A;
                    }
                    else if (values[6] == "DEBUFF_BREEZE_A")
                    {
                        t.TACT_DEBUFF = TACT_DEBUFF.DEBUFF_BREEZE_A;
                    }
                    else if (values[6] == "DEBUFF_ASH_C")
                    {
                        t.TACT_DEBUFF = TACT_DEBUFF.DEBUFF_ASH_C;
                    }
                    else if (values[6] == "DEBUFF_ASH_A")
                    {
                        t.TACT_DEBUFF = TACT_DEBUFF.DEBUFF_ASH_A;
                    }
                    else
                    {
                        t.TACT_DEBUFF = TACT_DEBUFF.DEBUFF_NEVER;
                    }

                    if (values[7] == "CLASS_BOTH")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_BOTH;
                    }
                    else if (values[7] == "CLASS_OLD")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_OLD;
                    }
                    else if (values[7] == "CLASS_S")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_S;
                    }
                    else if (values[7] == "CLASS_MOB")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_MOB;
                    }
                    else if (values[7] == "CLASS_COMBO_1")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_COMBO_1;
                    }
                    else if (values[7] == "CLASS_COMBO_2")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_COMBO_2;
                    }
                    else if (values[7] == "CLASS_MINION")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_MINION;
                    }
                    else if (values[7] == "CLASS_GRAPPLE")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_GRAPPLE;
                    }
                    else if (values[7] == "CLASS_GRAPPLE_1")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_GRAPPLE_1;
                    }
                    else if (values[7] == "CLASS_GRAPPLE_2")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_GRAPPLE_2;
                    }
                    else if (values[7] == "CLASS_MIN_OLD")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_MIN_OLD;
                    }
                    else if (values[7] == "CLASS_MIN_S")
                    {
                        t.TACT_SKILLCLASS = TACT_SKILLCLASS.CLASS_MIN_S;
                    }
                    if (values[8] == "RESCUE_NEVER")
                    {
                        t.TACT_RESCUE = TACT_RESCUE.RESCUE_NEVER;
                    }
                    else if (values[8] == "RESCUE_FRIEND")
                    {
                        t.TACT_RESCUE = TACT_RESCUE.RESCUE_FRIEND;
                    }
                    else if (values[8] == "RESCUE_RETAINER")
                    {
                        t.TACT_RESCUE = TACT_RESCUE.RESCUE_RETAINER;
                    }
                    else if (values[8] == "RESCUE_SELF")
                    {
                        t.TACT_RESCUE = TACT_RESCUE.RESCUE_SELF;
                    }
                    else if (values[8] == "RESCUE_OWNER")
                    {
                        t.TACT_RESCUE = TACT_RESCUE.RESCUE_OWNER;
                    }
                    else if (values[8] == "RESCUE_ALL")
                    {
                        t.TACT_RESCUE = TACT_RESCUE.RESCUE_ALL;
                    }

                    // Add the tactic to the tactics collection
                    _tacts.Add(t);
                }
            }

            // Output to the console "Loading complete."
            Program.WriteLine("Loading complete.");
        }