fk4m1913

Untitled

May 25th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 82.41 KB | None | 0 0
  1. using System;
  2.  
  3. namespace GameRPG
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             // Player starts with pre-determined level, xp, hp, attack, defence, magic, coins
  10.             // The goal of the game is to pass through all rooms in the dungeon, collecting items and defeating enemies until you defeat the final boss, or die trying
  11.  
  12.             //** Player increases level if he reaches 100 xp, xp is gained by killing monsters. For each level hp++, attack++, magic++, coins++
  13.             //** If xp == 100, level++
  14.             //** Attack is increased by gaining weapons and increasing level
  15.             //** Defence is gained by gaining armour
  16.             //** Coins are increased by gaining level, defeating monsters, finding it in chests
  17.             //** The dungeon has 30 rooms in total
  18.             //** Room type can be monster room, shop room, regeneration room, chest room, final boss room
  19.             //** Monster types can be zombie, ghost, orc, minotaur
  20.             //** Regeneration room regenerates player health back to 100
  21.             //** Shop room gives chance to buy health potion, magic book, weapon or armour
  22.             //** Armour types = leather armour, iron armour, steel armour
  23.             //** Weapon types = knife, wooden spear, axe, sword
  24.             //** Chest room always gives reward which can be health potion, weapon, armour, spell book or coins
  25.             //** If player health <= 0, player dies
  26.  
  27.             int playerLevel = 1;
  28.             int playerXp = 0;
  29.             int playerHp = 100;
  30.             int playerAttack = 25;
  31.             int playerDefence = 10;
  32.             int playerMagic = 5;
  33.             int playerCoins = 0;
  34.             string playerWeapon = "None";
  35.             string playerArmour = "None";
  36.  
  37.             string playerName = "";
  38.             string roomType = "";
  39.             string monsterType = "";
  40.             int monsterHp = 0;
  41.             int monsterAttack = 0;
  42.             int magicToPassMonster = 0;
  43.             bool gameOver = false;
  44.             bool gameIsWon = false;
  45.  
  46.             Random random = new Random();
  47.  
  48.             for (int i = 2000; i >= 100; i -= 200)
  49.             {
  50.                 Console.Beep(i, 100);
  51.             }
  52.  
  53.             Console.WriteLine("Welcome to my dungeon!");
  54.             System.Threading.Thread.Sleep(2000);
  55.             Console.WriteLine("Many have entered and tried to complete it, but few have succeeded!");
  56.             System.Threading.Thread.Sleep(3000);
  57.             Console.WriteLine("Are you brave enough to enter?");
  58.             System.Threading.Thread.Sleep(2000);
  59.             Console.Write("Yes / No : ");
  60.  
  61.             string choiceEnter = Console.ReadLine();
  62.             Console.Clear();
  63.  
  64.             if (choiceEnter == "No" || choiceEnter == "no" || choiceEnter == "NO")
  65.             {
  66.                 System.Threading.Thread.Sleep(1000);
  67.                 Console.WriteLine("Ha-ha-ha...Come back when you are brave enough!");
  68.                 Console.WriteLine("");
  69.  
  70.                 string stringGameOver = "GAME OVER!";
  71.  
  72.                 for (int i = 0; i < stringGameOver.Length; i++)
  73.                 {
  74.                     System.Threading.Thread.Sleep(1000);
  75.                     char letter = stringGameOver[i];
  76.  
  77.                     Console.Write(letter);
  78.                 }
  79.                 System.Threading.Thread.Sleep(2000);
  80.             }
  81.  
  82.             else if (choiceEnter == "Yes" || choiceEnter == "yes" || choiceEnter == "YES")
  83.             {
  84.                 System.Threading.Thread.Sleep(1000);
  85.                 Console.WriteLine("Congratulations for deciding to enter my dungeon!");
  86.                 System.Threading.Thread.Sleep(2000);
  87.                 Console.Write("Your name is: ");
  88.                 playerName = Console.ReadLine();
  89.                 Console.Clear();
  90.  
  91.                 System.Threading.Thread.Sleep(2000);
  92.                 Console.WriteLine($"This will be the ultimate test for you {playerName}!");
  93.                 System.Threading.Thread.Sleep(3000);
  94.                 Console.WriteLine("Once you enter the first room there will be only two possible scenarios...");
  95.                 System.Threading.Thread.Sleep(3000);
  96.                 Console.WriteLine("... success or death!");
  97.                 System.Threading.Thread.Sleep(3000);
  98.                 Console.WriteLine($"Good luck {playerName}!...You will need a lot of it!");
  99.                 System.Threading.Thread.Sleep(2000);
  100.                 Console.Clear();
  101.  
  102.                 for (int room = 1; room <= 30; room++)
  103.                 {
  104.                     if (room == 30)
  105.                     {
  106.                         roomType = "Final boss room";
  107.                     }
  108.  
  109.                     else if (room == 8 || room == 16 || room == 26)
  110.                     {
  111.                         roomType = "Shop room";
  112.                     }
  113.  
  114.                     else if (room == 12 || room == 25)
  115.                     {
  116.                         roomType = "Regeneration room";
  117.                     }
  118.  
  119.                     else
  120.                     {
  121.                         int randRoomType = random.Next(1, 5);
  122.  
  123.                         switch (randRoomType)
  124.                         {
  125.                             case 1:
  126.                             case 2:
  127.                             case 3:
  128.                                 roomType = "Monster room";
  129.                                 break;
  130.                             case 4:
  131.                                 roomType = "Chest room";
  132.                                 break;
  133.                         }
  134.                     }
  135.  
  136.                     if (roomType == "Monster room")
  137.                     {
  138.                         int randMonsterType = random.Next(1, 5);
  139.  
  140.                         Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  141.                         Console.WriteLine("");
  142.                         Console.WriteLine("");
  143.                         System.Threading.Thread.Sleep(1000);
  144.                         Console.WriteLine($"ROOM - {room}, {roomType}!");
  145.                         Console.WriteLine("");
  146.                         Console.WriteLine("");
  147.                         Console.WriteLine("");
  148.  
  149.                         switch (randMonsterType)
  150.                         {
  151.                             case 1:
  152.                                 monsterType = "Zombie";
  153.                                 monsterHp = 20;
  154.                                 monsterAttack = 8;
  155.                                 magicToPassMonster = 2;
  156.                                 break;
  157.  
  158.                             case 2:
  159.                                 monsterType = "Ghost";
  160.                                 monsterHp = 25;
  161.                                 monsterAttack = 14;
  162.                                 magicToPassMonster = 3;
  163.                                 break;
  164.                             case 3:
  165.                                 monsterType = "Orc";
  166.                                 monsterHp = 40;
  167.                                 monsterAttack = 18;
  168.                                 magicToPassMonster = 4;
  169.                                 break;
  170.                             case 4:
  171.                                 monsterType = "Minotaur";
  172.                                 monsterHp = 50;
  173.                                 monsterAttack = 24;
  174.                                 magicToPassMonster = 5;
  175.                                 break;
  176.                         }
  177.  
  178.                         System.Threading.Thread.Sleep(1000);
  179.                         Console.WriteLine($"You have met a {monsterType}! Your action is:");
  180.                         Console.WriteLine("");
  181.                         System.Threading.Thread.Sleep(1000);
  182.                         Console.WriteLine($"1 - Fight the {monsterType}!");
  183.                         System.Threading.Thread.Sleep(1000);
  184.                         Console.WriteLine($"2 - Try to use magic and confuse the {monsterType}!");
  185.                         System.Threading.Thread.Sleep(1000);
  186.                         Console.WriteLine($"3 - Attempt to run from the {monsterType}!");
  187.                         Console.WriteLine("");
  188.                         System.Threading.Thread.Sleep(1000);
  189.                         Console.Write("You choose to: ");
  190.  
  191.                         int actionChoice = int.Parse(Console.ReadLine());
  192.                         Console.Clear();
  193.  
  194.                         switch (actionChoice)
  195.                         {
  196.                             case 1:
  197.  
  198.                                 bool monsterDead = false;
  199.                                 bool playerDead = false;
  200.  
  201.                                 Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  202.                                 Console.WriteLine("");
  203.                                 Console.WriteLine("");
  204.  
  205.                                 System.Threading.Thread.Sleep(1000);
  206.                                 Console.WriteLine($"You have entered in a fight with the {monsterType}");
  207.                                 Console.WriteLine("");
  208.                                 System.Threading.Thread.Sleep(2000);
  209.  
  210.                                 while (!monsterDead && !playerDead)
  211.                                 {
  212.                                     monsterHp -= playerAttack;
  213.                                     playerHp -= (monsterAttack - playerDefence);
  214.  
  215.                                     if (playerHp <= 0)
  216.                                     {
  217.                                         playerDead = true;
  218.                                     }
  219.  
  220.                                     else if (monsterHp <= 0)
  221.                                     {
  222.                                         monsterDead = true;
  223.                                     }
  224.  
  225.                                     if (playerDead == true)
  226.                                     {
  227.                                         gameOver = true;
  228.  
  229.                                         Console.WriteLine($"You have been killed by {monsterType}!");
  230.                                         Console.WriteLine("");
  231.                                         Console.WriteLine("");
  232.                                         Console.WriteLine("");
  233.  
  234.                                         string stringGameOver = "GAME OVER!";
  235.  
  236.                                         for (int i = 0; i < stringGameOver.Length; i++)
  237.                                         {
  238.                                             System.Threading.Thread.Sleep(1000);
  239.                                             char letter = stringGameOver[i];
  240.  
  241.                                             Console.Write(letter);
  242.                                         }
  243.                                     }
  244.  
  245.                                     else if (monsterDead == true)
  246.                                     {
  247.                                         int xpEarned = random.Next(15, 51);
  248.                                         playerXp += xpEarned;
  249.  
  250.                                         int coinsEarned = random.Next(50, 101);
  251.                                         playerCoins += coinsEarned;
  252.  
  253.                                         if (playerXp >= 100)
  254.                                         {
  255.                                             playerLevel++;
  256.                                             playerXp = playerXp - 100;
  257.                                             playerHp += 5;
  258.                                             playerCoins += 50;
  259.  
  260.                                             if (playerLevel % 2 == 0)
  261.                                             {
  262.                                                 playerAttack += 1;
  263.                                                 playerMagic += 1;
  264.                                             }
  265.                                         }
  266.                                         System.Threading.Thread.Sleep(2000);
  267.                                         Console.WriteLine($"You have killed the {monsterType}!");
  268.                                         Console.WriteLine("");
  269.                                         System.Threading.Thread.Sleep(1000);
  270.                                         Console.WriteLine($"You have earned {xpEarned} XP!");
  271.                                         System.Threading.Thread.Sleep(1000);
  272.                                         Console.WriteLine($"You have earned {coinsEarned} coins!");
  273.                                         Console.WriteLine("");
  274.                                         System.Threading.Thread.Sleep(2000);
  275.                                         Console.WriteLine($"Entering next room...");
  276.                                         System.Threading.Thread.Sleep(2000);
  277.                                         Console.Clear();
  278.                                     }
  279.                                 }
  280.                                 break;
  281.  
  282.                             case 2:
  283.  
  284.                                 if (playerMagic >= magicToPassMonster)
  285.                                 {
  286.                                     Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  287.                                     Console.WriteLine("");
  288.                                     Console.WriteLine("");
  289.  
  290.                                     playerMagic -= magicToPassMonster;
  291.                                     System.Threading.Thread.Sleep(2000);
  292.                                     Console.WriteLine($"You have successfully used magic to trick the {monsterType}!");
  293.                                     Console.WriteLine("");
  294.                                     System.Threading.Thread.Sleep(2000);
  295.                                     Console.WriteLine($"Entering next room...");
  296.                                     System.Threading.Thread.Sleep(2000);
  297.                                     Console.Clear();
  298.                                 }
  299.  
  300.                                 else
  301.                                 {
  302.                                     Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  303.                                     Console.WriteLine("");
  304.                                     Console.WriteLine("");
  305.  
  306.                                     System.Threading.Thread.Sleep(2000);
  307.                                     Console.WriteLine($"You do not have enough magic to get past the {monsterType}!");
  308.                                     Console.WriteLine("");
  309.                                     System.Threading.Thread.Sleep(2000);
  310.                                     Console.WriteLine("After the unsuccessful attempt to use magic you decide to:");
  311.                                     Console.WriteLine("");
  312.                                     System.Threading.Thread.Sleep(2000);
  313.                                     Console.WriteLine($"1 - Fight the {monsterType}!");
  314.                                     System.Threading.Thread.Sleep(1000);
  315.                                     Console.WriteLine($"2 - Attempt to run from the {monsterType}!");
  316.                                     Console.WriteLine("");
  317.                                     System.Threading.Thread.Sleep(1000);
  318.                                     Console.Write("You choose to: ");
  319.  
  320.                                     actionChoice = int.Parse(Console.ReadLine());
  321.  
  322.                                     switch (actionChoice)
  323.                                     {
  324.                                         case 1:
  325.  
  326.                                             monsterDead = false;
  327.                                             playerDead = false;
  328.  
  329.                                             Console.WriteLine("");
  330.                                             System.Threading.Thread.Sleep(1000);
  331.                                             Console.WriteLine($"You have entered in a fight with the {monsterType}");
  332.                                             System.Threading.Thread.Sleep(2000);
  333.  
  334.                                             while (!monsterDead && !playerDead)
  335.                                             {
  336.                                                 monsterHp -= playerAttack;
  337.                                                 playerHp -= (monsterAttack - playerDefence);
  338.  
  339.                                                 if (playerHp <= 0)
  340.                                                 {
  341.                                                     playerDead = true;
  342.                                                 }
  343.  
  344.                                                 else if (monsterHp <= 0)
  345.                                                 {
  346.                                                     monsterDead = true;
  347.                                                 }
  348.  
  349.                                                 if (playerDead == true)
  350.                                                 {
  351.                                                     gameOver = true;
  352.  
  353.                                                     Console.WriteLine($"You have been killed by {monsterType}!");
  354.                                                     Console.WriteLine("");
  355.                                                     Console.WriteLine("");
  356.                                                     Console.WriteLine("");
  357.  
  358.                                                     string stringGameOver = "GAME OVER!";
  359.  
  360.                                                     for (int i = 0; i < stringGameOver.Length; i++)
  361.                                                     {
  362.                                                         System.Threading.Thread.Sleep(1000);
  363.                                                         char letter = stringGameOver[i];
  364.  
  365.                                                         Console.Write(letter);
  366.                                                     }
  367.                                                 }
  368.  
  369.                                                 else if (monsterDead == true)
  370.                                                 {
  371.                                                     int xpEarned = random.Next(15, 51);
  372.                                                     playerXp += xpEarned;
  373.  
  374.                                                     int coinsEarned = random.Next(50, 101);
  375.                                                     playerCoins += coinsEarned;
  376.  
  377.                                                     if (playerXp >= 100)
  378.                                                     {
  379.                                                         playerLevel++;
  380.                                                         playerXp = playerXp - 100;
  381.                                                         playerHp += 5;
  382.                                                         playerCoins += 50;
  383.  
  384.                                                         if (playerLevel % 2 == 0)
  385.                                                         {
  386.                                                             playerAttack += 1;
  387.                                                             playerMagic += 1;
  388.                                                         }
  389.                                                     }
  390.                                                     Console.WriteLine("");
  391.                                                     System.Threading.Thread.Sleep(2000);
  392.                                                     Console.WriteLine($"You have killed the {monsterType}!");
  393.                                                     Console.WriteLine("");
  394.                                                     System.Threading.Thread.Sleep(1000);
  395.                                                     Console.WriteLine($"You have earned {xpEarned} XP!");
  396.                                                     System.Threading.Thread.Sleep(1000);
  397.                                                     Console.WriteLine($"You have earned {coinsEarned} coins!");
  398.                                                     Console.WriteLine("");
  399.                                                     System.Threading.Thread.Sleep(2000);
  400.                                                     Console.WriteLine($"Entering next room...");
  401.                                                     System.Threading.Thread.Sleep(2000);
  402.                                                     Console.Clear();
  403.                                                 }
  404.                                             }
  405.                                             break;
  406.  
  407.                                         case 2:
  408.  
  409.                                             int chanceRun = random.Next(1, 5);
  410.  
  411.                                             switch (chanceRun)
  412.                                             {
  413.                                                 case 1:
  414.                                                 case 2:
  415.                                                 case 3:
  416.                                                     Console.WriteLine("");
  417.                                                     System.Threading.Thread.Sleep(2000);
  418.                                                     Console.WriteLine($"Your attempt to run from the {monsterType} was not successful!");
  419.  
  420.                                                     monsterDead = false;
  421.                                                     playerDead = false;
  422.  
  423.                                                     Console.WriteLine("");
  424.                                                     System.Threading.Thread.Sleep(2000);
  425.                                                     Console.WriteLine($"You have entered in a fight with the {monsterType}");
  426.                                                     System.Threading.Thread.Sleep(2000);
  427.  
  428.                                                     while (!monsterDead && !playerDead)
  429.                                                     {
  430.                                                         monsterHp -= playerAttack;
  431.                                                         playerHp -= (monsterAttack - playerDefence);
  432.  
  433.                                                         if (playerHp <= 0)
  434.                                                         {
  435.                                                             playerDead = true;
  436.                                                         }
  437.  
  438.                                                         else if (monsterHp <= 0)
  439.                                                         {
  440.                                                             monsterDead = true;
  441.                                                         }
  442.  
  443.                                                         if (playerDead == true)
  444.                                                         {
  445.                                                             gameOver = true;
  446.  
  447.                                                             Console.WriteLine($"You have been killed by {monsterType}!");
  448.                                                             Console.WriteLine("");
  449.                                                             Console.WriteLine("");
  450.                                                             Console.WriteLine("");
  451.  
  452.                                                             string stringGameOver = "GAME OVER!";
  453.  
  454.                                                             for (int i = 0; i < stringGameOver.Length; i++)
  455.                                                             {
  456.                                                                 System.Threading.Thread.Sleep(1000);
  457.                                                                 char letter = stringGameOver[i];
  458.  
  459.                                                                 Console.Write(letter);
  460.                                                             }
  461.                                                         }
  462.  
  463.                                                         else if (monsterDead == true)
  464.                                                         {
  465.                                                             int xpEarned = random.Next(15, 51);
  466.                                                             playerXp += xpEarned;
  467.  
  468.                                                             int coinsEarned = random.Next(50, 101);
  469.                                                             playerCoins += coinsEarned;
  470.  
  471.                                                             if (playerXp >= 100)
  472.                                                             {
  473.                                                                 playerLevel++;
  474.                                                                 playerXp = playerXp - 100;
  475.                                                                 playerHp += 5;
  476.                                                                 playerCoins += 50;
  477.  
  478.                                                                 if (playerLevel % 2 == 0)
  479.                                                                 {
  480.                                                                     playerAttack += 1;
  481.                                                                     playerMagic += 1;
  482.                                                                 }
  483.                                                             }
  484.                                                             Console.WriteLine("");
  485.                                                             System.Threading.Thread.Sleep(2000);
  486.                                                             Console.WriteLine($"You have killed the {monsterType}!");
  487.                                                             Console.WriteLine("");
  488.                                                             System.Threading.Thread.Sleep(1000);
  489.                                                             Console.WriteLine($"You have earned {xpEarned} XP!");
  490.                                                             System.Threading.Thread.Sleep(1000);
  491.                                                             Console.WriteLine($"You have earned {coinsEarned} coins!");
  492.                                                             Console.WriteLine("");
  493.                                                             System.Threading.Thread.Sleep(2000);
  494.                                                             Console.WriteLine($"Entering next room...");
  495.                                                             System.Threading.Thread.Sleep(2000);
  496.                                                             Console.Clear();
  497.                                                         }
  498.                                                     }
  499.                                                     break;
  500.  
  501.                                                 case 4:
  502.                                                     Console.WriteLine("");
  503.                                                     System.Threading.Thread.Sleep(2000);
  504.                                                     Console.WriteLine($"You have successfully escaped from the {monsterType}!");
  505.                                                     Console.WriteLine("");
  506.                                                     System.Threading.Thread.Sleep(2000);
  507.                                                     Console.WriteLine("Entering next room...");
  508.                                                     Console.Clear();
  509.                                                     break;
  510.                                             }
  511.                                             break;
  512.                                     }
  513.                                 }
  514.                                 break;
  515.  
  516.                             case 3:
  517.  
  518.                                 int chance = random.Next(1, 5);
  519.  
  520.                                 switch (chance)
  521.                                 {
  522.                                     case 1:
  523.                                     case 2:
  524.                                     case 3:
  525.                                         Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  526.                                         Console.WriteLine("");
  527.                                         Console.WriteLine("");
  528.                                         Console.WriteLine("");
  529.                                         System.Threading.Thread.Sleep(2000);
  530.                                         Console.WriteLine($"Your attempt to run from the {monsterType} was not successful!");
  531.                                         System.Threading.Thread.Sleep(2000);
  532.  
  533.                                         monsterDead = false;
  534.                                         playerDead = false;
  535.  
  536.                                         Console.WriteLine("");
  537.                                         System.Threading.Thread.Sleep(2000);
  538.                                         Console.WriteLine($"You have entered in a fight with the {monsterType}");
  539.                                         System.Threading.Thread.Sleep(2000);
  540.  
  541.                                         while (!monsterDead && !playerDead)
  542.                                         {
  543.                                             monsterHp -= playerAttack;
  544.                                             playerHp -= (monsterAttack - playerDefence);
  545.  
  546.                                             if (playerHp <= 0)
  547.                                             {
  548.                                                 playerDead = true;
  549.                                             }
  550.  
  551.                                             else if (monsterHp <= 0)
  552.                                             {
  553.                                                 monsterDead = true;
  554.                                             }
  555.  
  556.                                             if (playerDead == true)
  557.                                             {
  558.                                                 gameOver = true;
  559.  
  560.                                                 Console.WriteLine($"You have been killed by {monsterType}!");
  561.                                                 Console.WriteLine("");
  562.                                                 Console.WriteLine("");
  563.                                                 Console.WriteLine("");
  564.  
  565.                                                 string stringGameOver = "GAME OVER!";
  566.  
  567.                                                 for (int i = 0; i < stringGameOver.Length; i++)
  568.                                                 {
  569.                                                     System.Threading.Thread.Sleep(1000);
  570.                                                     char letter = stringGameOver[i];
  571.  
  572.                                                     Console.Write(letter);
  573.                                                 }
  574.                                             }
  575.  
  576.                                             else if (monsterDead == true)
  577.                                             {
  578.                                                 int xpEarned = random.Next(15, 51);
  579.                                                 playerXp += xpEarned;
  580.  
  581.                                                 int coinsEarned = random.Next(50, 101);
  582.                                                 playerCoins += coinsEarned;
  583.  
  584.                                                 if (playerXp >= 100)
  585.                                                 {
  586.                                                     playerLevel++;
  587.                                                     playerXp = playerXp - 100;
  588.                                                     playerHp += 5;
  589.                                                     playerCoins += 50;
  590.  
  591.                                                     if (playerLevel % 2 == 0)
  592.                                                     {
  593.                                                         playerAttack += 1;
  594.                                                         playerMagic += 1;
  595.                                                     }
  596.                                                 }
  597.                                                 Console.WriteLine("");
  598.                                                 System.Threading.Thread.Sleep(2000);
  599.                                                 Console.WriteLine($"You have killed the {monsterType}!");
  600.                                                 Console.WriteLine("");
  601.                                                 System.Threading.Thread.Sleep(1000);
  602.                                                 Console.WriteLine($"You have earned {xpEarned} XP!");
  603.                                                 System.Threading.Thread.Sleep(1000);
  604.                                                 Console.WriteLine($"You have earned {coinsEarned} coins!");
  605.                                                 Console.WriteLine("");
  606.                                                 System.Threading.Thread.Sleep(2000);
  607.                                                 Console.WriteLine($"Entering next room...");
  608.                                                 System.Threading.Thread.Sleep(2000);
  609.                                                 Console.Clear();
  610.                                             }
  611.                                         }
  612.                                         break;
  613.  
  614.                                     case 4:
  615.                                         Console.WriteLine("");
  616.                                         System.Threading.Thread.Sleep(2000);
  617.                                         Console.WriteLine($"You have successfully escaped from the {monsterType}!");
  618.                                         Console.WriteLine("");
  619.                                         System.Threading.Thread.Sleep(2000);
  620.                                         Console.WriteLine("Entering next room...");
  621.                                         Console.WriteLine("");
  622.                                         System.Threading.Thread.Sleep(2000);
  623.                                         Console.Clear();
  624.                                         break;
  625.                                 }
  626.                                 break;
  627.                         }
  628.  
  629.                         if (gameOver == true)
  630.                         {
  631.                             break;
  632.                         }
  633.                     }
  634.  
  635.                     if (gameOver == true)
  636.                     {
  637.                         break;
  638.                     }
  639.  
  640.                     else if (roomType == "Chest room")
  641.                     {
  642.                         int chestType = random.Next(1, 6);
  643.  
  644.                         Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  645.                         Console.WriteLine("");
  646.                         Console.WriteLine("");
  647.                         System.Threading.Thread.Sleep(1000);
  648.                         Console.WriteLine($"ROOM - {room}, {roomType}!");
  649.                         Console.WriteLine("");
  650.                         Console.WriteLine("");
  651.                         Console.WriteLine("");
  652.  
  653.                         string reward = "";
  654.                         System.Threading.Thread.Sleep(1000);
  655.                         Console.WriteLine("You have found a chest!");
  656.  
  657.                         switch (chestType)
  658.                         {
  659.                             case 1:
  660.                                 reward = "coins";
  661.                                 int coinsGained = random.Next(50, 151);
  662.                                 playerCoins += coinsGained;
  663.  
  664.                                 Console.WriteLine("");
  665.                                 System.Threading.Thread.Sleep(2000);
  666.                                 Console.WriteLine($"You have been rewarded with {coinsGained} {reward}!");
  667.                                 Console.WriteLine("");
  668.                                 System.Threading.Thread.Sleep(3000);
  669.                                 Console.WriteLine("Entering next room...");
  670.                                 System.Threading.Thread.Sleep(3000);
  671.                                 Console.Clear();
  672.                                 break;
  673.  
  674.                             case 2:
  675.                                 reward = "healing potion";
  676.                                 playerHp += 20;
  677.  
  678.                                 if (playerHp > 100)
  679.                                 {
  680.                                     playerHp = 100;
  681.                                 }
  682.  
  683.                                 Console.WriteLine("");
  684.                                 System.Threading.Thread.Sleep(2000);
  685.                                 Console.WriteLine($"You have been rewarded with {reward} (+20 HP)!");
  686.                                 Console.WriteLine("");
  687.                                 System.Threading.Thread.Sleep(3000);
  688.                                 Console.WriteLine("Entering next room...");
  689.                                 System.Threading.Thread.Sleep(3000);
  690.                                 Console.Clear();
  691.                                 break;
  692.  
  693.                             case 3:
  694.                                 reward = "magic book";
  695.                                 playerMagic += 5;
  696.  
  697.                                 Console.WriteLine("");
  698.                                 System.Threading.Thread.Sleep(2000);
  699.                                 Console.WriteLine($"You have been rewarded with {reward} (+5 magic)!");
  700.                                 Console.WriteLine("");
  701.  
  702.                                 System.Threading.Thread.Sleep(3000);
  703.                                 Console.WriteLine("Entering next room...");
  704.                                 System.Threading.Thread.Sleep(3000);
  705.                                 Console.Clear();
  706.                                 break;
  707.  
  708.                             case 4:
  709.  
  710.                                 string armourType = "";
  711.  
  712.                                 int randomArmour = random.Next(1, 7);
  713.  
  714.                                 switch (randomArmour)
  715.                                 {
  716.                                     case 1:
  717.                                     case 2:
  718.                                         armourType = "Leather armour";
  719.  
  720.                                         if (playerArmour == "None")
  721.                                         {
  722.                                             playerArmour = armourType;
  723.                                             playerDefence += 2;
  724.                                         }
  725.                                         break;
  726.  
  727.                                     case 3:
  728.                                     case 4:
  729.                                         armourType = "Rusty armour";
  730.  
  731.                                         if (playerArmour == "None" || playerArmour == "Leather armour")
  732.                                         {
  733.                                             playerArmour = armourType;
  734.                                             playerDefence += 4;
  735.                                         }
  736.                                         break;
  737.  
  738.                                     case 5:
  739.                                         armourType = "Iron armour";
  740.  
  741.                                         if (playerArmour == "None" || playerArmour == "Leather armour" || playerArmour == "Rusty armour")
  742.                                         {
  743.                                             playerArmour = armourType;
  744.                                             playerDefence += 6;
  745.                                         }
  746.                                         break;
  747.  
  748.                                     case 6:
  749.                                         armourType = "Steel armour";
  750.  
  751.                                         if (playerArmour == "None" || playerArmour == "Leather armour" || playerArmour == "Rusty armour" || playerArmour == "Iron armour")
  752.                                         {
  753.                                             playerArmour = armourType;
  754.                                             playerDefence += 8;
  755.                                         }
  756.                                         break;
  757.                                 }
  758.  
  759.                                 Console.WriteLine("");
  760.                                 System.Threading.Thread.Sleep(2000);
  761.                                 Console.WriteLine($"You have been rewarded with {armourType} (Defence++)!");
  762.                                 Console.WriteLine("");
  763.  
  764.                                 System.Threading.Thread.Sleep(3000);
  765.                                 Console.WriteLine("Entering next room...");
  766.                                 System.Threading.Thread.Sleep(3000);
  767.                                 Console.Clear();
  768.                                 break;
  769.  
  770.                             case 5:
  771.  
  772.                                 string weaponType = "";
  773.  
  774.                                 int randomWeapon = random.Next(1, 7);
  775.  
  776.                                 switch (randomWeapon)
  777.                                 {
  778.                                     case 1:
  779.                                     case 2:
  780.                                         weaponType = "Knife";
  781.  
  782.                                         if (playerWeapon == "None")
  783.                                         {
  784.                                             playerWeapon = weaponType;
  785.                                             playerAttack += 2;
  786.                                         }
  787.                                         break;
  788.  
  789.                                     case 3:
  790.                                     case 4:
  791.                                         weaponType = "Spear";
  792.  
  793.                                         if (playerWeapon == "None" || playerWeapon == "Knife")
  794.                                         {
  795.                                             playerWeapon = weaponType;
  796.                                             playerAttack += 4;
  797.                                         }
  798.                                         break;
  799.  
  800.                                     case 5:
  801.                                         weaponType = "Axe";
  802.  
  803.                                         if (playerWeapon == "None" || playerWeapon == "Knife" || playerWeapon == "Spear")
  804.                                         {
  805.                                             playerWeapon = weaponType;
  806.                                             playerAttack += 6;
  807.                                         }
  808.                                         break;
  809.  
  810.                                     case 6:
  811.                                         weaponType = "Sword";
  812.  
  813.                                         if (playerWeapon == "None" || playerWeapon == "Knife" || playerWeapon == "Spear" || playerWeapon == "Axe")
  814.                                         {
  815.                                             playerWeapon = weaponType;
  816.                                             playerAttack += 8;
  817.                                         }
  818.                                         break;
  819.                                 }
  820.  
  821.                                 Console.WriteLine("");
  822.                                 System.Threading.Thread.Sleep(2000);
  823.                                 Console.WriteLine($"You have been rewarded with {weaponType} (Attack++)!");
  824.                                 Console.WriteLine("");
  825.  
  826.                                 System.Threading.Thread.Sleep(3000);
  827.                                 Console.WriteLine("Entering next room...");
  828.                                 System.Threading.Thread.Sleep(3000);
  829.                                 Console.Clear();
  830.                                 break;
  831.                         }
  832.  
  833.                     }
  834.  
  835.                     else if (roomType == "Regeneration room")
  836.                     {
  837.                         Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  838.                         Console.WriteLine("");
  839.                         Console.WriteLine("");
  840.                         System.Threading.Thread.Sleep(1000);
  841.                         Console.WriteLine($"ROOM - {room}, {roomType}!");
  842.                         Console.WriteLine("");
  843.                         Console.WriteLine("");
  844.                         Console.WriteLine("");
  845.  
  846.                         Console.WriteLine("");
  847.                         System.Threading.Thread.Sleep(1000);
  848.                         Console.WriteLine("Congratulations, you have entered a regeneration room!");
  849.                         Console.WriteLine("");
  850.                         System.Threading.Thread.Sleep(2000);
  851.                         Console.WriteLine("Your health has been fully restored!");
  852.                         playerHp = 100;
  853.                         System.Threading.Thread.Sleep(1000);
  854.                         Console.Clear();
  855.                     }
  856.  
  857.                     else if (roomType == "Shop room")
  858.                     {
  859.                         bool exitShop = false;
  860.                         int productPrice = 0;
  861.  
  862.                         while (!exitShop)
  863.                         {
  864.                             Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  865.                             Console.WriteLine("");
  866.                             Console.WriteLine("");
  867.                             System.Threading.Thread.Sleep(1000);
  868.                             Console.WriteLine($"ROOM - {room}, {roomType}!");
  869.                             Console.WriteLine("");
  870.                             Console.WriteLine("");
  871.                             Console.WriteLine("");
  872.  
  873.                             System.Threading.Thread.Sleep(1000);
  874.                             Console.WriteLine("You have entered the shop!");
  875.                             Console.WriteLine("");
  876.                             System.Threading.Thread.Sleep(1000);
  877.                             Console.WriteLine("The shop can offer:");
  878.                             Console.WriteLine("");
  879.                             System.Threading.Thread.Sleep(1000);
  880.                             Console.WriteLine("1 - Healing potions (80 coins)");
  881.                             System.Threading.Thread.Sleep(1000);
  882.                             Console.WriteLine("2 - Magic books (200 coins)");
  883.                             System.Threading.Thread.Sleep(1000);
  884.                             Console.WriteLine("3 - Armours (select to view)");
  885.                             System.Threading.Thread.Sleep(1000);
  886.                             Console.WriteLine("4 - Weapons (select to view)");
  887.                             System.Threading.Thread.Sleep(1000);
  888.                             Console.WriteLine("5 - Exit shop");
  889.                             System.Threading.Thread.Sleep(1000);
  890.                             Console.Write("You decide to buy: ");
  891.                             int shopChoice = int.Parse(Console.ReadLine());
  892.  
  893.                             switch (shopChoice)
  894.                             {
  895.                                 case 1:
  896.                                     productPrice = 80;
  897.  
  898.                                     if (playerCoins >= productPrice)
  899.                                     {
  900.                                         playerHp += 20;
  901.  
  902.                                         if (playerHp > 100)
  903.                                         {
  904.                                             playerHp = 100;
  905.                                         }
  906.  
  907.                                         Console.WriteLine("");
  908.                                         System.Threading.Thread.Sleep(1000);
  909.                                         Console.WriteLine("You have bought a healing potion!");
  910.                                         Console.WriteLine("");
  911.                                         System.Threading.Thread.Sleep(1000);
  912.                                         Console.WriteLine("You have slightly recovered your health!");
  913.                                         playerCoins -= productPrice;
  914.                                         System.Threading.Thread.Sleep(2000);
  915.                                         Console.Clear();
  916.                                     }
  917.  
  918.                                     else
  919.                                     {
  920.                                         Console.WriteLine("");
  921.                                         System.Threading.Thread.Sleep(2000);
  922.                                         Console.WriteLine("You do not have enough coins to buy this!");
  923.                                         System.Threading.Thread.Sleep(2000);
  924.                                         Console.Clear();
  925.                                     }
  926.                                     break;
  927.  
  928.                                 case 2:
  929.                                     productPrice = 200;
  930.  
  931.                                     if (playerCoins >= productPrice)
  932.                                     {
  933.                                         Console.WriteLine("");
  934.                                         System.Threading.Thread.Sleep(1000);
  935.                                         Console.WriteLine("You have bought a magic book!");
  936.                                         Console.WriteLine("");
  937.                                         System.Threading.Thread.Sleep(1000);
  938.                                         Console.WriteLine("Your magic abilities have increased!");
  939.                                         playerCoins -= productPrice;
  940.                                         Console.Clear();
  941.                                     }
  942.  
  943.                                     else
  944.                                     {
  945.                                         Console.WriteLine("");
  946.                                         System.Threading.Thread.Sleep(1000);
  947.                                         Console.WriteLine("You do not have enough coins to buy this!");
  948.                                         System.Threading.Thread.Sleep(2000);
  949.                                         Console.Clear();
  950.                                     }
  951.                                     break;
  952.  
  953.                                 case 3:
  954.                                     string armourType = "";
  955.                                     int price = 0;
  956.  
  957.                                     Console.WriteLine("");
  958.  
  959.                                     System.Threading.Thread.Sleep(2000);
  960.                                     Console.WriteLine("The shop can offer this armour types:");
  961.                                     Console.WriteLine("1 - Leather armour (200 coins)");
  962.                                     Console.WriteLine("2 - Rusty armour (400 coins)");
  963.                                     Console.WriteLine("3 - Iron armour (600 coins)");
  964.                                     Console.WriteLine("4 - Steel armour (800 coins)");
  965.                                     Console.WriteLine("5 - Go back");
  966.                                     Console.WriteLine("");
  967.                                     System.Threading.Thread.Sleep(2000);
  968.                                     Console.Write("Your choice is: ");
  969.  
  970.                                     int choice = int.Parse(Console.ReadLine());
  971.  
  972.                                     switch (choice)
  973.                                     {
  974.                                         case 1:
  975.  
  976.                                             price = 200;
  977.                                             armourType = "Leather armour";
  978.  
  979.                                             if (playerCoins >= price)
  980.                                             {
  981.                                                 if (playerArmour == "None")
  982.                                                 {
  983.                                                     playerArmour = armourType;
  984.                                                     playerDefence += 2;
  985.                                                     Console.WriteLine("");
  986.                                                     System.Threading.Thread.Sleep(1000);
  987.                                                     Console.WriteLine($"Congratulations, you have bought {armourType}!");
  988.                                                     playerCoins -= price;
  989.                                                 }
  990.  
  991.                                                 else if (playerArmour == "Leather armour")
  992.                                                 {
  993.                                                     Console.WriteLine("");
  994.                                                     System.Threading.Thread.Sleep(1000);
  995.                                                     Console.WriteLine("You already have this armour!");
  996.                                                 }
  997.  
  998.                                                 else
  999.                                                 {
  1000.                                                     Console.WriteLine("");
  1001.                                                     System.Threading.Thread.Sleep(1000);
  1002.                                                     Console.WriteLine("You have a better armour equipped already!");
  1003.                                                 }
  1004.                                                 System.Threading.Thread.Sleep(2000);
  1005.                                                 Console.Clear();
  1006.                                                 break;
  1007.                                             }
  1008.  
  1009.                                             else
  1010.                                             {
  1011.                                                 Console.WriteLine("");
  1012.                                                 System.Threading.Thread.Sleep(1000);
  1013.                                                 Console.WriteLine("You do not have enough coins to buy this!");
  1014.                                                 Console.Clear();
  1015.                                             }
  1016.                                             break;
  1017.  
  1018.                                         case 2:
  1019.  
  1020.                                             price = 400;
  1021.  
  1022.                                             if (playerCoins >= price)
  1023.                                             {
  1024.                                                 if (playerArmour == "None" || playerArmour == "Leather armour")
  1025.                                                 {
  1026.                                                     playerArmour = armourType;
  1027.                                                     Console.WriteLine("");
  1028.                                                     playerDefence += 4;
  1029.                                                     System.Threading.Thread.Sleep(1000);
  1030.                                                     Console.WriteLine($"Congratulations, you have bought {armourType}!");
  1031.                                                     playerCoins -= price;
  1032.                                                 }
  1033.  
  1034.                                                 else if (playerArmour == "Rusty armour")
  1035.                                                 {
  1036.                                                     Console.WriteLine("");
  1037.                                                     System.Threading.Thread.Sleep(1000);
  1038.                                                     Console.WriteLine("You already have this armour!");
  1039.                                                 }
  1040.  
  1041.                                                 else
  1042.                                                 {
  1043.                                                     Console.WriteLine("");
  1044.                                                     System.Threading.Thread.Sleep(1000);
  1045.                                                     Console.WriteLine("You have a better armour equipped already!");
  1046.                                                 }
  1047.  
  1048.                                                 System.Threading.Thread.Sleep(2000);
  1049.                                                 Console.Clear();
  1050.                                                 break;
  1051.                                             }
  1052.  
  1053.                                             else
  1054.                                             {
  1055.                                                 Console.WriteLine("");
  1056.                                                 System.Threading.Thread.Sleep(1000);
  1057.                                                 Console.WriteLine("You do not have enough coins to buy this!");
  1058.                                                 Console.Clear();
  1059.                                             }
  1060.                                             break;
  1061.  
  1062.                                         case 3:
  1063.  
  1064.                                             price = 600;
  1065.  
  1066.                                             if (playerCoins >= price)
  1067.                                             {
  1068.                                                 if (playerArmour == "None" || playerArmour == "Leather armour" || playerArmour == "Rusty armour")
  1069.                                                 {
  1070.                                                     playerArmour = armourType;
  1071.                                                     Console.WriteLine("");
  1072.                                                     playerDefence += 6;
  1073.                                                     System.Threading.Thread.Sleep(1000);
  1074.                                                     Console.WriteLine($"Congratulations, you have bought {armourType}!");
  1075.                                                     playerCoins -= price;
  1076.                                                 }
  1077.  
  1078.                                                 else if (playerArmour == "Iron armour")
  1079.                                                 {
  1080.                                                     Console.WriteLine("");
  1081.                                                     System.Threading.Thread.Sleep(1000);
  1082.                                                     Console.WriteLine("You already have this armour!");
  1083.                                                 }
  1084.  
  1085.                                                 else
  1086.                                                 {
  1087.                                                     Console.WriteLine("");
  1088.                                                     System.Threading.Thread.Sleep(1000);
  1089.                                                     Console.WriteLine("You have a better armour equipped already!");
  1090.                                                 }
  1091.  
  1092.                                                 System.Threading.Thread.Sleep(2000);
  1093.                                                 Console.Clear();
  1094.                                                 break;
  1095.                                             }
  1096.  
  1097.                                             else
  1098.                                             {
  1099.                                                 Console.WriteLine("");
  1100.                                                 System.Threading.Thread.Sleep(1000);
  1101.                                                 Console.WriteLine("You do not have enough coins to buy this!");
  1102.                                                 Console.Clear();
  1103.                                             }
  1104.                                             break;
  1105.  
  1106.                                         case 4:
  1107.  
  1108.                                             price = 800;
  1109.  
  1110.                                             if (playerCoins >= price)
  1111.                                             {
  1112.                                                 if (playerArmour == "None" || playerArmour == "Leather armour" || playerArmour == "Rusty armour" || playerArmour == "Iron armour")
  1113.                                                 {
  1114.                                                     playerArmour = armourType;
  1115.                                                     Console.WriteLine("");
  1116.                                                     playerDefence += 8;
  1117.                                                     System.Threading.Thread.Sleep(1000);
  1118.                                                     Console.WriteLine($"Congratulations, you have bought {armourType}!");
  1119.                                                     playerCoins -= price;
  1120.                                                 }
  1121.  
  1122.                                                 else if (playerArmour == "Steel armour")
  1123.                                                 {
  1124.                                                     Console.WriteLine("");
  1125.                                                     System.Threading.Thread.Sleep(1000);
  1126.                                                     Console.WriteLine("You already have this armour!");
  1127.                                                 }
  1128.  
  1129.                                                 else
  1130.                                                 {
  1131.                                                     Console.WriteLine("");
  1132.                                                     System.Threading.Thread.Sleep(1000);
  1133.                                                     Console.WriteLine("You have a better armour equipped already!");
  1134.                                                 }
  1135.  
  1136.                                                 System.Threading.Thread.Sleep(2000);
  1137.                                                 Console.Clear();
  1138.                                                 break;
  1139.                                             }
  1140.  
  1141.                                             else
  1142.                                             {
  1143.                                                 Console.WriteLine("");
  1144.                                                 System.Threading.Thread.Sleep(1000);
  1145.                                                 Console.WriteLine("You do not have enough coins to buy this!");
  1146.                                                 Console.Clear();
  1147.                                             }
  1148.  
  1149.                                             break;
  1150.  
  1151.                                         case 5:
  1152.                                             Console.WriteLine("");
  1153.                                             System.Threading.Thread.Sleep(1000);
  1154.                                             Console.WriteLine("Going back to shop...");
  1155.                                             System.Threading.Thread.Sleep(2000);
  1156.                                             exitShop = true;
  1157.                                             Console.Clear();
  1158.                                             break;
  1159.                                     }
  1160.                                     break;
  1161.  
  1162.                                 case 4:
  1163.  
  1164.                                     int weaponPrice = 0;
  1165.  
  1166.                                     Console.WriteLine("");
  1167.                                     System.Threading.Thread.Sleep(2000);
  1168.                                     Console.WriteLine("The shop can offer this weapon types:");
  1169.                                     Console.WriteLine("1 - Knife (200 coins)");
  1170.                                     Console.WriteLine("2 - Spear (400 coins)");
  1171.                                     Console.WriteLine("3 - Axe (600 coins)");
  1172.                                     Console.WriteLine("4 - Sword (800 coins)");
  1173.                                     Console.WriteLine("5 - Go back");
  1174.                                     Console.WriteLine("");
  1175.                                     System.Threading.Thread.Sleep(2000);
  1176.                                     Console.Write("Your choice is: ");
  1177.  
  1178.                                     int weaponChoice = int.Parse(Console.ReadLine());
  1179.                                     string weaponType = "";
  1180.  
  1181.                                     switch (weaponChoice)
  1182.                                     {
  1183.                                         case 1:
  1184.  
  1185.                                             weaponPrice = 200;
  1186.                                             weaponType = "Knife";
  1187.  
  1188.                                             if (playerCoins >= weaponPrice)
  1189.                                             {
  1190.                                                 if (playerWeapon == "None")
  1191.                                                 {
  1192.                                                     Console.WriteLine("");
  1193.                                                     playerWeapon = "Knife";
  1194.                                                     playerAttack += 2;
  1195.                                                     System.Threading.Thread.Sleep(1000);
  1196.                                                     Console.WriteLine($"Congratulations, you have bought {weaponType}!");
  1197.                                                     playerCoins -= weaponPrice;
  1198.                                                 }
  1199.  
  1200.                                                 else if (playerWeapon == "Knife")
  1201.                                                 {
  1202.                                                     Console.WriteLine("");
  1203.                                                     System.Threading.Thread.Sleep(1000);
  1204.                                                     Console.WriteLine("You already have this weapon!");
  1205.                                                 }
  1206.  
  1207.                                                 else
  1208.                                                 {
  1209.                                                     Console.WriteLine("");
  1210.                                                     System.Threading.Thread.Sleep(1000);
  1211.                                                     Console.WriteLine("You have a better weapon equipped already!");
  1212.                                                 }
  1213.  
  1214.                                                 System.Threading.Thread.Sleep(2000);
  1215.                                                 Console.Clear();
  1216.                                                 break;
  1217.                                             }
  1218.  
  1219.                                             else
  1220.                                             {
  1221.                                                 Console.WriteLine("");
  1222.                                                 System.Threading.Thread.Sleep(1000);
  1223.                                                 Console.WriteLine("You do not have enough coins to buy this!");
  1224.                                                 Console.Clear();
  1225.                                             }
  1226.  
  1227.                                             break;
  1228.  
  1229.                                         case 2:
  1230.  
  1231.                                             weaponPrice = 400;
  1232.                                             weaponType = "Spear";
  1233.  
  1234.                                             if (playerCoins >= weaponPrice)
  1235.                                             {
  1236.                                                 if (playerWeapon == "None" || playerWeapon == "Knife")
  1237.                                                 {
  1238.                                                     Console.WriteLine("");
  1239.                                                     playerWeapon = "Spear";
  1240.                                                     playerAttack += 4;
  1241.                                                     System.Threading.Thread.Sleep(1000);
  1242.                                                     Console.WriteLine($"Congratulations, you have bought {weaponType}!");
  1243.                                                     playerCoins -= weaponPrice;
  1244.                                                 }
  1245.  
  1246.                                                 else if (playerWeapon == "Spear")
  1247.                                                 {
  1248.                                                     Console.WriteLine("");
  1249.                                                     System.Threading.Thread.Sleep(1000);
  1250.                                                     Console.WriteLine("You already have this weapon!");
  1251.                                                 }
  1252.  
  1253.                                                 else
  1254.                                                 {
  1255.                                                     Console.WriteLine("");
  1256.                                                     System.Threading.Thread.Sleep(1000);
  1257.                                                     Console.WriteLine("You have a better weapon equipped already!");
  1258.                                                 }
  1259.  
  1260.                                                 System.Threading.Thread.Sleep(2000);
  1261.                                                 Console.Clear();
  1262.                                                 break;
  1263.                                             }
  1264.  
  1265.                                             else
  1266.                                             {
  1267.                                                 Console.WriteLine("");
  1268.                                                 System.Threading.Thread.Sleep(1000);
  1269.                                                 Console.WriteLine("You do not have enough coins to buy this!");
  1270.                                                 Console.Clear();
  1271.                                             }
  1272.                                             break;
  1273.  
  1274.                                         case 3:
  1275.  
  1276.                                             weaponPrice = 600;
  1277.                                             weaponType = "Axe";
  1278.  
  1279.                                             if (playerCoins >= weaponPrice)
  1280.                                             {
  1281.                                                 if (playerWeapon == "None" || playerWeapon == "Knife" || playerWeapon == "Spear")
  1282.                                                 {
  1283.                                                     Console.WriteLine("");
  1284.                                                     playerWeapon = "Axe";
  1285.                                                     playerAttack += 6;
  1286.                                                     System.Threading.Thread.Sleep(1000);
  1287.                                                     Console.WriteLine($"Congratulations, you have bought {weaponType}!");
  1288.                                                     playerCoins -= weaponPrice;
  1289.                                                 }
  1290.  
  1291.                                                 else if (playerWeapon == "Axe")
  1292.                                                 {
  1293.                                                     Console.WriteLine("");
  1294.                                                     System.Threading.Thread.Sleep(1000);
  1295.                                                     Console.WriteLine("You already have this weapon!");
  1296.                                                 }
  1297.  
  1298.                                                 else
  1299.                                                 {
  1300.                                                     Console.WriteLine("");
  1301.                                                     System.Threading.Thread.Sleep(1000);
  1302.                                                     Console.WriteLine("You have a better weapon equipped already!");
  1303.                                                 }
  1304.  
  1305.                                                 System.Threading.Thread.Sleep(2000);
  1306.                                                 Console.Clear();
  1307.                                                 break;
  1308.                                             }
  1309.  
  1310.                                             else
  1311.                                             {
  1312.                                                 Console.WriteLine("");
  1313.                                                 System.Threading.Thread.Sleep(1000);
  1314.                                                 Console.WriteLine("You do not have enough coins to buy this!");
  1315.                                                 Console.Clear();
  1316.                                             }
  1317.                                             break;
  1318.  
  1319.                                         case 4:
  1320.  
  1321.                                             weaponPrice = 800;
  1322.                                             weaponType = "Sword";
  1323.  
  1324.                                             if (playerCoins >= weaponPrice)
  1325.                                             {
  1326.                                                 if (playerWeapon == "None" || playerWeapon == "Knife" || playerWeapon == "Spear" || playerWeapon == "Axe")
  1327.                                                 {
  1328.                                                     Console.WriteLine("");
  1329.                                                     playerWeapon = "Sword";
  1330.                                                     playerAttack += 8;
  1331.                                                     System.Threading.Thread.Sleep(1000);
  1332.                                                     Console.WriteLine($"Congratulations, you have bought {weaponType}!");
  1333.                                                     playerCoins -= weaponPrice;
  1334.                                                 }
  1335.  
  1336.                                                 else if (playerWeapon == "Sword")
  1337.                                                 {
  1338.                                                     Console.WriteLine("");
  1339.                                                     System.Threading.Thread.Sleep(1000);
  1340.                                                     Console.WriteLine("You already have this weapon!");
  1341.                                                 }
  1342.  
  1343.                                                 else
  1344.                                                 {
  1345.                                                     Console.WriteLine("");
  1346.                                                     System.Threading.Thread.Sleep(1000);
  1347.                                                     Console.WriteLine("You have a better weapon equipped already!");
  1348.                                                 }
  1349.  
  1350.                                                 System.Threading.Thread.Sleep(2000);
  1351.                                                 Console.Clear();
  1352.                                                 break;
  1353.                                             }
  1354.  
  1355.                                             else
  1356.                                             {
  1357.                                                 Console.WriteLine("");
  1358.                                                 System.Threading.Thread.Sleep(1000);
  1359.                                                 Console.WriteLine("You do not have enough coins to buy this!");
  1360.                                                 Console.Clear();
  1361.                                             }
  1362.  
  1363.                                             break;
  1364.  
  1365.                                         case 5:
  1366.                                             Console.WriteLine("");
  1367.                                             System.Threading.Thread.Sleep(1000);
  1368.                                             Console.WriteLine("Going back to shop...");
  1369.                                             Console.Clear();
  1370.                                             break;
  1371.                                     }
  1372.                                     break;
  1373.  
  1374.                                 case 5:
  1375.                                     exitShop = true;
  1376.                                     Console.WriteLine("");
  1377.                                     System.Threading.Thread.Sleep(1000);
  1378.                                     Console.WriteLine("Leaving the shop...");
  1379.                                     System.Threading.Thread.Sleep(2000);
  1380.                                     Console.Clear();
  1381.                                     break;
  1382.                             }
  1383.                         }
  1384.                     }
  1385.  
  1386.                     else if (roomType == "Final boss room")
  1387.                     {
  1388.                         int bossHp = 150;
  1389.                         int bossAttack = 30;
  1390.  
  1391.                         Console.WriteLine($"Level:({playerLevel}) XP:({playerXp}) HP:({playerHp}) Attack:({playerAttack}) Defence:({playerDefence}) Magic:({playerMagic}) Coins:({playerCoins})");
  1392.                         Console.WriteLine("");
  1393.                         Console.WriteLine("");
  1394.                         System.Threading.Thread.Sleep(1000);
  1395.                         Console.WriteLine($"ROOM - {room}, {roomType}!");
  1396.                         Console.WriteLine("");
  1397.                         Console.WriteLine("");
  1398.                         Console.WriteLine("");
  1399.  
  1400.                         System.Threading.Thread.Sleep(2000);
  1401.                         Console.WriteLine("Congratulations for reaching this far...");
  1402.                         System.Threading.Thread.Sleep(2000);
  1403.                         Console.WriteLine("...You are about to enter the final room in the dungeon, but the hardest one too!");
  1404.                         System.Threading.Thread.Sleep(2000);
  1405.                         Console.WriteLine("Ready or not the final boss comes!");
  1406.                         System.Threading.Thread.Sleep(2000);
  1407.                         Console.Clear();
  1408.  
  1409.                         System.Threading.Thread.Sleep(3000);
  1410.                         Console.WriteLine($"*** Welcome {playerName}, i have expected you! ***");
  1411.                         Console.WriteLine("");
  1412.                         System.Threading.Thread.Sleep(3000);
  1413.                         Console.WriteLine("*** You don't look like a threat to me so i will make it easier for you... ***");
  1414.                         Console.WriteLine("");
  1415.                         System.Threading.Thread.Sleep(3000);
  1416.                         Console.WriteLine("*** ...We will play a game of rock-paper-scissors. ***");
  1417.                         Console.WriteLine("");
  1418.                         System.Threading.Thread.Sleep(3000);
  1419.                         Console.WriteLine("** If you win i will remove my armour and weapons so your chances are not zero... ***");
  1420.                         Console.WriteLine("");
  1421.                         System.Threading.Thread.Sleep(3000);
  1422.                         Console.Clear();
  1423.  
  1424.                         System.Threading.Thread.Sleep(2000);
  1425.                         Console.WriteLine("1 - Rock");
  1426.                         System.Threading.Thread.Sleep(1000);
  1427.                         Console.WriteLine("2 - Paper");
  1428.                         System.Threading.Thread.Sleep(1000);
  1429.                         Console.WriteLine("3 - Scissors");
  1430.                         System.Threading.Thread.Sleep(2000);
  1431.                         Console.WriteLine("");
  1432.                         Console.Write("You choose: ");
  1433.  
  1434.                         string choice = Console.ReadLine();
  1435.                         string bossChoice = "";
  1436.  
  1437.                         int bossRandom = random.Next(1, 4);
  1438.  
  1439.                         switch (bossRandom)
  1440.                         {
  1441.                             case 1:
  1442.                                 bossChoice = "Rock";
  1443.                                 break;
  1444.                             case 2:
  1445.                                 bossChoice = "Paper";
  1446.                                 break;
  1447.                             case 3:
  1448.                                 bossChoice = "Scissors";
  1449.                                 break;
  1450.                         }
  1451.  
  1452.                         Console.WriteLine($"Boss has chosen: {bossChoice}");
  1453.                         Console.WriteLine("");
  1454.  
  1455.                         if ((choice == "Rock" && bossChoice == "Scissors") || (choice == "Paper" && bossChoice == "Rock") || (choice == "Scissors" && bossChoice == "Paper"))
  1456.                         {
  1457.                             System.Threading.Thread.Sleep(2000);
  1458.                             Console.WriteLine("You have won! The boss drops his armour and weapons!");
  1459.                             bossHp -= 50;
  1460.                         }
  1461.  
  1462.                         else if ((choice == "Rock" && bossChoice == "Paper") || (choice == "Paper" && bossChoice == "Scissors") || (choice == "Scissors" && bossChoice == "Rock"))
  1463.                         {
  1464.                             System.Threading.Thread.Sleep(2000);
  1465.                             Console.WriteLine("You have lost! The boss keeps his equipment on!");
  1466.                         }
  1467.                         System.Threading.Thread.Sleep(2000);
  1468.                         Console.Clear();
  1469.  
  1470.                         System.Threading.Thread.Sleep(2000);
  1471.                         Console.WriteLine("*** Prepare for battle little human! ***");
  1472.  
  1473.                         bool playerDead = false;
  1474.                         bool bossDead = false;
  1475.  
  1476.                         while (!playerDead && !bossDead)
  1477.                         {
  1478.                             bossHp -= playerAttack;
  1479.                             Console.WriteLine("");
  1480.                             System.Threading.Thread.Sleep(1000);
  1481.                             Console.WriteLine($"Boss health -{playerAttack}");
  1482.  
  1483.                             if (bossHp <= 0)
  1484.                             {
  1485.                                 bossDead = true;
  1486.                                 continue;
  1487.                             }
  1488.  
  1489.                             playerHp -= bossAttack;
  1490.                             Console.WriteLine("");
  1491.                             System.Threading.Thread.Sleep(1000);
  1492.                             Console.WriteLine($"Player health -{bossAttack}");
  1493.  
  1494.                             if (playerHp <= 0)
  1495.                             {
  1496.                                 playerDead = true;
  1497.                                 continue;
  1498.                             }
  1499.                         }
  1500.  
  1501.                         Console.Clear();
  1502.  
  1503.                         if (bossDead)
  1504.                         {
  1505.                             gameIsWon = true;
  1506.                             string game = "GAME IS WON!";
  1507.                             System.Threading.Thread.Sleep(2000);
  1508.                             Console.WriteLine($"Congratulations {playerName}! You have killed the final boss and completed the dungeon");
  1509.                             Console.WriteLine("");
  1510.                             System.Threading.Thread.Sleep(1000);
  1511.  
  1512.                             for (int i = 0; i < game.Length; i++)
  1513.                             {
  1514.                                 char letter = game[i];
  1515.                                 System.Threading.Thread.Sleep(1000);
  1516.                                 Console.Write(letter);
  1517.                             }
  1518.                             break;
  1519.                         }
  1520.                     }
  1521.                 }
  1522.             }
  1523.         }
  1524.     }
  1525. }
Add Comment
Please, Sign In to add comment