Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (playing = 1) {
- cout << "What is your name? ";
- cin >> name;
- sleep(1500);
- cout << "You set out for an adventure in a cave.\n";
- sleep(1500);
- cout << "As you venture deeper into the cave, you find a crate\n";
- sleep(1500);
- while (searchChest != 'y' && searchChest != 'n') {
- cout << "Do you wish to search the crate? y/n \n";
- cin >> searchChest;
- sleep(1500);
- if (searchChest == 'y') {
- sleep(1500);
- choices++;
- srand(static_cast<unsigned int>(time(0)));
- int chestPick = rand() % 4;
- weapon = chestInventory[chestPick];
- sleep(1500);
- if (chestPick = 0) {
- cout << "You found an" << weapon << "\n" << "You decide to continue on with the adventure with the newly found" << weapon << "\n";
- }
- else if (chestPick = 3) {
- cout << "You found nothing!\n" << "Saddened, you decide to continue on with the adventure\n";
- }
- else {
- cout << "You found a" << weapon << "\n" << "You decide to continue on with the adventure with the newly found" << weapon << "\n";
- }
- }
- else if (searchChest == 'n') {
- choices++;
- cout << "You decide not to search the crate and continue on with your adventure.\n";
- }
- else {
- cout << "Unknown character! retry!\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement