Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- public class Program
- {
- public static void Main()
- {
- int percent = 100;
- int heroHealth = 400;
- int heroDamage = 150;
- int heroDamagePercent = 70;
- int heroChargeDamage = 225;
- int heroChargeDamagePercent = 57;
- int heroHealthHeal = 100;
- int heroDamageSetup;
- int heroDamagePercentSetup;
- bool isHeroRun = false;
- bool isHeroErrorType = false;
- bool isHeroCharge = false;
- int bossHealth = 435;
- int bossDamage = 125;
- int bossDamagePercent = 90;
- int bossDamagePercentError = 100;
- int bossDecreaseDamagePercent = 60;
- int bossDamagePercentSetup;
- bool isBossDecreaseDamage = false;
- bool isRun = true;
- ConsoleColor winColor = ConsoleColor.DarkYellow;
- ConsoleColor defeatColor = ConsoleColor.DarkRed;
- StringBuilder turnsLog = new StringBuilder();
- Random randomDamage = new Random();
- int randomNumber;
- int damage;
- int turn = 1;
- int bossDamagePrevious = 0;
- int heroDamagePrevious = 0;
- uint chooseInput;
- while (isRun)
- {
- Console.Clear();
- Console.SetCursorPosition(0, 0);
- Console.WriteLine("Turn : " + turn);
- Console.Write(" " + String.Format("{0,19}", " ").Replace(" ", "_") + " \n");
- Console.Write("| Boss Health : " + String.Format("{0,3}", bossHealth) + " |\n");
- Console.Write("| Hero Health : " + String.Format("{0,3}", heroHealth) + " |\n");
- Console.Write("|" + String.Format("{0,19}", " ").Replace(" ", "_") + "|\n");
- Console.WriteLine(turnsLog);
- turnsLog.Clear();
- Console.WriteLine("\nWhat spell you want to use : ");
- Console.WriteLine("1. ABOBA\n" +
- "2. ZA WARDO\n" +
- "3. EPITAPHIA\n" +
- "4. OVERDRIVE");
- chooseInput = Convert.ToUInt32(Console.ReadLine());
- if (isHeroCharge)
- {
- heroDamageSetup = heroChargeDamage;
- heroDamagePercentSetup = heroChargeDamagePercent;
- isBossDecreaseDamage = true;
- isHeroCharge = false;
- }
- else
- {
- heroDamageSetup = heroDamage;
- heroDamagePercentSetup = heroDamagePercent;
- }
- if (isHeroRun)
- {
- isHeroRun = false;
- }
- switch (chooseInput)
- {
- case 1:
- turnsLog.Append("You used spell ABOBA .\n");
- isHeroCharge = true;
- heroDamagePrevious = 0;
- turnsLog.Append("You charge attack and skip turn.\n");
- break;
- case 2:
- turnsLog.Append("You used spell ZA WARDO .\n");
- isHeroRun = true;
- heroHealth += heroHealthHeal;
- heroDamagePrevious = 0;
- bossDamagePrevious = -heroHealthHeal;
- turnsLog.Append("You run away on one turn and heal " + heroHealthHeal + "HP.\n");
- break;
- case 3:
- turnsLog.Append("You used spell EPITATHIA .\n");
- if (turn == 1)
- turn = 0;
- else
- turn -= 2;
- bossHealth += heroDamagePrevious;
- heroHealth += bossDamagePrevious;
- heroDamagePrevious = 0;
- bossDamagePrevious = 0;
- isHeroRun = true;
- turnsLog.Append("You turned back a turn.\n");
- break;
- case 4:
- turnsLog.Append("You used spell OVERDRIVE .\n");
- randomNumber = randomDamage.Next(0, heroDamagePercentSetup);
- damage = heroDamageSetup * randomNumber / percent;
- bossHealth -= damage;
- heroDamagePrevious = damage;
- turnsLog.Append("You atack and decrease: " + damage + "HP.\n");
- break;
- default:
- isHeroErrorType = true;
- turnsLog.Append("You write wrong spell\n");
- break;
- }
- if (isHeroRun != true)
- {
- if (isHeroErrorType)
- {
- isHeroErrorType = false;
- bossDamagePercentSetup = bossDamagePercentError;
- randomNumber = bossDamagePercentSetup;
- }
- else if (isBossDecreaseDamage)
- {
- bossDamagePercentSetup = bossDecreaseDamagePercent;
- randomNumber = randomDamage.Next(0, bossDamagePercentSetup);
- isBossDecreaseDamage = false;
- }
- else
- {
- bossDamagePercentSetup = bossDamagePercent;
- randomNumber = randomDamage.Next(0, bossDamagePercentSetup);
- }
- damage = bossDamage * randomNumber / percent;
- heroHealth -= damage;
- bossDamagePrevious = damage;
- turnsLog.Append("Boss attack and decrease : " + damage + "HP.\n");
- }
- if (bossHealth <= 0)
- {
- isRun = false;
- Console.Clear();
- Console.SetCursorPosition(0, 0);
- Console.ForegroundColor = winColor;
- Console.WriteLine("!!!Congratulation you defeat boss!!!");
- }
- else if (heroHealth <= 0)
- {
- isRun = false;
- Console.Clear();
- Console.SetCursorPosition(0, 0);
- Console.ForegroundColor = defeatColor;
- Console.WriteLine(" YOU DEAD ");
- }
- ++turn;
- }
- }
- }
Add Comment
Please, Sign In to add comment