12Vitaly

9

Aug 21st, 2020 (edited)
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.69 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.             int heroHealth = 500;
  14.             int bossHealth = 1000;
  15.             int heroDamage = 85;
  16.             int bossDamage = 132;
  17.             int shadowSpirit = 0;
  18.             int heroSpell = 0;
  19.  
  20.             Console.WriteLine("Легенда: Вы – теневой маг и у вас в арсенале есть несколько заклинаний," +
  21.                 " которые вы можете использовать против босса." +
  22.                 " Вы должны уничтожить босса и только после этого будет вам покой.");
  23.  
  24.             while (heroHealth > 0 && bossHealth > 0)
  25.             {
  26.                 Console.WriteLine("Ваше здоровье: " + heroHealth + ". Здоровье босса: " + bossHealth + " урон босса: " + bossDamage );
  27.                 Console.WriteLine("Что - бы использовать заклятие введите номер закленнания");
  28.                 Console.WriteLine("№1. Обычная Атака (наносит " + heroDamage + " урона).\n" +
  29.                     "№2. Рашамон – призывает теневого духа для нанесения атаки (Отнимает 100 хп игроку, дух призывается на 3 раза использование закленания)\n" +
  30.                     "№3. Хуганзакура (Может быть выполнен только после призыва теневого духа), наносит 100 ед. урона\n" +
  31.                     "№4. Межпространственный разлом – позволяет скрыться в разломе и восстановить 250 хп. Урон босса по вам не проходит");
  32.  
  33.                 int inputUser = Convert.ToInt32(Console.ReadLine());
  34.                 if (inputUser == 1)
  35.                 {
  36.                     bossHealth -= heroDamage;
  37.                     heroSpell = 1;
  38.                 }
  39.                 else if (inputUser == 2)
  40.                 {
  41.                     heroHealth -= 100;
  42.                     shadowSpirit = 3;
  43.                     heroSpell = 2;
  44.                 }
  45.                 else if (inputUser == 3 && shadowSpirit > 0)
  46.                 {
  47.                     bossHealth -= 170;
  48.                     heroSpell = 3;
  49.                     shadowSpirit -= 1;
  50.                 }
  51.                 else if (inputUser == 3 && shadowSpirit == 0)
  52.                 {
  53.                     Console.WriteLine("вы не можете использовать это заклятие");
  54.                     heroSpell = 0;
  55.                 }
  56.                 else if (inputUser == 4)
  57.                 {
  58.                     heroHealth += 200;
  59.                     heroSpell = 4;
  60.                 }
  61.                 else
  62.                 {
  63.                     heroSpell = 0;
  64.                     Console.WriteLine("выберети атаку");
  65.                    
  66.                 }
  67.                
  68.                
  69.                 if (heroSpell != 0 && heroSpell != 4)
  70.                 {
  71.                     heroHealth -= bossDamage;
  72.                 }
  73.             }
  74.  
  75.             if (heroHealth < 0)
  76.             {
  77.                 Console.WriteLine("Вы погибли");
  78.             }
  79.             else if(bossHealth < 0)
  80.             {
  81.                 Console.WriteLine("Вы победили");
  82.             }
  83.  
  84.             Console.ReadKey();
  85.         }    
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment