public override void GetStats() { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("YOUR OPPONENT:"); base.GetStats(); Console.WriteLine($"Max Attack: {AttackMax} \n" + $"<H: {Health} | A: {Armor} | MA: {AttackMax}> \n\n"); Console.ResetColor(); SoundEffect.GetSound(Resource.orc); }
public static bool IsHeroAlive(Hero playerHero, Hero opponent) { if (Battle.StartFight(playerHero, opponent) == "Game Over!") { SoundEffect.GetSound(Resource.player_death); return(false); } else { return(true); } }
//METHODS public static string StartGame() { string userCharacterChoice; string userCharacterChoiceResult = ""; SoundEffect.GetSound(Resource.intro); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("### Fighting Heroes v.1.0 ###\n"); Console.ResetColor(); do { Console.WriteLine("Choose your character: \n" + "[W] WARRIOR\n" + "[D] WIZARD \n" + "[H] HUNTER"); userCharacterChoice = Console.ReadKey().Key.ToString(); Console.WriteLine(); switch (userCharacterChoice.ToUpper()) { case "D": userCharacterChoiceResult = "wizard"; SoundEffect.GetSound(Resource.wizard); break; case "W": userCharacterChoiceResult = "warrior"; SoundEffect.GetSound(Resource.warrior); break; case "H": userCharacterChoiceResult = "hunter"; SoundEffect.GetSound(Resource.hunter); break; default: userCharacterChoiceResult = "error"; Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\nWrong input. Please try again. \n"); Console.ResetColor(); break; } }while (userCharacterChoiceResult == "error"); return(userCharacterChoiceResult); }
public int SpecialAttack(int specialAttackNumber) { if (specialAttackNumber > 0) { SoundEffect.GetSound(Resource.wizard_special); return((FireballAttackMax + LightningAttackMax + WildFireAttackMax) - 10); } else { Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\nYou don't have enough power to use your special attack. Please select other attack."); Console.ResetColor(); return(0); } }
public int SpecialAttack(int specialAttackNumber) { if (specialAttackNumber > 0) { SoundEffect.GetSound(Resource.hunter_special); return((DaggerAttackMax + BowAttackMax + CrossbowAttackMax) - 10); } else { Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\nYou don't have enough power to use your special attack. Please select other attack."); Console.ResetColor(); return(0); } }
public static void GetVillageScenario(Hero playerHero) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("\nIn the haunted village you are attacked by the deamon from the ancient world! \n" + "You have to defend yourself!"); Console.ResetColor(); Console.WriteLine(); Hero deamon = new Deamon() { Name = "Gorlab", CharacterClass = "Deamon", Health = 55, Armor = 4, AttackMax = 15, }; if (IsHeroAlive(playerHero, deamon)) { SoundEffect.GetSound(Resource.deamon_death); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("In the haunted village you have defeated deamon from the ancient world.\n" + "Without their master, the rest of the monsters fled this area.\n" + "You were able to eradicate the evil from this place.\n"); Console.ResetColor(); Console.WriteLine(); Console.WriteLine("[Press any key to exit game]"); Console.ReadKey(); Environment.Exit(0); } else { GetDefeatedInfo(); } }
//METHODS public int SwordAttack() { SoundEffect.GetSound(Resource.sword); return(rnd.Next(5, SwordAttackMax)); }
public static string GetAction(Hero hero) { string actionType = ""; do { Console.WriteLine("Select your action: \n" + "[1] Attack \n" + $"[2] Defensive position (x{hero.DefenseAmount}) \n" + $"[3] Health Potion (x{hero.HealthPotionsAmount})"); ConsoleKeyInfo action = Console.ReadKey(); switch (action.KeyChar) { case '1': Console.WriteLine(); actionType = "attack"; break; case '2': if (hero.DefenseAmount > 0) { Console.WriteLine(); actionType = "defense"; break; } else { actionType = "error"; Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\nYou don't have any Defense Possibilities! Please select other action.\n"); Console.ResetColor(); break; } case '3': if (hero.HealthPotionsAmount > 0) { Console.WriteLine(); SoundEffect.GetSound(Resource.potion); actionType = "health"; break; } else { actionType = "error"; Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\nYou don't have any Health Potions! Please select other action.\n"); Console.ResetColor(); break; } default: actionType = "error"; Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine("\nWrong input. Please try again.\n"); Console.ResetColor(); break; } }while (actionType == "error"); return(actionType); }
public int BowAttack() { SoundEffect.GetSound(Resource.bow); return(rnd.Next(3, BowAttackMax)); }
public int CrossbowAttack() { SoundEffect.GetSound(Resource.crossbow); return(rnd.Next(2, CrossbowAttackMax)); }
public override int Defense() { SoundEffect.GetSound(Resource.hunter_defense); return(Armor); }
//METHODS public int DaggerAttack() { SoundEffect.GetSound(Resource.dagger); return(rnd.Next(5, DaggerAttackMax)); }
public int AxeAttack() { SoundEffect.GetSound(Resource.axe); return(rnd.Next(3, AxeAttackMax)); }
public int WildFireAttack() { SoundEffect.GetSound(Resource.wild_fire); return(rnd.Next(1, WildFireAttackMax)); }
public int LightningAttack() { SoundEffect.GetSound(Resource.lightning); return(rnd.Next(2, LightningAttackMax)); }
//METHODS public int FireballAttack() { SoundEffect.GetSound(Resource.fireball); return(rnd.Next(4, FireballAttackMax)); }
public int MaceAttack() { SoundEffect.GetSound(Resource.mace); return(rnd.Next(1, MaceAttackMax)); }