12Vitaly

13

Aug 23rd, 2020 (edited)
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 7.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace egor
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string inputUser = "";
  14.             string password = "";
  15.             string name = "";
  16.             string secretMessang = "НАРУТОООО!!!!";
  17.  
  18.             while(inputUser != "выход")
  19.             {
  20.                 Console.WriteLine("1 - Задать имя.\n2 - Задать пароль.\n" +
  21.                     "3 - Вывести секретное сообщение (Что бы Получить секретное сообщение надо задать имя и пароль)" +
  22.                     "\n4 - Сыграть в игру \"Убей босса.\"\n5 - Поменять цвет шрифта.");
  23.                 Console.WriteLine("Что бы выйти из программы введите \"выход\"");
  24.                 Console.WriteLine("Ваше имя: " + name + "\nВаш пароль: ******");
  25.  
  26.                 inputUser = Console.ReadLine();
  27.                 if (inputUser == "1")
  28.                 {
  29.                     Console.Write("Введите имя: ");
  30.                     name = Console.ReadLine();
  31.                     Console.Clear();
  32.                 }
  33.                 else if (inputUser == "2")
  34.                 {
  35.                     Console.Write("Введите пароль: ");
  36.                     password = Console.ReadLine();
  37.                     Console.Clear();
  38.                 }
  39.                 else if (inputUser == "3")
  40.                 {
  41.                     Console.Write("Введите имя: ");
  42.                     inputUser = Console.ReadLine();
  43.                     if (inputUser == name)
  44.                     {
  45.                        Console.Write("Ведите пароль: ");
  46.                        inputUser = Console.ReadLine();
  47.                         if (inputUser == password)
  48.                         {
  49.                             Console.WriteLine(secretMessang);
  50.                             Console.WriteLine("Нажмите любую кнопку что бы продолжить");
  51.                             Console.ReadLine();
  52.                             Console.Clear();
  53.                         }
  54.                     }
  55.                    
  56.                 }
  57.                 else if (inputUser == "4")
  58.                 {
  59.                     int heroHealth = 500;
  60.                     int bossHealth = 1000;
  61.                     int heroDamage = 85;
  62.                     int bossDamage = 132;
  63.                     int shadowSpirit = 0;
  64.                     int heroSpell = 0;
  65.  
  66.                     Console.WriteLine("Легенда: Вы – теневой маг и у вас в арсенале есть несколько заклинаний," +
  67.                         " которые вы можете использовать против босса." +
  68.                         " Вы должны уничтожить босса и только после этого будет вам покой.");
  69.  
  70.                     while (heroHealth > 0 && bossHealth > 0)
  71.                     {
  72.                         Console.WriteLine("Ваше здоровье: " + heroHealth + ". Здоровье босса: " + bossHealth + " урон босса: " + bossDamage);
  73.                         Console.WriteLine("Что - бы использовать заклятие введите номер закленнания");
  74.                         Console.WriteLine("№1. Обычная Атака (наносит " + heroDamage + " урона).\n" +
  75.                             "№2. Рашамон – призывает теневого духа для нанесения атаки (Отнимает 100 хп игроку, дух призывается на 3 раза использование закленания)\n" +
  76.                             "№3. Хуганзакура (Может быть выполнен только после призыва теневого духа), наносит 100 ед. урона\n" +
  77.                             "№4. Межпространственный разлом – позволяет скрыться в разломе и восстановить 250 хп. Урон босса по вам не проходит");
  78.  
  79.                         inputUser = Console.ReadLine();
  80.                         if (inputUser == "1")
  81.                         {
  82.                             bossHealth -= heroDamage;
  83.                             heroSpell = 1;
  84.                         }
  85.                         else if (inputUser == "2")
  86.                         {
  87.                             heroHealth -= 100;
  88.                             shadowSpirit = 3;
  89.                             heroSpell = 2;
  90.                         }
  91.                         else if (inputUser == "3" && shadowSpirit > 0)
  92.                         {
  93.                             bossHealth -= 170;
  94.                             heroSpell = 3;
  95.                             shadowSpirit -= 1;
  96.                         }
  97.                         else if (inputUser == "3" && shadowSpirit == 0)
  98.                         {
  99.                             Console.WriteLine("вы не можете использовать это заклятие");
  100.                             heroSpell = 0;
  101.                         }
  102.                         else if (inputUser == "4")
  103.                         {
  104.                             heroHealth += 200;
  105.                             heroSpell = 4;
  106.                         }
  107.                         else
  108.                         {
  109.                             heroSpell = 0;
  110.                             Console.WriteLine("выбирети атаку");
  111.  
  112.                         }
  113.  
  114.        
  115.                         if (heroSpell != 0 && heroSpell != 4)
  116.                         {
  117.                             heroHealth -= bossDamage;
  118.                         }
  119.  
  120.                         if (heroHealth < 0)
  121.                         {
  122.                             Console.WriteLine("Вы погибли");
  123.                         }
  124.                         else if (bossHealth < 0)
  125.                         {
  126.                             Console.WriteLine("Вы победили");
  127.                         }  
  128.                     }
  129.                     Console.WriteLine("Нажмите любую кнопку что бы продолжить");
  130.                     Console.ReadLine();
  131.                     Console.Clear();
  132.                 }
  133.                 else if (inputUser == "5")
  134.                 {
  135.                     Console.WriteLine("1 - Красный\n2 - Зеленый\n3 - Голубой");
  136.                     inputUser = Console.ReadLine();
  137.                     switch (inputUser)
  138.                     {
  139.                         case "1":
  140.                             Console.ForegroundColor = ConsoleColor.Red;
  141.                             break;
  142.                         case "2":
  143.                             Console.ForegroundColor = ConsoleColor.Green;
  144.                             break;
  145.                         case "3":
  146.                             Console.ForegroundColor = ConsoleColor.Blue;
  147.                             break;
  148.                     }
  149.                     Console.Clear();
  150.                 }
  151.             }
  152.         }
  153.     }
  154. }
Advertisement
Add Comment
Please, Sign In to add comment