Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include "windows.h"
- using namespace std;
- string classChooser();
- string nameChooser();
- void introStory(string position, string name);
- int main()
- {
- string charPosition = classChooser();
- cout << "You chose " << charPosition << " as your class.";
- string charName = nameChooser();
- introStory(charPosition,charName);
- return 0;
- }
- string classChooser()
- {
- string position;
- while(true)
- {
- cout << "Choose a class wisely... nn";
- cout << "tWarrior: nt Health:75nt Attack:25nn";
- cout << "tWizard: nt Health:25nt Attack:75nn";
- cout << "tRogue: nt Health:50nt Attack:50n";
- cout << "nWhich class do you want to select? : ";
- cin >> position;
- if(position == "wizard" ||position == "warrior" ||position == "rogue" ||position == "Wizard" ||position == "Warrior" ||position == "Rogue")
- {
- system("cls");
- return position;
- }
- else
- {
- cout << "nnMake sure you typed in the word correctly, and used appropriate capitalization.";
- Sleep(3200);
- system("cls");
- continue;
- }
- }
- }
- string nameChooser()
- {
- string name;
- cout << "nPlease choose a name for your hero: ";
- cin >> name;
- cout << "nYour name is now " << name;
- return name;
- }
- void introStory(string position, string name)
- {
- cout << "nLet the story begin...";
- Sleep(2100);
- system("cls");
- cout << "Once upon a time in a poor village, a young kid named " << name << " was digging a hole.";
- Sleep(4000);
- cout << "After digging for a couple hours he came across a chest.";
- Sleep(3200);
- string weapon;
- if(position == "Warrior" || position == "warrior")
- weapon = "sword";
- else if(position == "Wizard" || position == "wizard")
- weapon = "wand";
- else
- weapon = "dagger";
- cout << "When he opened it, he found a " << weapon;
- Sleep(2000);
- cout << "That was exactly what he had been wanting for the past couple of months.";
- Sleep(3000);
- cout << "You see, " << name << " wanted to be a " << position;
- Sleep(2700);
- cout << "So a " << weapon << " was the perfect choice.";
- Sleep(2100);
- cout << "With his new " << weapon << " he could finally explore the dark cave his father was lossed in.";
- Sleep(4000);
- cout << "He could slay the monsters in there everyone was so terrified of.";
- Sleep(3200);
- cout << "He headed toward the cave.";
- Sleep(2000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement