public static void DisplayWeapons() { if (Weapons.Count == 0) { Console.WriteLine("You have no weapons."); return; } for (int i = 0; i < Weapons.Count; i++) { Console.WriteLine((i + 1).ToString() + "- " + Weapons[i].Display()); if (Weapons[i] == equippedWeapon) { Console.Write(" (Equipped) "); } } int input = EntryManager.Entry(upperLimit: Weapons.Count); if (input == 0) { return; } else { equippedWeapon = Weapons[input - 1]; Console.WriteLine("You equipped " + equippedWeapon.name); return; } }
public static void BrowseInventory() { while (true) { Console.WriteLine("1- My Weapons"); Console.WriteLine("2-My Armors"); Console.WriteLine("3- My Misc Items"); Console.WriteLine("0- Return"); int input = EntryManager.Entry(upperLimit: 3); if (input == 0) { return; } if (input == 1) { DisplayWeapons(); } if (input == 2) { DisplayArmors(); } if (input == 3) { DisplayMisc(); } } }
public void TownLoop() { while (true) { if (exitGame) { return; } Console.WriteLine("You're in the Town, what do you want to do?"); foreach (string activity in activityList) { Console.WriteLine(activity); } Console.WriteLine("Enter 0 to open the menu."); int input = EntryManager.Entry(upperLimit: 3); if (input == 1) { blacksmith.Enter(); } if (input == 0) { DisplayMenu(); } if (input == 3) { DisplayBillboard(); } } }
public static void DisplayArmors() { if (Armors.Count == 0) { Console.WriteLine("You don't have any armor."); return; } for (int i = 0; i < Armors.Count; i++) { Console.WriteLine((i + 1).ToString() + "- " + Armors[i].Display()); if (Armors[i] == equippedArmor) { Console.Write(" (Equipped) "); } } Console.WriteLine("Enter the index of the Armor to equip it. Enter 0 to return."); int input = EntryManager.Entry(upperLimit: Armors.Count); if (input == 0) { return; } else { equippedArmor = Armors[input - 1]; Console.WriteLine("You equippped " + equippedArmor.name); return; } }
private void DisplayMenu() { while (true) { Console.WriteLine("1- Inventory"); Console.WriteLine("2- My Quests"); Console.WriteLine("0- Close Menu"); Console.WriteLine("3- Save and Quit"); int input = EntryManager.Entry(upperLimit: 3); if (input == 0) { return; } if (input == 1) { Player.BrowseInventory(); } if (input == 2) { Player.DisplayActiveQuests(); } if (input == 3) { exitGame = true; return; } } }
private void BrowseArmors() { if (armors.Count == 0) { Console.WriteLine("I don't have any armors for now, you have to wait for the next shipment."); return; } Console.WriteLine("Sure, lets see if we can find a fit for you."); while (true) { for (int i = 0; i < armors.Count; i++) { Console.WriteLine($" {i + 1}- {armors[i].Display()}"); } int input = EntryManager.Entry(upperLimit: armors.Count); if (input == 0) { return; } else { if (armors[input - 1].price > Player.MONEY) { Console.WriteLine("You need more gold for that."); continue; } Player.Armors.Add(armors[input - 1]); Player.MONEY -= armors[input - 1].price; Console.WriteLine($"You bought {armors[input - 1].name}, you now have {Player.MONEY} gold left."); armors.RemoveAt(input - 1); return; } } }
public static void LevelUp() { Console.WriteLine("Level Up!"); level++; Console.WriteLine("You are level " + level); Console.WriteLine("You have 1 stat point and 5 perk points."); Console.WriteLine("Choose a stat to spend your stat point on."); Console.WriteLine("1- Attack: " + BASE_ATTACK[0]); Console.WriteLine("2- Defence :" + BASE_DEFENCE); Console.WriteLine("3- HP x 5 : " + MAX_HP); int input = EntryManager.Entry(upperLimit: 3, LlowerLimit: 1); if (input == 1) { BASE_ATTACK[0]++; BASE_ATTACK[1]++; } else if (input == 2) { BASE_DEFENCE++; } else if (input == 3) { MAX_HP += 5; } Console.WriteLine("Choose a perk to put your perk points on."); Console.WriteLine("1- Speech: " + speech); Console.WriteLine("2- Barter: " + barter); Console.WriteLine("3- Perception: " + perception); input = EntryManager.Entry(upperLimit: 3, LlowerLimit: 1); if (input == 1) { speech += 5; } else if (input == 2) { barter += 5; } else if (input == 3) { perception += 5; } HP = MAX_HP; Console.WriteLine("Done"); }
private void DisplayBillboard() { Console.WriteLine("Lets see what the townfolk needs doing."); Console.WriteLine("check quests of level..."); Console.WriteLine($"Enter between 1 and {billboard.Count}"); int input1 = EntryManager.Entry(upperLimit: billboard.Count); if (input1 == 0) { return; } else { while (true) { for (int i = 0; i < billboard[input1 - 1].Count; i++) { Console.WriteLine((i + 1).ToString() + "- " + billboard[input1 - 1][i].Display()); } Console.WriteLine("Choose a quest to inspect."); int input2 = EntryManager.Entry(upperLimit: billboard[input1 - 1].Count); if (input2 == 0) { return; } else { billboard[input1 - 1][input2 - 1].Inspect(); Console.WriteLine("Do you want to take this quest? "); Console.WriteLine("1-yes, 2- no"); int choice = EntryManager.Entry(LlowerLimit: 1, upperLimit: 2); if (choice == 2) { return; } else { Player.activeQuests.Add(billboard[input1 - 1][input2 - 1]); billboard[input1 - 1].RemoveAt(input2 - 1); return; } } } } }
public static void UseMisc() { DisplayMisc(use: true); Console.WriteLine("Choose an item to use. 0 to return."); int input = EntryManager.Entry(upperLimit: miscItems.Count); if (input == 0) { return; } else { miscItems[input - 1].Use(); miscItems.RemoveAt(input - 1); } }
public void Enter() { Greetings(); while (true) { Console.WriteLine("1- Buy"); Console.WriteLine("2- Sell"); Console.WriteLine("0- Leave"); int input = EntryManager.Entry(upperLimit: 2); if (input == 0) { Console.WriteLine("Come back again later..."); return; } if (input == 1) { BuyScreen(); } } }
private void BuyScreen() { Console.WriteLine("Okay what do you need?"); while (true) { Console.WriteLine("1- Weapons 2- Armors 3- Misc 0-Nevermind..."); int input = EntryManager.Entry(upperLimit: 3); if (input == 0) { return; } if (input == 1) { BrowseWeapons(); } else if (input == 2) { BrowseArmors(); } } }
public static void DisplayActiveQuests() { if (activeQuests.Count == 0) { Console.WriteLine("You have no active quests available. Check the town billboard."); return; } while (true) { for (int i = 0; i < activeQuests.Count; i++) { Console.WriteLine((i + 1).ToString() + "- " + activeQuests[i].name + ". Level " + activeQuests[i].level.ToString()); } Console.WriteLine("Choose a quest to view details of."); int input = EntryManager.Entry(upperLimit: activeQuests.Count); if (input == 0) { return; } else { activeQuests[input - 1].Inspect(); Console.WriteLine("Embark?"); Console.WriteLine("1-Yes 2- No"); int choice = EntryManager.Entry(LlowerLimit: 1, upperLimit: 2); if (choice == 2) { return; } else { activeQuests[input - 1].Embark(); } } } }
private void BrowseWeapons() { if (weapons.Count == 0) { Console.WriteLine("I don't have any weapons for sale right now, you have to wait for the next shipment."); return; } Console.WriteLine("Take a look"); while (true) { for (int i = 0; i < weapons.Count; i++) { Console.WriteLine($"{i + 1}- {weapons[i].Display()}"); } Console.WriteLine("You have " + Player.MONEY.ToString() + " gold."); int input = EntryManager.Entry(upperLimit: weapons.Count); if (input == 0) { return; } if (weapons[input - 1].price > Player.MONEY) { Console.WriteLine("You don't have enough money for that."); } else { Player.Weapons.Add(weapons[input - 1]); Console.WriteLine("Thank you for your purchase!"); Console.WriteLine("Gold -" + weapons[input - 1].price.ToString()); Player.MONEY -= weapons[input - 1].price; weapons.RemoveAt(input - 1); return; } } }
private void PlayerTurn(bool enemyStunned = false) { UpdateCooldowns(); while (true) { if (enemyStunned) { Console.WriteLine("You can escape while the enemy is stunned"); } Console.WriteLine("1- attack, 2- use item, 3-try to escape (20%) 0-Display stats"); int input = EntryManager.Entry(3); if (input == 0) { Console.WriteLine($"Player | hp {Player.HP}/{Player.MAX_HP} | Attack {Player.ATTACK[0]}-{Player.ATTACK[1]} | Defence {Player.DEFENCE}"); Console.WriteLine($"Enemy | HP {enemy.HP}/{enemy.MAX_HP} | Attack {enemy.ATTACK[0]}-{enemy.ATTACK[1]} | Defence {enemy.DEFENCE}"); } else if (input == 3) { if (enemyStunned) { Console.WriteLine("You escape while you have the chance"); //end battle escape = true; return; } int r = Player.rng.Next(1, 6); if (r == 5) { Console.WriteLine("You managed to escape."); escape = true; } else { Console.WriteLine("You tried to escape but couldn't."); } return; } else if (input == 1) { while (true) { Player.DisplaySkills(inBattle: true); string strInput = Console.ReadLine(); while (!EntryManager.IsDigitsOnly(strInput)) { strInput = Console.ReadLine(); } int input2 = Int32.Parse(strInput); if (input2 < 0 || input2 > Player.skills.Count || Player.skills[input2 - 1].cooldown != 0) { Console.WriteLine($"you can't do that , enter 0-{Player.skills.Count}."); continue; } if (input2 == 0) { break; } else { //handle skills here if (Equals(Player.skills[input2 - 1].name, "Basic Attack")) { PlayerDealDamage(); return; } else if (Equals(Player.skills[input2 - 1].name, "Heavy Attack")) { PlayerDealDamage(multiplier: Player.skills[input2 - 1].dmgMultiplier, accuracyMultiplier: Player.skills[input2 - 1].accMultiplier); Player.skills[input2 - 1].cooldown = Player.skills[input2 - 1].defaultCooldown; return; } else if (Equals(Player.skills[input2 - 1].name, "Piercing Blow")) { Console.WriteLine($"you strike ignoring your enemy's armor."); Player.skills[input2 - 1].cooldown = Player.skills[input2 - 1].defaultCooldown; PlayerDealDamage(multiplier: Player.skills[input2 - 1].dmgMultiplier, accuracyMultiplier: Player.skills[input2 - 1].accMultiplier, pierce: true); return; } else if (Equals(Player.skills[input2 - 1].name, "Stunning Blow")) { Player.skills[input2 - 1].cooldown = Player.skills[input2 - 1].defaultCooldown; PlayerDealDamage(multiplier: Player.skills[input2 - 1].dmgMultiplier, accuracyMultiplier: Player.skills[input2 - 1].accMultiplier, stun: true); } } } } else if (input == 2) { while (true) { Player.DisplayMisc(); if (Player.miscItems.Count == 0) { break; } int input2 = Int32.Parse(Console.ReadLine()); while (input2 < 0 || input2 > Player.miscItems.Count) { Console.WriteLine($"Invalid entry, enter 0-{Player.miscItems.Count}."); input2 = Int32.Parse(Console.ReadLine()); } if (input2 == 0) { break; } else { Player.miscItems[input2 - 1].Use(); Player.miscItems.RemoveAt(input2 - 1); return; } } } } }