Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text;
- using System.Threading.Tasks;
- namespace CSharpLight
- {
- public static class Program
- {
- public static void Main()
- {
- int playerHealth = 100;
- int bossHealth = 200;
- int bossDamage = 10;
- int spellKick = 20;
- int spellHeal = 15;
- int spellDoppelganger = 10;
- int spellFireBall = 10;
- int spellFireBallDamage = 30;
- int playerDeath = 0;
- int bossDeath = 0;
- int spellHealLimit = 50;
- string userInput;
- string winMessage = "Босс повержен.Вы победили";
- string loseMessage = "Вы погибли";
- string doppelgangerCallMessage = "Вы призвали двойника";
- string stopSpellHeal = "Условия исцеления не соблюденны";
- string stopDoppelgangerCall = "Сначала необходимо призвать двойника - DPCall";
- bool doppelgangerCall = false;
- Console.WriteLine("Используйте ваши способности для победы над боссом\n" +
- "Kick(наносит " + spellKick + " урона)\n" +
- "Heal(Пополняет ваше здоровье на " + spellHeal + " Можно использовать только когда здоровье игрока опускается ниже " + spellHealLimit + ")\n" +
- "Doppelganger(Заменяет вас двойником который наносит " + spellDoppelganger + " урона,босс атакует двойника,вы не получаете урон.Невозможно использовать без предварительного призыва.)\n" +
- "Fireball(Наносит " + spellFireBallDamage + " урона боссу.Будте аккуратны при прочтении этого заклинания вы наносите себе " + spellFireBall + " урона)\n" +
- "DPCall(Призывает вашего двойника на поле боя)");
- Console.WriteLine("Что используем?");
- while (playerHealth > playerDeath & bossHealth > bossDeath)
- {
- userInput = Console.ReadLine();
- switch (userInput)
- {
- case "DPCall":
- doppelgangerCall = true;
- playerHealth -= bossDamage;
- Console.WriteLine(doppelgangerCallMessage);
- Console.WriteLine("Your HP:" + playerHealth);
- Console.WriteLine("Boss Hp:" + bossHealth);
- break;
- case "Kick":
- bossHealth -= spellKick;
- playerHealth -= bossDamage;
- Console.WriteLine("Your HP:" + playerHealth);
- Console.WriteLine("Boss Hp:" + bossHealth);
- break;
- case "Heal":
- if (playerHealth < spellHealLimit)
- {
- playerHealth += spellHeal;
- playerHealth -= bossDamage;
- Console.WriteLine("Your HP:" + playerHealth);
- Console.WriteLine("Boss Hp:" + bossHealth);
- }
- else
- {
- Console.WriteLine(stopSpellHeal);
- }
- break;
- case "Doppelganger":
- if (doppelgangerCall == true)
- {
- bossHealth -= spellDoppelganger;
- Console.WriteLine("Your HP:" + playerHealth);
- Console.WriteLine("Boss Hp:" + bossHealth);
- }
- else
- {
- Console.WriteLine(stopDoppelgangerCall);
- }
- break;
- case "Fireball":
- bossHealth -= spellFireBallDamage;
- playerHealth -= bossDamage + spellFireBall;
- Console.WriteLine("Your HP:" + playerHealth);
- Console.WriteLine("Boss Hp:" + bossHealth);
- break;
- }
- if(playerHealth <= playerDeath)
- {
- Console.WriteLine(loseMessage);
- }
- else if (bossHealth <= bossDeath)
- {
- Console.WriteLine(winMessage);
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment