public static (int, int) UseMagicSmite(Priest player, Entity enemy) { if (player.Mana < 8) { ConsoleEffects.TypeLine("You do not have enough mana to do this.\r\n"); return(enemy.Health, player.Mana); } int playerAttack = player.CastSmite(); ConsoleEffects.TypeLine(player.Name + " cast smite. " + enemy.Name + " has been hit for " + playerAttack + "\r\n"); enemy.Health -= playerAttack; player.Mana -= 8; CheckHealth(enemy); ConsoleEffects.TypeLine(player.Name + " has " + player.Mana + " left.\r\n"); ConsoleEffects.TypeLine(enemy.Name + " has " + enemy.Health + " health.\r\n\r\n"); return(enemy.Health, player.Mana); }
public static Entity CheckGoldToBuy(Entity player, Item item) { if (player.Gold >= item.Cost) { ConsoleEffects.TypeLine("Here you are!\r\n"); player.Gold -= item.Cost; player.Inventory.Add(item); Console.WriteLine("You received 1 " + item.Name + ". You now have " + player.Gold + " gold and " + Entity.CountInventory(player, item) + " " + item.Name); //CheckItemSelected(); } else { ConsoleEffects.TypeLine("You do not have enough gold."); //CheckItemSelected(); } CreateItemSelected(player); return(player); }
public static (int, int) UseMagicFire(Mage player, Entity enemy) { if (player.Mana < 8) { ConsoleEffects.TypeLine("You do not have enough mana to do this.\r\n"); return(enemy.Health, player.Mana); } int playerAttack = player.CastFire(); ConsoleEffects.TypeLine("\r\n" + player.Name + " casts fire. " + enemy.Name + " has been hit for " + playerAttack + "\r\n"); enemy.Health -= playerAttack; int playerMana = player.UseMana(8); CheckHealth(enemy); ConsoleEffects.TypeLine(player.Name + " has " + playerMana + " mana left.\r\n"); ConsoleEffects.TypeLine(enemy.Name + " has " + enemy.Health + " health.\r\n\r\n"); return(enemy.Health, playerMana); }
//this should check for any item //why not have one shop? public static Item CreateItemSelected(Entity player) { string itemType = BuyWeapons(); Item item; if (itemType.Contains("nevermind")) { VisitWeaponShop(player); } //if (itemType.Contains("axe")) //{ // item = new Axe(); // return item; //} if (itemType.Contains("sword")) { item = new Sword(); return(item); } ConsoleEffects.TypeLine("I am sorry. I do not understand what you want."); return(CreateItemSelected(player)); }
public static Entity UsePotion(Entity entity, Item potion) { int entityHealth = entity.Health += potion.Heal; entity.Inventory.Remove(potion); int overHeal; int potionHeal; if (entityHealth > entity.MaxHealth) { overHeal = entity.Health - entity.MaxHealth; potionHeal = potion.Heal - overHeal; entity.Health = entity.MaxHealth; } else { potionHeal = potion.Heal; } ConsoleEffects.TypeLine("\r\n" + entity.Name + " used " + potion.Name + " and gained " + potionHeal + " health.\r\n"); ConsoleEffects.TypeLine(entity.Name + " now has " + entity.Health + " health.\r\n\r\n"); return(entity); }
public static void VisitInn(Entity player) { string sleepTalk = Actions.SelectSleep(); if (sleepTalk.Contains("rent")) { Sleep(player); } else if (sleepTalk.Contains("talk")) { //provide additional information based on story. } else if (sleepTalk.Contains("leave")) { Actions.SelectShop(player); } else { ConsoleEffects.TypeLine("I am sorry. I do not understand you."); Console.Clear(); VisitInn(player); } return; }
//input on what to do at the potion shop public static void VisitPotionShop(Entity player) { //ConsoleEffects.TypeLine("Welcome to the Potion Shop!\r\n"); string buySell = Actions.SelectBuySell(); if (buySell.Contains("buy")) { CheckGoldForPotion(player); } else if (buySell.Contains("sell")) { CheckPotionQuantity(player); } else if (buySell.Contains("leave")) { Actions.SelectShop(player); } else { ConsoleEffects.TypeLine("I am sorry. I do not understand you."); Console.Clear(); Actions.SelectBuySell(); } }
static void Main(string[] args) { Entity player = null; int health; int dodge; int mana; int gold; int level = 1; string redo; string name; List <Item> inventory = new List <Item>(); string chosenClass; //string shop = ""; //ConsoleEffects.makeVoice(); ConsoleEffects.TypeLine("Greeting, traveller\r\n"); ConsoleEffects.TypeLine("I see you are looking for adventure."); do { health = 0; dodge = 0; mana = 0; gold = 0; chosenClass = ""; bool stop = false; bool providedName; ConsoleEffects.TypeLine(" What should I call you?\r\n"); do { providedName = true; name = Console.ReadLine(); if (string.IsNullOrEmpty(name)) { Console.WriteLine("Everyone has a name! What is yours?"); providedName = false; } } while (providedName == false); name = ConsoleEffects.FirstCharToUpper(name); do { ConsoleEffects.TypeLine("\r\nWhat class are you interested in?\r\n"); Console.WriteLine("Warrior"); Console.WriteLine("Mage"); Console.WriteLine("Rogue"); string study = Console.ReadLine(); switch (study.ToLower()) { case "warrior": player = new Warrior(); player.Name = name; player.MaxHealth = player.RollHealth(); player.Health = player.MaxHealth; health = player.Health; dodge = player.Dodge; level = player.Level; gold = player.Gold; chosenClass = "Warrior"; inventory = player.Inventory; stop = true; break; case "mage": player = new Mage(); player.Name = name; player.MaxMana = player.RollMana(); mana = player.MaxMana; player.Mana = mana; health = player.Health; dodge = player.Dodge; level = player.Level; gold = player.Gold; chosenClass = "Mage"; inventory = player.Inventory; stop = true; break; case "rogue": player = new Rogue(); player.Name = name; player.Dodge = player.RollDodge(); dodge = player.Dodge; health = player.Health; level = player.Level; gold = player.Gold; chosenClass = "Rogue"; inventory = player.Inventory; stop = true; break; default: ConsoleEffects.TypeLine("I am afraid I am not familiar with that line of study. Please select again\r\n"); break; } } while (stop == false); Actions.CheckCharacter(name, chosenClass, level, health, dodge, mana, gold); ConsoleEffects.TypeLine("\r\nIs this okay?\r\n"); Console.WriteLine("-No, start over"); Console.WriteLine("-Yes, that is correct"); redo = Console.ReadLine(); Console.Clear(); } while (redo.ToLower().Contains("no")); Actions.SelectShop(player); Entity enemy = new Mage(); enemy.Name = "Bad Guy"; enemy.Health = health; StoryOne.FirstChapter(enemy, player); }
public override int UseAttack() { int attack = ConsoleEffects.RandomNumber(3, 5); return(Attack = attack); }
public int CastFire() { int attack = ConsoleEffects.RandomNumber(10, 15); return(MagicAttack = attack); }
public override int RollMana() { int maxMana = ConsoleEffects.RandomNumber(25, 33); return(MaxMana = maxMana); }
public int CastSmite() { int attack = ConsoleEffects.RandomNumber(5, 8); return(MagicAttack = attack); }
public int CastHeal() { int heal = ConsoleEffects.RandomNumber(5, 8); return(Health += heal); }
public static void FirstChapter(Entity enemy, Entity player) { ConsoleEffects.TypeLine("FIGHT!!!\r\n"); Battles.Fight(enemy, player); }
public override int RollHealth() { int maxHealth = ConsoleEffects.RandomNumber(125, 150); return(MaxHealth = maxHealth); }