kwest87

Untitled

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