kwest87

Untitled

Nov 14th, 2023
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.02 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp31
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             const string MenuHit = "1";
  10.             const string MenuRage = "2";
  11.             const string MenuMadness = "3";
  12.             const string MenuSpray = "4";
  13.  
  14.             int trollRage = 100;
  15.             int trollMadness = 200;
  16.             int trollSpray = 100;
  17.             int trollHealth = 1500;
  18.             int trollDamage = 100;
  19.             int bossHealth = 2000;
  20.             int bossDamage = 100;
  21.  
  22.             int durationSpray = 3;
  23.             int durationRage = 3;
  24.             int durationMadness = 1;
  25.             int durationDamage = 1;
  26.  
  27.             int countdounDamage = 0;
  28.             int countdounSpray = 0;
  29.             int countdounRage = 0;
  30.             int countdounMadness = 0;
  31.             int doubleDamage = 2;
  32.  
  33.             string menuInput;
  34.  
  35.             while (bossHealth > 0 && trollHealth > 0)
  36.             {
  37.                 Console.WriteLine();
  38.                 Console.WriteLine($"Вы троль рукопашник и в вашем арсенали 4 приема :" +
  39.                     $"\n {MenuHit}) Удар по роже - наносит {trollDamage} урона." +
  40.                     $"\n {MenuRage}) Ярость берсерка - отнимет {trollRage} хп владельца , но следующие {durationRage} атаки двойной урон." +
  41.                     $"\n {MenuMadness}) Безумие берсерка (только при ярости берсерка) - отнимает {trollMadness} хп владельца а весь урон удваивается ." +
  42.                     $"\n {MenuSpray}) Распылить споры - восстанавливает {trollSpray} хп и отравляет врага на {durationSpray} хода.");
  43.                 Console.WriteLine($"Ваше здоровье - {trollHealth}\nЗдоровье босса - {bossHealth}");
  44.                 Console.WriteLine("Ваши действия:");
  45.                 menuInput = Console.ReadLine();
  46.  
  47.                 if (countdounSpray > 0)
  48.                 {
  49.                     bossHealth -= trollSpray;
  50.                     countdounSpray--;
  51.                     Console.WriteLine($"Споры отняли у босса {trollSpray} жизней , действует еще {countdounSpray} ходов.");
  52.                 }
  53.  
  54.                 switch (menuInput)
  55.                 {
  56.                     case MenuHit:
  57.                         Console.WriteLine("Вы выбрали удар по роже.");
  58.                         trollHealth -= bossDamage;
  59.                         countdounDamage = durationDamage;
  60.                         break;
  61.  
  62.                     case MenuRage:
  63.                         trollHealth -= bossDamage + trollRage;
  64.                         countdounRage = durationRage;
  65.                         countdounDamage = durationDamage;
  66.                         Console.WriteLine($"Вы впали в ярость берсерка на {durationRage} хода отняв себе {trollRage} здоровья.");
  67.                         break;
  68.  
  69.                     case MenuMadness:
  70.                         Console.WriteLine($"Вы впадаете в безумие отняв себе {trollMadness} здоровья.");
  71.                         trollHealth -= bossDamage + trollMadness;
  72.                         countdounMadness = durationMadness;
  73.                         break;
  74.  
  75.                     case MenuSpray:
  76.                         Console.WriteLine("Вы выбрали пустить споры.");
  77.                         trollHealth -= bossDamage - trollSpray;
  78.                         countdounSpray = durationSpray;
  79.                         Console.WriteLine($"Вы пустили споры восстановив себе {trollSpray} здоровья.");
  80.                         Console.WriteLine($"Вас ударили на {bossDamage} урона.");
  81.                         break;
  82.                 }
  83.  
  84.                 if (countdounDamage > 0)
  85.                 {
  86.                     if (countdounRage > 0)
  87.                     {
  88.                         bossHealth -= trollDamage * doubleDamage;
  89.                         countdounRage--;
  90.                         Console.WriteLine($"Вы ударили в состоянии ярости берсерка, действует {countdounRage} хода.");
  91.                         Console.WriteLine($"Вас ударили на {bossDamage} урона.");
  92.                     }
  93.                     else if (countdounRage <= 0)
  94.                     {
  95.                         bossHealth -= trollDamage;
  96.                         Console.WriteLine($"Вы ударили на {trollDamage} урона.");
  97.                         Console.WriteLine($"Вас ударили на {bossDamage} урона.");
  98.                     }
  99.                 }
  100.  
  101.                 if (countdounMadness > 0 && countdounRage > 0)
  102.                 {
  103.                     countdounRage--;
  104.                     countdounMadness = 0;
  105.                     bossHealth -= trollDamage * doubleDamage * doubleDamage;
  106.                 }
  107.                 else if (countdounMadness > 0 && countdounRage <= 0)
  108.                 {
  109.                     Console.WriteLine("Без ярости , безумие не наступает.");
  110.                     countdounMadness = 0;
  111.                     countdounRage = 0;
  112.                     Console.WriteLine($"Вас ударили на {bossDamage} урона.");
  113.                 }
  114.  
  115.                 Console.ReadKey();
  116.                 countdounDamage = 0;
  117.             }
  118.  
  119.             if (bossHealth<=0&&trollHealth<=0)
  120.             {
  121.                 Console.WriteLine("Произошла ничья!");
  122.             }
  123.             else if (trollHealth>0)
  124.             {
  125.                 Console.WriteLine("Победитель троль");
  126.             }
  127.             else
  128.             {
  129.                 Console.WriteLine("Победитель босс");
  130.             }
  131.         }
  132.     }
  133. }
Advertisement
Add Comment
Please, Sign In to add comment