public void greetMsg3() { Console.Clear(); Console.WriteLine($"{player.name}, nice! You survived the alien filled streets and now have access to the alien’s ship."); Console.WriteLine($"You try opening the door to the ship, but it is locked..."); Console.WriteLine("You look through your items..."); player.viewItems(); Console.WriteLine("Of course... you use the keys to open the door"); player.playerItems.Remove("Keys to the alien's ship"); mainSelc3(); }
public int Locker(int choice) { switch (choice) { case 2: Console.Clear(); Console.WriteLine("The locker is at the foot of the bed."); Console.WriteLine("There is a half eaten sandwich on top of it, you move it to see inside."); if (player.playerItems.Count == 0) { Console.WriteLine("In it, you see clothes, and one experimental laser gun you developed last week but have not tested."); Console.WriteLine("What to do?"); Console.WriteLine("1 Grab items"); Console.WriteLine("2 Finish the half eaten sandwich"); if (!int.TryParse(Console.ReadLine(), out case2choice) || case2choice < 1 || case2choice > 2) { errorMsg(); Locker(choice); } if (case2choice == 1) { Console.Clear(); player.playerItems.Add("Clothes"); player.playerItems.Add("Experimental Laser Gun"); player.viewItems(); Console.WriteLine("These items allow you to leave the room."); Console.WriteLine("What do you want to do next?"); counter = 1; return(1); } else if (case2choice == 2) { Console.Clear(); Console.WriteLine("The sandwich is still good, but..."); Console.WriteLine("Aliens attack while eating..."); Console.WriteLine("You Loose!"); return(2); } else { throw new InvalidEntry(); } } else if (player.playerItems.Count == 2) { Console.WriteLine("Chest is empty."); Console.WriteLine("What do you want to do next?"); return(1); } else { throw new InvalidEntry(); } default: { errorMsg(); throw new InvalidEntry(); } } }