//Creates a new character and gives them the default weapon (Six-Shooter) public Player NewCharacter() { string temp, temp2, temp3, temp4, temp5; Weapons.WeaponsOwned.Clear(); foreach (Weapons w in Weapons.WeaponCheck) { if (w.ownedByPlayer == true) { Weapons.WeaponsOwned.Add(w); } } sC.TB("\t Enter Your Character's Name"); p.name = sC.RL(""); temp = sC.WRL("Press R to roll for Strength"); if (temp == "r") { Console.Clear(); Console.WriteLine("Rolling..."); Console.WriteLine($"Strength: {p.Str = StatRoll(0)}"); } temp2 = sC.WRL("Press R to roll for Dexterity"); if (temp2 == "r") { Console.Clear(); Console.WriteLine("Rolling..."); Console.WriteLine($"Dexterity: {p.Dex = StatRoll(0)}"); } temp3 = sC.WRL("Press R to roll for Intelligence"); if (temp3 == "r") { Console.Clear(); Console.WriteLine("Rolling..."); Console.WriteLine($"Intelligence: {p.Int = StatRoll(0)}"); } temp4 = sC.WRL("Press R to roll for Constitution"); if (temp4 == "r") { Console.Clear(); Console.WriteLine("Rolling..."); Console.WriteLine($"Constitution: {p.Con = StatRoll(0)}"); } temp5 = sC.WRL("Press R to roll for Perception"); if (temp5 == "r") { Console.Clear(); Console.WriteLine("Rolling..."); Console.WriteLine($"Perception: {p.Per = StatRoll(0)}"); p.Gold = 80; return(p); } else { Console.WriteLine("invalid command"); return(null); } }
//This allows the player to purchase the weapons listed in WeaponStats.csv. public void Shop() { sC.TB($"\"Welcome to Mom & Pop's Firearm Shoppe!\"\nSays the bespectacled man behind the counter."); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); Console.Clear(); int temp = 1; foreach (Weapons w in Weapons.WeaponCheck) { if (w.ownedByPlayer == false) { Console.WriteLine($"[{temp}]: {w.name}\nDamage: {w.bDamage}\nRange: {w.maxRange}\nPrice: {w.price}\n"); temp++; } } string test = sC.WRL($"Your Gold: {Program.p.Gold}\nChoose a weapon to purchase."); if (test == "1") { //gives player rifle foreach (Weapons wep in Weapons.WeaponCheck) { if (wep.name == "Repeater Rifle") { if (Program.p.Gold >= wep.price) { wep.ownedByPlayer = true; Weapons.WeaponsOwned.Add(wep); Program.p.Gold -= wep.price; //wep.ownedByPlayer = true; } else { Console.WriteLine($"Sorry, but you don't have enough for this piece. \nYou need {wep.price - Program.p.Gold} more to walk off with this."); } } } } else if (test == "2") { //gives player shotgun foreach (Weapons wep in Weapons.WeaponCheck) { if (wep.name == "Double-Barrel Shotgun") { if (Program.p.Gold >= wep.price) { wep.ownedByPlayer = true; Weapons.WeaponsOwned.Add(wep); Program.p.Gold -= wep.price; //wep.ownedByPlayer = true; } else { Console.WriteLine($"Sorry, but you don't have enough for this piece. \nYou need {wep.price - Program.p.Gold} more to walk off with this."); } } } } else if (test == "3") { //gives player PKD foreach (Weapons wep in Weapons.WeaponCheck) { if (wep.name == "PKD .223") { if (Program.p.Gold >= wep.price) { wep.ownedByPlayer = true; Weapons.WeaponsOwned.Add(wep); Program.p.Gold -= wep.price; //wep.ownedByPlayer = true; } else { Console.WriteLine($"Sorry, but you don't have enough for this piece. \nYou need {wep.price - Program.p.Gold} more to walk off with this."); } } } } else { } }