Advertisement
LeRoY_Go

Untitled

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