//Calls user options private bool Options() { string userInput; while (true) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("1. Fight"); Console.WriteLine("2. Inventory"); Console.WriteLine("3. Move"); Console.WriteLine("4. Inspect room"); Console.WriteLine("5. Suicide"); userInput = Console.ReadLine(); if (userInput == "") { return(false); } if (userInput == "1") { return(Fight()); } else if (userInput == "2") { return(Player_Inventory.Inventory_start()); } else if (userInput == "3") { return(dungeon.DrawMove()); } else if (userInput == "4") { return(dungeon.InspectRoom()); } else if (userInput == "5") { return(Suicide()); } else { Console.WriteLine("Unknown input"); return(false); } } }
public static bool Combat_start(string ID) { Console.ForegroundColor = ConsoleColor.Red; Currently_fighting_enemys = ID.Split(' '); int enemynb = 1; Console.WriteLine("Which enemy would you like to fight?"); foreach (var item in Currently_fighting_enemys) { Console.WriteLine(enemynb + ". " + Convertor.export_mon(Currently_fighting_enemys[enemynb - 1], "mob_Name")); enemynb++; } string userInput = ""; while (true) { userInput = Console.ReadLine(); if (int.Parse(userInput) > 0) { if (int.Parse(userInput) < Currently_fighting_enemys.Count() + 1) { break; } else { Console.WriteLine("Incorrect input"); } } } Currently_fighting_enemy_ID = Currently_fighting_enemys[int.Parse(userInput) - 1]; current_enemy_HP = int.Parse(Convertor.export_mon(Currently_fighting_enemy_ID, "mob_hp")); while (true) { if (!Turn_start()) { break; } Console.WriteLine(); Enemy_turn(); } if (Dropped_item != "") { Console.Write("The enemy dropped a "); if (shield_or_nah == false) { Player_Inventory.Add_to_inventory("weapon", Dropped_item); Console.WriteLine(Convertor.exporter_wep(Dropped_item, "wep_name")); } else { Player_Inventory.Add_to_inventory("shield", Dropped_item); Console.WriteLine(Convertor.exporter_shield(Dropped_item, "shield_name")); } } Dungeon.CurRoom = Dungeon.RemoveMob(Currently_fighting_enemy_ID, Dungeon.CurRoom); for (int i = 0; i < Dungeon.MapArray.Count; i++) { if (Dungeon.MapArray[i].pos == Dungeon.CurRoom.pos) { Dungeon.MapArray[i] = Dungeon.CurRoom; } } Console.ReadLine(); return(true); }
//Calls inventory scene private bool Inventory() { Player_Inventory.Equip_weapon(); return(false); }