public void ChapterBosses() { CurrentDialogue.StartEvent(); ConsoleKeyInfo keyInfo = ReadKey(true); ConsoleKey key; key = keyInfo.Key; // check if event count is set to 1. // if event count is set to 0, then Y option N option // if event count is set to 1, statement will conclude. switch (key) { case ConsoleKey.Y: if (chap1 == false) { string name = "Orcil"; Enemies Chp1 = new Enemies(name, 10, 50, 15); ChapBoss(CurrentPlayer, CurrentImages, CurrentDialogue, Chp1, CurrentMenu); Clear(); CurrentImages.Escape(); CurrentDialogue.Escape(); Clear(); eventcounter = 1; chap1 = true; } else if (chap1 == true && tchap2 == false) { string name = "Thruul"; Enemies Chp2 = new Enemies(name, 15, 75, 20); ChapBoss(CurrentPlayer, CurrentImages, CurrentDialogue, Chp2, CurrentMenu); Clear(); CurrentImages.Escape(); CurrentDialogue.Escape(); Clear(); tchap2 = true; eventcounter = 1; } else if (chap1 == true && tchap2 == true && tchap3 == false) { string name = "Yilkir"; Enemies Chp3 = new Enemies(name, 15, 100, 25); ChapBoss(CurrentPlayer, CurrentImages, CurrentDialogue, Chp3, CurrentMenu); Clear(); CurrentImages.Escape(); CurrentDialogue.Escape(); Clear(); tchap3 = true; eventcounter = 1; } else if (chap1 == true && tchap2 == true && tchap3 == true && tchap4 == false) { string name = "Tanqin"; Enemies Chp4 = new Enemies(name, 20, 150, 25); ChapBoss(CurrentPlayer, CurrentImages, CurrentDialogue, Chp4, CurrentMenu); Clear(); CurrentImages.Escape(); CurrentDialogue.Escape(); Clear(); tchap4 = true; eventcounter = 1; } else if (chap1 == true && tchap2 == true && tchap3 == true && tchap4 == true && chap5 == false) { string name = "Bailmaith"; Enemies Chp5 = new Enemies(name, 25, 200, 25); ChapBoss(CurrentPlayer, CurrentImages, CurrentDialogue, Chp5, CurrentMenu); Clear(); chap5 = true; CurrentDialogue.Ending(); CurrentImages.Ending(); SetCursorPosition(58, 40); WriteLine("You beat the game! Now you can explore or start the game all over!"); SetCursorPosition(54, 41); WriteLine("Press any key to continue..."); ReadKey(); Clear(); } break; case ConsoleKey.N: break; default: break; } }
public void FightKeyHandling(Player player, Enemies enemy, GameImages images) { SetCursorPosition(0, 38); WriteLine($" Press (A) to attack, (D) to Defend, (H) to heal"); ConsoleKeyInfo keyInfo = ReadKey(true); ConsoleKey key; key = keyInfo.Key; switch (key) { case ConsoleKey.A: //Attack int damage = enemy.Power - player.Armor; int attack = rand.Next(0, player.Attack) + rand.Next(1, 4); //randomized damage value if (damage < 0) { damage = 0; } SetCursorPosition(54, 40); WriteLine($"Elta wildy attacks, leaving herself open to take major damage from {enemy.Name} "); SetCursorPosition(54, 41); WriteLine($"Tip, press defend to shield and attack at the same time"); SetCursorPosition(54, 42); WriteLine($"You lose " + damage + " health, and deal " + attack + " damage"); SetCursorPosition(54, 43); WriteLine("Press any key to continue..."); player.Health -= damage; if (player.Health < 0) { player.Health = 0; } enemy.Health -= attack; if (enemy.Health < 0) { enemy.Health = 0; } images.AttributeMenu(player); images.EnemyStats(enemy); break; case ConsoleKey.D: //Defend SetCursorPosition(54, 40); WriteLine($"Elta waits for {enemy.Name} to attack, but swiftly blocks only taking a"); SetCursorPosition(54, 41); WriteLine($" small amount of damage and dealing heavy damage to Ocil with his gaurd down:"); int defensedamage = (enemy.Power / 2) - player.Armor; if (defensedamage < 0) { defensedamage = 0; } int counterattack = rand.Next(0, player.Attack * 2) + rand.Next(1, 4); SetCursorPosition(54, 43); WriteLine("You lose " + defensedamage + " health, and deal " + counterattack + " damage"); SetCursorPosition(54, 44); WriteLine("Press any key to continue..."); player.Health -= defensedamage; if (player.Health < 0) { player.Health = 0; } enemy.Health -= counterattack; if (enemy.Health < 0) { enemy.Health = 0; } images.AttributeMenu(player); images.EnemyStats(enemy); break; case ConsoleKey.H: // heal if (player.Rejuvenation == 0) { SetCursorPosition(54, 40); WriteLine("As you desperatly grasp for a beet in your sack, all that you feel is dirt"); int healingdamage = enemy.Power - player.Armor; player.Health -= healingdamage; if (healingdamage < 0) { healingdamage = 0; } SetCursorPosition(54, 41); WriteLine($" {enemy.Name} strikes you with a mighty blow and you lose " + healingdamage + " health!"); SetCursorPosition(54, 42); WriteLine("Press any key to continue..."); } else { SetCursorPosition(54, 40); WriteLine("You reach into your sack and pull out a delicious beet. You devour it within seconds!"); int beetV = 10; SetCursorPosition(54, 41); WriteLine("You gain " + beetV + " health"); SetCursorPosition(54, 42); WriteLine("Press any key to continue..."); player.Health += beetV; player.Rejuvenation--; } images.AttributeMenu(player); images.EnemyStats(enemy); break; default: break; } }
public void ChapBoss(Player player, GameImages images, GameDialogue dialogue, Enemies enemies, UserMenus menu) { Clear(); menu.StoryFightMenu(CurrentPlayer, enemies, images, dialogue); }