Esempio n. 1
0
 public int Obrazenia(int iw)
 {
     if (iw == 0)
     {
         Piesci piesci = new Piesci();
         return(piesci.Damage());
     }
     else if (iw == 1)
     {
         Miecz miecz = new Miecz();
         return(miecz.Damage());
     }
     else if (iw == 2)
     {
         Tarcza tarcza = new Tarcza();
         return(tarcza.Damage() * 2);
     }
     else if (iw == 3)
     {
         Siekiera siekiera = new Siekiera();
         return(siekiera.Damage());
     }
     else if (iw == 4)
     {
         Topor topor = new Topor();
         return(topor.Damage());
     }
     else
     {
         return(0);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// kontrola przycisku start
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonStart_Click(object sender, EventArgs e)
        {
            //Przycisk znika
            buttonStart.Enabled = false;
            buttonStart.Visible = false;

            //Startują timery
            timerHealth.Enabled            = true;
            timerWeaponType.Enabled        = true;
            timerBodyPartHighlight.Enabled = true;
            timerPlayerTurn.Enabled        = true;
            timerEndGame.Enabled           = true;

            //Pojawiają się obrazki
            pictureBoxEnemy.Visible = true;
            pictureBoxEnemy.Enabled = true;

            pictureBoxAlly.Visible = true;
            pictureBoxAlly.Enabled = true;

            pictureBoxPodzial.Enabled = true;
            pictureBoxPodzial.Visible = true;

            //Pojawiają się opisy
            labelChoosePart.Visible = true;
            labelChoosePart.Enabled = true;

            labelChooseWep.Visible = true;
            labelChooseWep.Enabled = true;

            labelGlowaAlly.Enabled = true;
            labelGlowaAlly.Visible = true;

            labelGlowaEnemy.Enabled = true;
            labelGlowaEnemy.Visible = true;

            labelReceAlly.Visible = true;
            labelReceAlly.Enabled = true;

            labelReceEnemy.Enabled = true;
            labelReceEnemy.Visible = true;

            labelTorsAlly.Enabled = true;
            labelTorsAlly.Visible = true;

            labelTorsEnemy.Enabled = true;
            labelTorsEnemy.Visible = true;

            labelNogiAlly.Enabled = true;
            labelNogiAlly.Visible = true;

            labelNogiEnemy.Enabled = true;
            labelNogiEnemy.Visible = true;

            labelHealthAlly.Enabled = true;
            labelHealthAlly.Visible = true;

            labelHealthEnemy.Enabled = true;
            labelHealthEnemy.Visible = true;

            labelWeapChoose.Visible = true;
            labelWeapChoose.Enabled = true;

            labelPasekSily.Enabled = true;
            labelPasekSily.Visible = true;

            //Pojawia się przycisk i comboboxy
            buttonFight.Visible = true;
            buttonFight.Enabled = true;

            buttonShowAvalibleBParts.Enabled = true;
            buttonShowAvalibleBParts.Visible = true;

            comboBoxPart.Enabled = true;
            comboBoxPart.Visible = true;

            comboBoxWeapon.Enabled = true;
            comboBoxWeapon.Visible = true;

            //Dodają się obiekty do comboboxów

            //Powstają pięści
            Piesci piesci = new Piesci();

            comboBoxWeapon.Items.Add(piesci);
            comboBoxWeapon.SelectedIndex = 0;

            //Powstaje miecz
            Miecz miecz = new Miecz();

            comboBoxWeapon.Items.Add(miecz);

            //Powstaje tarcza
            Tarcza tarcza = new Tarcza();

            comboBoxWeapon.Items.Add(tarcza);

            //Powstaje siekiera
            Siekiera siekiera = new Siekiera();

            comboBoxWeapon.Items.Add(siekiera);

            //Powstaje topór
            Topor topor = new Topor();

            comboBoxWeapon.Items.Add(topor);

            //Powstaje głowa
            Glowa glowa = new Glowa();

            comboBoxPart.Items.Add(glowa);
            comboBoxPart.SelectedIndex = 0;

            //Powstają ręce
            Rece rece = new Rece();

            comboBoxPart.Items.Add(rece);

            //Powstaje tors
            Tors tors = new Tors();

            comboBoxPart.Items.Add(tors);

            //Powstają nogi
            Nogi nogi = new Nogi();

            comboBoxPart.Items.Add(nogi);

            //Pojawiają się progress bary
            progressBarGlowaA.Enabled = true;
            progressBarGlowaA.Visible = true;

            progressBarGlowaE.Enabled = true;
            progressBarGlowaE.Visible = true;

            progressBarNogiA.Enabled = true;
            progressBarNogiA.Visible = true;

            progressBarNogiE.Enabled = true;
            progressBarNogiE.Visible = true;

            progressBarPower.Enabled = true;
            progressBarPower.Visible = true;

            progressBarReceA.Enabled = true;
            progressBarReceA.Visible = true;

            progressBarReceE.Enabled = true;
            progressBarReceE.Visible = true;

            progressBarTorsA.Enabled = true;
            progressBarTorsA.Visible = true;

            progressBarTorsE.Enabled = true;
            progressBarTorsE.Visible = true;

            progressBarZycieA.Enabled = true;
            progressBarZycieA.Visible = true;

            progressBarZycieE.Enabled = true;
            progressBarZycieE.Visible = true;

            //Włącza się timer do listy
            timerListaObecnychCzesciCiala.Enabled = true;
        }