Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Spells
- {
- class Program
- {
- static void Main(string[] args)
- {
- int playerHealth = 400;
- int playerDamage = 80;
- int bossHealth = 650;
- int bossDamage = 130;
- bool higanzakuraAbilty = false;
- string userInput;
- while(bossHealth > 0 && playerHealth > 0)
- {
- Console.WriteLine($"Здоровье игрока:{playerHealth}");
- Console.WriteLine($"Здоровье босса:{bossHealth}\n");
- Console.WriteLine($"Обычная атака({playerDamage} урона) - 1\n" +
- $"Рашамон(-{playerDamage} хп, {playerDamage * 2} урона) - 2\n"+
- $"Хуганзакура({playerDamage * 1.5f} урона, доступна после атаки \"Рашамон\") - 3\n" +
- $"Межпространственный разлом(+{bossDamage * 2} хп, следущая атака босса не наносит урон) - 4\n");
- userInput = Console.ReadLine();
- Console.Clear();
- switch (userInput)
- {
- case "Обычная атака":
- default:
- case "1":
- bossHealth -= playerDamage;
- higanzakuraAbilty = false;
- break;
- case "Рашамон":
- case "2":
- playerHealth -= playerDamage;
- bossHealth -= playerDamage;
- higanzakuraAbilty = true;
- break;
- case "Хуганзакура":
- case "3":
- if (higanzakuraAbilty == true)
- {
- bossHealth -= (int)(playerDamage * 1.5f);
- }
- else
- {
- bossHealth -= playerDamage;
- Console.WriteLine("Для начала используйте атаку \"Рашамон\"");
- }
- higanzakuraAbilty = false;
- break;
- case "":
- case "4":
- playerHealth += bossDamage * 2;
- playerHealth += bossDamage;
- break;
- }
- playerHealth -= bossDamage;
- Console.Clear();
- }
- if(playerHealth > bossHealth)
- Console.WriteLine("Игрок победил!");
- else if (playerHealth < bossHealth)
- Console.WriteLine("Босс победил!");
- else
- Console.WriteLine("Ничья!");
- Console.ReadKey();
- Console.Clear();
- }
- }
- }
Add Comment
Please, Sign In to add comment