public static void NormalCommands(string verb, string noun) { switch (verb) { case "look": if (noun != "") { Look.Looking(noun); } else { Look.Looking(); } break; case "help": HelpFile.HelpInfo(); break; case "score": Score.Stats(Player._player); break; case "get": Get.GetCommand(noun, Player._player); break; case "north": PlayerMove.MoveTo(verb); break; case "east": PlayerMove.MoveTo(verb); break; case "south": PlayerMove.MoveTo(verb); break; case "west": PlayerMove.MoveTo(verb); break; case "inventory": Inventory.Inv(Player._player); break; case "attack": Attack.Attacking(noun, Player._player); break; case "drop": ItemDrop.Drop(noun, Player._player); break; case "equip": Equipt.Equip(noun, Player._player); break; case "save": SaveData.SaveGameData(Player._player); break; case "equipment": Worn.DisplayEquipment(Player._player); break; } }
public static void CreatePlayerInst() { string name; string className = ""; string raceName = ""; Factions faction = Factions.Admin; int alignment = 0; int gold = 0; int hp = 0; bool validRace = false; bool validClass = false; bool validFaction = false; Console.WriteLine("Give me your name."); Console.Write("> "); name = CapWord.FirstCharToUpper(Console.ReadLine()); while (validClass == false) { Console.WriteLine("What class would you like to be?"); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write("Warrior, Mage, Thief > "); className = Console.ReadLine().ToLower(); Console.ForegroundColor = ConsoleColor.White; if (className == "warrior") { gold = 100; validClass = true; } else if (className == "mage") { gold = 150; validClass = true; } else if (className == "thief") { gold = 200; validClass = true; } else { Console.WriteLine("Not a valid class"); } } while (validRace == false) { Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("What race would you like?"); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write("Human, Elf, Dwarf > "); raceName = Console.ReadLine().ToLower(); if (raceName == "human") { validRace = true; hp = 100; } else if (raceName == "elf") { validRace = true; hp = 80; } else if (raceName == "dwarf") { validRace = true; hp = 120; } else { Console.WriteLine("Not a Valid entry."); } } while (validFaction == false) { Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("To what faction do you belong?"); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write("Hero, Villion > "); string strFaction = CapWord.FirstCharToUpper(Console.ReadLine()); if (strFaction == Factions.Hero.ToString() || strFaction == Factions.Villain.ToString() || strFaction == Factions.Admin.ToString()) { faction = (Factions)Enum.Parse(typeof(Factions), strFaction, true); validFaction = true; } } Console.ForegroundColor = ConsoleColor.White; Player._player = new Player(name, CapWord.FirstCharToUpper(className), CapWord.FirstCharToUpper(raceName), gold, hp, hp, (Weapon)World.WeaponByID(103), false, true, faction, alignment); Console.WriteLine("Creating character data, please wait!"); SaveData.SaveGameData(Player._player); }