Exemplo n.º 1
0
 private void FightWithAllEvil(MyEvil evil, PictureBox pictureBoxEvil, ProgressBar progressBarEvil, int hitKnight, int hitEvil)
 {
     Near(MyKnights.BALROG_PARODY, pictureBoxEvil, Barlog, hitKnight, forBarlog, evil, progressBarEvil, hitEvil); BreakTower(MyKnights.BALROG_PARODY, Barlog);
     Near(MyKnights.BROWED_NINJA, pictureBoxEvil, Browed, hitKnight, forNinja, evil, progressBarEvil, hitEvil); BreakTower(MyKnights.BROWED_NINJA, Browed);
     Near(MyKnights.HOMELESS_WITH_AX, pictureBoxEvil, Ax, hitKnight, forAx, evil, progressBarEvil, hitEvil); BreakTower(MyKnights.HOMELESS_WITH_AX, Ax);
     Near(MyKnights.JEALOUS_TEEN, pictureBoxEvil, Teen, hitKnight, forTeen, evil, progressBarEvil, hitEvil); BreakTower(MyKnights.JEALOUS_TEEN, Teen);
     Near(MyKnights.PRINCESS_WITH_EGGS, pictureBoxEvil, PrincessWith, hitKnight, forPrincess, evil, progressBarEvil, hitEvil); BreakTower(MyKnights.PRINCESS_WITH_EGGS, PrincessWith);
     BreakTower(evil, pictureBoxEvil);
 }
Exemplo n.º 2
0
 private void VizibleEvil(PictureBox pictureBox, MyEvil evil, ProgressBar progressBar)
 {
     if (gameModel.Evil[evil].NumberOfEvil <= 0)
     {
         pictureBox.Visible  = false;
         progressBar.Visible = false;
     }
     else
     {
         progressBar.Visible = true;
     }
 }
Exemplo n.º 3
0
        public void Lifes(MyEvil evil, ProgressBar progressBar, PictureBox picture)
        {
            int scheduledHP = gameModel.Evil[evil].HealthPoints;

            if (scheduledHP % 100 != 0)
            {
                progressBar.Value = gameModel.Evil[evil].PresentationHP;
            }
            else
            {
                CurrentGold.Text = gameFightController.GetMyVictoryMoney().ToString();
            }
            if (scheduledHP == 0)
            {
                progressBar.Visible = false;
                picture.Visible     = false;
                gameFightController.MoveDisabling(evil);
            }
        }
Exemplo n.º 4
0
        private void CountPresentationHP(MyEvil evil)
        {
            EvilInGame targetEvil  = gameModel.Evil[evil];
            int        scheduledHP = targetEvil.HealthPoints - (targetEvil.NumberOfEvil - 1) * 100;
            int        resultHP    = scheduledHP;

            if (scheduledHP == 0)
            {
                if (targetEvil.NumberOfEvil != 0)
                {
                    resultHP = 100;
                }
                else
                {
                    resultHP = 0;
                }
            }
            targetEvil.PresentationHP = resultHP;
        }
Exemplo n.º 5
0
 private void BreakTower(MyEvil evil, PictureBox pictureEvil)
 {
     if (pictureEvil.Visible == true)
     {
         if (Math.Abs(TowerUser.Location.X + TowerUser.Width - gameModel.Evil[evil].pointForEvil.X) <= 1)
         {
             gameFightController.FightEv(evil); gameFightController.MoveHPEvFight(evil);
             if (forTower.Value > 5)
             {
                 forTower.Value -= 5;
             }
             else
             {
                 StopAllTimers();
                 Loser.Visible = true;
                 logger.LogUserLoses();
             }
         }
     }
 }
Exemplo n.º 6
0
        public void DecreaseEvilHP(MyEvil evil, int damage)
        {
            EvilInGame targetEvil  = gameModel.Evil[evil];
            int        scheduledHP = targetEvil.HealthPoints - damage;
            int        edgeHP      = (targetEvil.NumberOfEvil - 1) * 100;

            if (scheduledHP > 0)
            {
                if (scheduledHP < edgeHP)
                {
                    targetEvil.NumberOfEvil--;
                }
                targetEvil.HealthPoints = scheduledHP;
                CountPresentationHP(evil);
            }
            else
            {
                targetEvil.NumberOfEvil   = 0;
                targetEvil.HealthPoints   = 0;
                targetEvil.PresentationHP = 0;
            }
        }
Exemplo n.º 7
0
 private void Near(MyKnights knight, PictureBox evil, PictureBox pictureBox, int hit, ProgressBar progressBar, MyEvil evils, ProgressBar Forevil, int hitEvil)
 {
     if ((evil.Visible == true) && (pictureBox.Visible == true))
     {
         if ((Math.Abs(gameModel.Knight[knight].PointForKnight.X - gameModel.Evil[evils].pointForEvil.X)) <= 1)
         {
             gameFightController.MoveEnabling(knight);
             gameFightController.MoveEnabling(evils);
             UpdateModel();
             gameFightController.FightEv(evils);
             gameFightController.FightKnight(knight);
             gameFightController.MoveHPEvFight(evils);
             gameFightController.MoveHPKn(knight);
             UpdateModel();
             evil.Location        = gameModel.Evil[evils].pointForEvil;
             Forevil.Location     = gameModel.Evil[evils].pointForHp;
             pictureBox.Location  = gameModel.Knight[knight].PointForKnight;
             progressBar.Location = gameModel.Knight[knight].PointForHp;
             Hit(knight, pictureBox, hit, progressBar);
             EvilHP(Forevil, hitEvil, evil, evils);
         }
     }
 }
Exemplo n.º 8
0
 private void TimerForEverybody(Timer timer, MyKnights knight, PictureBox pictureBox, ProgressBar progressBar, MyEvil evil, PictureBox pictureEvil, ProgressBar progressEvil)
 {
     timer.Interval = 100;
     if (gameModel.Knight[knight].IsGoing)
     {
         gameFightController.MovePicture(knight);
         gameFightController.MoveHP(knight);
     }
     if (gameModel.Evil[evil].IsMoving)
     {
         gameFightController.MovePictureEv(evil);
         gameFightController.MoveHPEv(evil);
     }
     UpdateModel();
     pictureBox.Location   = gameModel.Knight[knight].PointForKnight;
     progressBar.Location  = gameModel.Knight[knight].PointForHp;
     pictureEvil.Location  = gameModel.Evil[evil].pointForEvil;
     progressEvil.Location = gameModel.Evil[evil].pointForHp;
 }
Exemplo n.º 9
0
 public void MoveEnabling(MyEvil evil)
 {
     gameModel.Evil[evil].IsMoving = true;
 }
Exemplo n.º 10
0
 public Point FightEv(MyEvil evil)
 {
     gameModel.Evil[evil].pointForEvil.X += 9;
     logger.LogEvilFight(gameModel.Evil[evil]);
     return(gameModel.Evil[evil].pointForEvil);
 }
Exemplo n.º 11
0
 public Point MoveHPEv(MyEvil evil)
 {
     gameModel.Evil[evil].pointForHp.X -= 3;
     return(gameModel.Evil[evil].pointForHp);
 }
Exemplo n.º 12
0
 public Point MovePictureEv(MyEvil evil)
 {
     gameModel.Evil[evil].pointForEvil.X -= 3;
     logger.LogMovementOfEvil(gameModel.Evil[evil]);
     return(gameModel.Evil[evil].pointForEvil);
 }
Exemplo n.º 13
0
 public void MoveDisabling(MyEvil evil)
 {
     gameModel.Evil[evil].IsMoving = false;
 }
Exemplo n.º 14
0
 private void EvilHP(ProgressBar evilBar, int hit, PictureBox evilPicture, MyEvil evil)
 {
     gameFightController.DecreaseEvilHP(evil, hit);
     UpdateModel();
     Lifes(evil, evilBar, evilPicture);
 }
Exemplo n.º 15
0
 public Point MoveHPEvFight(MyEvil evil)
 {
     gameModel.Evil[evil].pointForHp.X += 9;
     return(gameModel.Evil[evil].pointForHp);
 }
Exemplo n.º 16
0
 private void HandleEvilWhenKnightClicked(bool isKnightMoving, MyEvil evil)
 {
     gameFightController.HandleEvilsMoving(evil, isKnightMoving);
 }
Exemplo n.º 17
0
 public void HandleEvilsMoving(MyEvil evil, bool IsMoving)
 {
     gameModel.Evil[evil].IsMoving = IsMoving;
 }