Neon1x1st

boss

Feb 1st, 2022 (edited)
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.98 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace CSharpLight
  7. {
  8.  
  9.     public static class Program
  10.     {
  11.         public static void Main()
  12.         {
  13.  
  14.             int playerHealth = 100;
  15.             int bossHealth = 200;
  16.             int bossDamage = 10;
  17.             int spellKick = 20;
  18.             int spellHeal = 15;
  19.             int spellDoppelganger = 10;
  20.             int spellFireBall = 10;
  21.             int spellFireBallDamage = 30;
  22.             int playerDeath = 0;
  23.             int bossDeath = 0;
  24.             int spellHealLimit = 50;
  25.             string userInput;
  26.             string winMessage = "Босс повержен.Вы победили";
  27.             string loseMessage = "Вы погибли";
  28.             string doppelgangerCallMessage = "Вы призвали двойника";
  29.             string stopSpellHeal = "Условия исцеления не соблюденны";
  30.             string stopDoppelgangerCall = "Сначала необходимо призвать двойника - DPCall";
  31.             bool doppelgangerCall = false;
  32.  
  33.             Console.WriteLine("Используйте ваши способности для победы над боссом\n" +
  34.             "Kick(наносит " + spellKick + " урона)\n" +
  35.             "Heal(Пополняет ваше здоровье на " + spellHeal + " Можно использовать только когда здоровье игрока опускается ниже " + spellHealLimit + ")\n" +
  36.             "Doppelganger(Заменяет вас двойником который наносит " + spellDoppelganger + " урона,босс атакует двойника,вы не получаете урон.Невозможно использовать без предварительного призыва.)\n" +
  37.             "Fireball(Наносит " + spellFireBallDamage + " урона боссу.Будте аккуратны при прочтении этого заклинания вы наносите себе " + spellFireBall + " урона)\n" +
  38.             "DPCall(Призывает вашего двойника на поле боя)");
  39.             Console.WriteLine("Что используем?");
  40.            
  41.            
  42.          
  43.             while (playerHealth > playerDeath & bossHealth > bossDeath)
  44.             {
  45.                 userInput = Console.ReadLine();
  46.                 switch (userInput)
  47.                 {
  48.                     case "DPCall":
  49.                         doppelgangerCall = true;
  50.                         playerHealth -= bossDamage;
  51.                         Console.WriteLine(doppelgangerCallMessage);
  52.                         Console.WriteLine("Your HP:" + playerHealth);
  53.                         Console.WriteLine("Boss Hp:" + bossHealth);
  54.                         break;
  55.                     case "Kick":
  56.                         bossHealth -= spellKick;
  57.                         playerHealth -= bossDamage;
  58.                         Console.WriteLine("Your HP:" + playerHealth);
  59.                         Console.WriteLine("Boss Hp:" + bossHealth);
  60.                         break;
  61.                     case "Heal":
  62.                         if (playerHealth < spellHealLimit)
  63.                         {
  64.                             playerHealth += spellHeal;
  65.                             playerHealth -= bossDamage;
  66.                             Console.WriteLine("Your HP:" + playerHealth);
  67.                             Console.WriteLine("Boss Hp:" + bossHealth);
  68.                         }
  69.                         else
  70.                         {
  71.                             Console.WriteLine(stopSpellHeal);
  72.                         }
  73.                             break;
  74.                     case "Doppelganger":
  75.                         if (doppelgangerCall == true)
  76.                         {
  77.                             bossHealth -= spellDoppelganger;
  78.                             Console.WriteLine("Your HP:" + playerHealth);
  79.                             Console.WriteLine("Boss Hp:" + bossHealth);
  80.                         }
  81.                         else
  82.                         {
  83.                             Console.WriteLine(stopDoppelgangerCall);
  84.                         }
  85.                         break;
  86.                     case "Fireball":
  87.                         bossHealth -= spellFireBallDamage;
  88.                         playerHealth -= bossDamage + spellFireBall;
  89.                         Console.WriteLine("Your HP:" + playerHealth);
  90.                         Console.WriteLine("Boss Hp:" + bossHealth);
  91.                         break;
  92.                 }
  93.                 if(playerHealth <= playerDeath)
  94.                 {
  95.                     Console.WriteLine(loseMessage);
  96.                 }
  97.                 else if (bossHealth <= bossDeath)
  98.                 {
  99.                     Console.WriteLine(winMessage);
  100.                 }
  101.             }
  102.            
  103.            
  104.            
  105.         }
  106.     }
  107. }
Add Comment
Please, Sign In to add comment