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); }
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; } }
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); } }
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; }
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(); } } } }
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; } }
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); } } }
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; }
public void MoveEnabling(MyEvil evil) { gameModel.Evil[evil].IsMoving = true; }
public Point FightEv(MyEvil evil) { gameModel.Evil[evil].pointForEvil.X += 9; logger.LogEvilFight(gameModel.Evil[evil]); return(gameModel.Evil[evil].pointForEvil); }
public Point MoveHPEv(MyEvil evil) { gameModel.Evil[evil].pointForHp.X -= 3; return(gameModel.Evil[evil].pointForHp); }
public Point MovePictureEv(MyEvil evil) { gameModel.Evil[evil].pointForEvil.X -= 3; logger.LogMovementOfEvil(gameModel.Evil[evil]); return(gameModel.Evil[evil].pointForEvil); }
public void MoveDisabling(MyEvil evil) { gameModel.Evil[evil].IsMoving = false; }
private void EvilHP(ProgressBar evilBar, int hit, PictureBox evilPicture, MyEvil evil) { gameFightController.DecreaseEvilHP(evil, hit); UpdateModel(); Lifes(evil, evilBar, evilPicture); }
public Point MoveHPEvFight(MyEvil evil) { gameModel.Evil[evil].pointForHp.X += 9; return(gameModel.Evil[evil].pointForHp); }
private void HandleEvilWhenKnightClicked(bool isKnightMoving, MyEvil evil) { gameFightController.HandleEvilsMoving(evil, isKnightMoving); }
public void HandleEvilsMoving(MyEvil evil, bool IsMoving) { gameModel.Evil[evil].IsMoving = IsMoving; }