Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp
- {
- class Program
- {
- static void Main(string[] args)
- {
- const string CommandHitByKnife = "1";
- const string CommsndGustWind = "2";
- const string CommandStaticCharge = "3";
- const string CommandExecution = "4";
- const string CommandMagneticField = "5";
- const string CommandFlowersLife = "6";
- const string CommandFlowersForest = "7";
- const string CommandClaw = "0";
- const string CommandShearingThorn = "1";
- const string CommandParasitism = "2";
- const string CommandTotalHealing = "3";
- const string CommandMentalThirst = "4";
- Random random = new Random();
- string hitByKnife = "Удар ножом";
- string gustWind = "Порыв ветра";
- string staticCharge = "Статический заряд";
- string execution = "Казнь";
- string magneticField = "Магнитное поле";
- string flowersLife = "Цветы жизни";
- string flowersForest = "Лес цветов";
- string claw = "Когти";
- string shearingThorn = "Стригущий шип";
- string parasitism = "Паразитизм";
- string totalHealing = "Тотальное восстановление";
- string mentalThirst = "Ментальная жажда";
- string userName;
- string userInput;
- string numberSpellEnemy;
- int minNumberSpellEnemy = 0;
- int maxNumberSpellEnemy = 4;
- int userHealth = 200;
- int userMaxHealth = 200;
- int userDeath = 0;
- int userMana = 150;
- int userMaxMana = 150;
- int userManaEmpty = 0;
- int enemyHealth = 240;
- int enemyMaxHealth = 240;
- int enemyDeath = 0;
- int enemyMana = 120;
- int enemyMaxMana = 120;
- int hitByKnifeDamage = 5;
- int hitByKnifeManaRequirement = 0;
- int gustWindDamage = 12;
- int gustWindManaRequirement = 7;
- int staticChargeDamage = 30;
- int staticChargeManaRequiremet = 45;
- int numeratorForPercentageCalculation = 100;
- int mentalThirstManaRequirement = 15;
- int magneticDamageMultiplier = 5;
- int multiplierForCalculatingThePercentageEnemyHealth = 50;
- int multiplierForCalculatingThePercentageUserHealth = 70;
- int amountUserHealthTrigger = userHealth / numeratorForPercentageCalculation * multiplierForCalculatingThePercentageUserHealth;
- int magneticFieldDamage = enemyHealth / numeratorForPercentageCalculation * magneticDamageMultiplier;
- int amountEnemyHealthTrigger = enemyHealth / numeratorForPercentageCalculation * multiplierForCalculatingThePercentageEnemyHealth;
- int magneticFieldManaRequirement = 4;
- int numbersTriggersMagneticField = 10;
- int magneticFieldCounter = 0;
- int flowersLifeHealing = 11;
- int flowersLifeManaRequirement = 6;
- int flowersForestHealing = 20;
- int flowersForestManaRequirement = 15;
- int healthRegen = 1;
- int manaRegen = 3;
- int enemyManaRegen = 10;
- int clawDamage = 5;
- int shearingThornDamage = 5;
- int shearingThornManaRequirement = 3;
- int parasitismDamage = 10;
- int parasitismHealthRegen = 7;
- int parasitismManaRequirement = 16;
- int mentalThirstDamage = 40;
- Console.WriteLine("Здравствуй путник. Ты попал в пещеру полную сокровищ.\nИз нее есть только один выход - тебе нужно одолеть Того,чье имя забыто." +
- "\nПобеди его, забери сокровища и скорее беги, " +
- "пока весть о его гибели не привлекла кого-то более страшного...\n" +
- "\nПобедить может только один!" +
- "\n\nДля начала скажи свое имя, дабы мы знали имя героя победившего древнего врага и могли увековечить его в сказаниях.");
- userName = Console.ReadLine();
- Console.WriteLine($"\nФортуна любит подготовленных. И так, чтобы победить врага ты можешь: \n" +
- $"\n1 - {hitByKnife} - урон {hitByKnifeDamage} единиц, мана {hitByKnifeManaRequirement} единиц.\n" +
- $"2 - {gustWind} - урон {gustWindDamage} единиц, мана {gustWindManaRequirement} единиц.\n" +
- $"3 - {staticCharge} - урон {staticChargeDamage} единиц, мана {staticChargeManaRequiremet} единиц.\n" +
- $"4 - {execution} - урон {enemyHealth} единиц, мана {userMana} единиц, при условии, что у врага останется меньше " +
- $"{amountEnemyHealthTrigger} единиц здоровья,\n \tа у тебя {amountUserHealthTrigger} единиц здоровья.\n" +
- $"5 - {magneticField} - урон {magneticFieldDamage} единиц, мана {magneticFieldManaRequirement} единиц, количество стаков заклинания - {numbersTriggersMagneticField}.\n" +
- $"6 - {flowersLife} - лечение на {flowersLifeHealing} единиц, мана {flowersLifeManaRequirement} единиц.\n" +
- $"7 - {flowersForest} - лечение на {flowersForestHealing} единиц, мана {flowersForestManaRequirement} единиц.\n" +
- $"На данный момент это все твои возможности. Пусть тебе улыбнется удача.");
- Console.WriteLine($"Позволь еще раз поприветствовать тебя {userName} и да начнется сражение! (Нажмите любую кнопку)");
- Console.ReadKey();
- while (userHealth >= userDeath || enemyHealth >= enemyDeath)
- {
- numberSpellEnemy = Convert.ToString(random.Next(minNumberSpellEnemy, maxNumberSpellEnemy));
- Console.Write("\nВыберите номер заклинания:");
- userInput = Console.ReadLine();
- Console.WriteLine($"Твое здоровье {userHealth}, мана {userMana}");
- Console.WriteLine($"Здоровье врага {enemyHealth}, мана врага {enemyMana}");
- Console.WriteLine($"Накоплено стаков {magneticField} - {magneticFieldCounter} единиц.");
- Console.WriteLine($"Введи номер заклинания:\n\n" +
- $" {hitByKnife} - {CommandHitByKnife}.\n" +
- $" {gustWind} - {CommsndGustWind}.\n" +
- $" {staticCharge} - {CommandStaticCharge}.\n" +
- $" {execution} - {CommandExecution}.\n" +
- $" {magneticField} - {CommandMagneticField}.\n" +
- $" {flowersLife} - {CommandFlowersLife}.\n" +
- $" {flowersForest} - {CommandFlowersForest}.\n");
- magneticFieldCounter++;
- switch (userInput)
- {
- case CommandHitByKnife:
- Console.ForegroundColor = ConsoleColor.DarkRed;
- Console.WriteLine($"Урон от {hitByKnife} - {hitByKnifeDamage} единиц.");
- enemyHealth -= hitByKnifeDamage;
- Console.ResetColor();
- break;
- case CommsndGustWind:
- Console.ForegroundColor = ConsoleColor.DarkBlue;
- if (userMana >= gustWindManaRequirement)
- {
- enemyHealth -= gustWindDamage;
- userMana -= gustWindManaRequirement;
- Console.WriteLine($"Урон от {gustWind} - {gustWindDamage} единиц.");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine($"Для {gustWind} недостаточно маны.");
- Console.ResetColor();
- }
- break;
- case CommandStaticCharge:
- Console.ForegroundColor = ConsoleColor.Blue;
- if (userMana >= staticChargeManaRequiremet)
- {
- enemyHealth -= staticChargeDamage * magneticFieldCounter;
- userMana -= staticChargeManaRequiremet;
- Console.WriteLine($"Урон от {staticCharge} - {staticChargeDamage} единиц.");
- Console.ResetColor();
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine($"Для {staticCharge} недостаточно маны");
- Console.ResetColor();
- }
- break;
- case CommandExecution:
- if (enemyHealth <= amountEnemyHealthTrigger && userHealth >= amountUserHealthTrigger)
- {
- enemyHealth -= enemyDeath;
- userMana -= userMana;
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Условия не соотвевтствуют");
- Console.ResetColor();
- }
- break;
- case CommandMagneticField:
- Console.ForegroundColor = ConsoleColor.DarkCyan;
- if (magneticFieldCounter <= numbersTriggersMagneticField)
- {
- enemyHealth -= magneticFieldDamage;
- userMana -= magneticFieldManaRequirement;
- Console.WriteLine($"Урон от {magneticField} - {magneticFieldDamage} единиц.");
- Console.ResetColor();
- }
- Console.WriteLine($"{magneticField} наносит урон. {magneticFieldDamage} урона за {numbersTriggersMagneticField} ходов");
- break;
- case CommandFlowersLife:
- Console.ForegroundColor = ConsoleColor.Green;
- if (userHealth < userMaxHealth && userMana >= userManaEmpty)
- {
- userHealth += flowersLifeHealing;
- userMana -= flowersLifeManaRequirement;
- Console.WriteLine($"Лечение от {flowersLife} - {flowersLifeHealing} единиц.");
- Console.ResetColor();
- }
- break;
- case CommandFlowersForest:
- Console.ForegroundColor = ConsoleColor.Green;
- if (userHealth < userMaxHealth && userMana >= userManaEmpty)
- {
- userHealth += flowersForestHealing;
- userMana -= flowersForestManaRequirement;
- Console.WriteLine($"Лечение от {flowersForest} - {flowersForestHealing} единиц.");
- Console.ResetColor();
- }
- break;
- }
- switch (numberSpellEnemy)
- {
- case CommandClaw:
- {
- Console.WriteLine($"Враг ударил {claw}. Получено {clawDamage} урона.");
- userHealth -= clawDamage;
- }
- break;
- case CommandShearingThorn:
- if (enemyMana > shearingThornManaRequirement)
- {
- Console.WriteLine($"{shearingThorn} попал в тебя. Получено {shearingThornDamage} урона.");
- userHealth -= shearingThornDamage;
- enemyMana -= shearingThornManaRequirement;
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine($"Для использования {shearingThorn} у врага не достаточно маны.");
- Console.ResetColor();
- }
- break;
- case CommandParasitism:
- if (enemyMana > parasitismManaRequirement)
- {
- Console.WriteLine($"К тебе прилип {parasitism}. Он востанавливает {parasitismHealthRegen} здоровья врагу и наносит тебе {parasitismDamage} урона.");
- userHealth -= parasitismDamage;
- enemyHealth += parasitismHealthRegen;
- enemyMana -= parasitismManaRequirement;
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine($"Для использования {parasitism} у врага не достаточно маны.");
- Console.ResetColor();
- }
- break;
- case CommandTotalHealing:
- if (enemyMana >= enemyMaxMana)
- {
- Console.WriteLine($"Враг использовал {totalHealing}, его здоровье полностью восстановлено.");
- enemyHealth = enemyMaxHealth;
- enemyMana -= enemyMaxMana;
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine($"Для {totalHealing} недостаточно маны.");
- Console.ResetColor();
- }
- break;
- case CommandMentalThirst:
- if (enemyMana >= mentalThirstManaRequirement)
- {
- Console.WriteLine($"Враг использовал {mentalThirst}, нанесено {mentalThirstDamage} урона.");
- userHealth -= mentalThirstDamage;
- enemyMana -= mentalThirstManaRequirement;
- }
- else
- {
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine($"Для использования {mentalThirst} у врага не достаточно маны.");
- Console.ResetColor();
- }
- break;
- }
- if (userHealth >= userMaxHealth || userMana >= userMaxMana)
- {
- userDeath = userMaxHealth;
- Console.WriteLine("Вы здоровы");
- }
- else
- {
- Console.ResetColor();
- userHealth += healthRegen;
- userMana += manaRegen;
- Console.WriteLine($"\nТебе восстановлено {healthRegen} здоровья и {manaRegen} маны.");
- }
- if (enemyHealth >= enemyMaxHealth || enemyMana >= enemyMaxMana)
- {
- enemyHealth = enemyMaxHealth;
- Console.WriteLine("Враг здоров");
- }
- else
- {
- Console.ResetColor();
- enemyHealth += healthRegen;
- enemyMana += enemyManaRegen;
- Console.WriteLine($"\nВрагу восстановлено {healthRegen} здоровья и {enemyManaRegen} маны.");
- }
- }
- if (userHealth <= userDeath)
- Console.WriteLine("Вы проиграли. Враг победил.");
- else
- Console.WriteLine("Враг пал. Поздравляю!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement