public int HP()
        {
            GameCharacter character = new GameCharacter();

            int hp = character.VIT;

            return(hp);
        }
        public static void AddCharacter(GameCharacter character)
        {
            CharacterCreatorDB db = new CharacterCreatorDB();

            db.GameCharacters.Add(character);
            MessageBox.Show("Character Added");

            db.SaveChanges();
        }
        private void cboCharacterSelect2_SelectedIndexChanged(object sender, EventArgs e)
        {
            GameCharacter character2 = (GameCharacter)cboCharacterSelect2.SelectedItem;

            lblName2.Text = character2.Name.ToString();
            lblName2.Font = new Font("Arial", 12, FontStyle.Bold);
            txtDef2.Text  = character2.DEF.ToString();
            txtHp2.Text   = character2.VIT.ToString();
            txtStr2.Text  = character2.STR.ToString();
        }
        private void cboCharacterSelect1_SelectedIndexChanged(object sender, EventArgs e)
        {
            GameCharacter character = (GameCharacter)cboCharacterSelect1.SelectedItem;

            lblName1.Text = character.Name.ToString();
            lblName1.Font = new Font("Arial", 12, FontStyle.Bold);
            txtDef1.Text  = character.DEF.ToString();
            txtHp1.Text   = character.VIT.ToString();
            txtStr1.Text  = character.STR.ToString();
        }
        public int Defender2()
        {
            GameCharacter character = new GameCharacter();
            Random        rand      = new Random();

            int def          = character.DEF;
            int defAfterRand = rand.Next(0, 4);

            def += defAfterRand;
            return(def);
        }
        public int Attacker2()
        {
            GameCharacter character = new GameCharacter();
            Random        rand      = new Random();

            int atk          = character.STR;
            int atkAfterRand = rand.Next(0, 6);

            atk += atkAfterRand;
            return(atk);
        }
        private void BtnFight_Click(object sender, EventArgs e)
        {
            try
            {
                Damage dmg = new Damage();

                GameCharacter character = new GameCharacter();

                // players do "damage" to eachother
                int damage  = Convert.ToInt32(dmg.Attacker1());
                int defense = Convert.ToInt32(dmg.Defender1());

                int attack = Convert.ToInt32(dmg.Attacker2());
                int block  = Convert.ToInt32(dmg.Defender2());

                int start1 = Convert.ToInt32(txtHp1.Text);
                int start2 = Convert.ToInt32(txtHp2.Text);

                int currHP    = start1 - damage + defense;
                int currentHP = start2 - attack + block;

                txtHp1.Text = Convert.ToString(currHP);
                txtHp2.Text = Convert.ToString(currentHP);

                if (Convert.ToInt32(currentHP) < 1)
                {
                    MessageBox.Show("Figher 1 wins! Gained 100XP");
                    int xpEarned = 100;
                    character.XP = xpEarned;
                    ClearField();
                }
                if (Convert.ToInt32(currHP) < 1)
                {
                    MessageBox.Show("Fighter 2 wins! Gained 100XP");
                    int xpEarned = 100;
                    character.XP = xpEarned;
                    ClearField();
                }
            }
            catch
            {
                MessageBox.Show("Please select the characters that will fight eachother.");
            }
            // this is just a test, it works as it should but it needs to clear the board after someone loses
        }
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            GameCharacter G = new GameCharacter();

            if (!string.IsNullOrWhiteSpace(txtCharacterName.Text))
            {
                G.Name = txtCharacterName.Text;
                G.DEF  = Convert.ToInt32(TxtDefense.Text);
                G.STR  = Convert.ToInt32(TxtStrength.Text);
                G.VIT  = Convert.ToInt32(TxtVitality.Text);
                // since XP is an int it defaults to zero
                CharacterDB.AddCharacter(G);
            }
            else
            {
                MessageBox.Show("Name cannot be empty!");
            }
            this.Close();
        }