Advertisement
LeRoY_Go

Untitled

Jan 25th, 2022
717
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.55 KB | None | 0 0
  1. using System;
  2.  
  3. namespace C_Sharp_Junior
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Вы – теневой маг и у вас в арсенале есть несколько заклинаний, \n" +
  10.                 "которые вы можете использовать против Босса. Вы должны уничтожить босса\n" +
  11.                 "и только после этого будет вам покой.\n" +
  12.                 "Босс - здаравенный орк!!!!!\nПора убить эту тварь!");
  13.  
  14.             int healthUser = 1000;
  15.             int healthOrc = 1000;
  16.             Random rand = new Random();
  17.             int damageOrc = rand.Next(40, 80);
  18.             int damageUser = rand.Next(20, 45);
  19.             bool isRashamonCast = false;
  20.  
  21.  
  22.             while (healthUser > 0 && healthOrc > 0)
  23.             {
  24.                 Console.WriteLine("Ваше ХП:" + healthUser + "\nХП орка:" + healthOrc + "\nВыбирите заклянание:\n" +
  25.                     "1 - Крик души – обычный удар палкой\n" +
  26.                     "2 - Рашамон – призывает теневого духа для нанесения атаки (Отнимает 100 хп игроку)\n" +
  27.                     "3 - Хуганзакура (Может быть выполнен только после призыва теневого духа), наносит 100 ед. урона\n" +
  28.                     "4 - Межпространственный разлом – позволяет скрыться в разломе и восстановить 250 хп. Урон босса по вам не проходит");
  29.                 string userInpyt = Console.ReadLine();
  30.                 switch (userInpyt)
  31.                 {
  32.                     case "1":
  33.                         healthUser -= damageOrc;
  34.                         healthOrc -= damageUser;
  35.                         break;
  36.                     case "2":
  37.                         isRashamonCast = true;
  38.                         healthUser = healthUser - 100;
  39.                         healthUser = healthUser - damageOrc;
  40.                         break;
  41.                     case "3":
  42.                         if (isRashamonCast == true)
  43.                         {
  44.                             healthOrc = healthOrc - 100;
  45.                             healthUser = healthUser - damageOrc;
  46.                             isRashamonCast = false;
  47.                         }
  48.                         else if (isRashamonCast == false)
  49.                         {
  50.                             Console.WriteLine("Сначало озвучте заклинание <<Рашамон>>");
  51.                         }
  52.                         break;
  53.                     case "4":
  54.                         healthUser = healthUser + 250;
  55.                         healthOrc = healthOrc + 50;
  56.                         break;
  57.                 }
  58.                 if (healthUser <= 0 && healthOrc <= 0)
  59.                 {
  60.                     Console.WriteLine("Итог битвы: НИЧЬЯ");
  61.                 }
  62.                 else if (healthUser <= 0)
  63.                 {
  64.                     Console.WriteLine("Итог битвы: ОРК ПОБЕДИЛ");
  65.                 }
  66.                 else if (healthOrc <= 0)
  67.                 {
  68.                     Console.WriteLine("Итог битвы: МАГ ПОБЕДИЛ");
  69.                 }
  70.             }
  71.             Console.ReadKey();
  72.         }
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement