예제 #1
0
        public int DealDamage(Pepe target)
        {
            int damage = CalculateDamage();

            target.ReceiveDamage(damage);
            return(damage);
        }
예제 #2
0
        private void GameOver(Pepe lostPepe)
        {
            MessageBox.Show("Pepe " + lostPepe.Name + " Lost the game!");

            btnRestart.IsEnabled = true;

            btnLeftAttack.IsEnabled  = false;
            btnRightAttack.IsEnabled = false;
        }
예제 #3
0
 private void ShowDamageMessage(Pepe dmgDealer, int amountOfDamage)
 {
     if (amountOfDamage > 20)
     {
         MessageBox.Show(dmgDealer.Name + " DEALT A CRITICAL HIT OF " + amountOfDamage + "!!!");
     }
     else if (amountOfDamage == 0)
     {
         MessageBox.Show(dmgDealer.Name + " MISSED!!!");
     }
 }
예제 #4
0
        private void StartOrReboot()
        {
            btnRestart.IsEnabled = false;
            leftPepe             = new Pepe("Pepe Left");
            rightPepe            = new Pepe("Pepe Right");

            imgPepeLeft.Opacity  = 1;
            imgPepeRight.Opacity = 1;
            pbHpRight.Maximum    = rightPepe.Healthpoints;
            pbHpLeft.Maximum     = leftPepe.Healthpoints;

            UpdatePepes();

            if (random.Next(0, 50) > 25)
            {
                btnLeftAttack.IsEnabled  = false;
                btnRightAttack.IsEnabled = true;
            }
            else
            {
                btnLeftAttack.IsEnabled  = true;
                btnRightAttack.IsEnabled = false;
            }
        }