Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <limits>
- #include <Windows.h>
- #include "MMSystem.h"
- #include <thread>
- using namespace std;
- //////////////////////// List of variables
- int race;
- string name;
- int profession;
- int gender;
- int attributesp=20;
- string advready;
- bool advreadybl;
- bool dogesong;
- bool dogesongapr;
- bool cont;
- /////////////////////////List of variables
- ////////////////////////////// List of attribute
- int attributes;
- int strength=10;
- int dextrity=10;
- int intelligence=10;
- int constitution=10;
- int charisma=10;
- ////////////////////////////// List of variables
- void music()
- {
- while (dogesong==0)
- {
- dogesongapr=1;
- }
- if (dogesongapr=1) PlaySound(TEXT("dogsong.wav"), NULL, SND_SYNC);
- }
- int main()
- {
- thread first (music);
- ////////////////////////////////////////// List of genders
- cout << "Choose gender" << endl;
- cout << "1. Male" << endl;
- cout << "2. Female" << endl;
- cout << endl;
- ////////////////////////////////////////// List of genders
- ////////////////////// Inputting value into variable for gender
- cin >> gender;
- cout << endl;
- ////////////////////// Inputting value into variable for gender
- ////////////////////////////////////////////////////////////////////// Checking gender
- while(gender < 1 || gender > 2)
- {
- cout << "Choose correct gender!" << endl;
- cout << "Choose gender" << endl;
- cout << "1. Male" << endl;
- cout << "2. Female" << endl;
- cout << endl;
- if(!cin)
- {
- cin.clear();
- cin.ignore(numeric_limits<streamsize>::max(), '\n');
- }
- cin >> gender;
- cout << endl;
- }
- ////////////////////////////////////////////////////////////////////// Checking gender
- ////////////////////////////////////////// List of races
- cout << "Choose race" << endl;
- cout << "1. Human" << endl;
- cout << "2. Elf" << endl;
- cout << "3. Orc" << endl;
- cout << endl;
- ////////////////////////////////////////// List of races
- //////////////////// Inputting value into variable for race
- cin >> race;
- cout << endl;
- //////////////////// Inputting value into variable for race
- //////////////////////////////////////////////////////////////////// Checking race
- while(race < 1 || race > 3)
- {
- cout << "Choose correct race!" << endl;
- cout << "Choose race" << endl;
- cout << "1. Human" << endl;
- cout << "2. Elf" << endl;
- cout << "3. Orc" << endl;
- cout << endl;
- if(!cin)
- {
- cin.clear();
- cin.ignore(numeric_limits<streamsize>::max(), '\n');
- }
- cin >> race;
- cout << endl;
- }
- //////////////////////////////////////////////////////////////////// Checking race
- /////////////////////////////////////
- //
- switch (race) //
- { //
- //
- /////////////////////////////////////
- //
- case '1': //
- cout << "You chosed human" << endl; //
- break; //
- //
- ///////////////////////////////////// Description and info about chosing race.
- //
- case '2': //
- cout << "You chosed elf" << endl; //
- break; //
- //
- /////////////////////////////////////
- //
- case '3': //
- cout << "You chosed orc" << endl; //
- break; //
- } //
- //
- /////////////////////////////////////
- ///////////////////////
- //
- //
- cout << endl; // End line
- //
- //
- ///////////////////////
- ////////////////////////////////////////////
- //
- cout << "Choose profession" << endl; //
- cout << "1. Warrior" << endl; //
- cout << "2. Archer" << endl; // List of professions
- cout << "3. Mage" << endl; //
- cout << endl; //
- //
- ////////////////////////////////////////////
- //////////////////////
- //
- cin >> profession; //
- cout << endl; // Inputting value into variable for profession
- //
- //////////////////////
- //////////////////////////////////////////////////////////////////
- //
- while(profession < 1 || profession > 3) //
- { //
- cout << "Chose correct profession!" << endl; //
- cout << "Choose profession" << endl; //
- cout << "1. Warrior" << endl; //
- cout << "2. Archer" << endl; //
- cout << "3. Mage" << endl; // Checking profession
- cout << endl; //
- if(!cin) //
- { //
- cin.clear(); //
- cin.ignore(numeric_limits<streamsize>::max(), '\n'); //
- } //
- cin >> profession; //
- cout << endl; //
- } //
- //////////////////////////////////////////////////////////////////
- /////////////////////////////////////
- //
- switch (profession) //
- { //
- //
- /////////////////////////////////////
- //
- case 1: //
- cout << "You chosed warrior" << endl; //
- break; //
- //
- ///////////////////////////////////// Description and info about chosing profession.
- //
- case 2: //
- cout << "You chosed archer" << endl; //
- break; //
- //
- /////////////////////////////////////
- //
- case 3: //
- cout << "You chosed mage" << endl; //
- break; //
- } //
- //
- /////////////////////////////////////
- ///////////////////////
- //
- //
- cout << endl; // End line
- //
- //
- ///////////////////////
- cout << "Choose your name: "; cin >> name; cout << endl;
- /////////////////////////////////////////////////////////////////////////
- //
- while(!(attributesp<1)) //
- { //
- cout << "Please manage your attribute points" << endl; //
- cout << endl; //
- cout << "Remaining attribute points: " << attributesp; //
- cout << endl; //
- cout << "Attributes: " << endl; //
- cout << "1. (101) Strength: " << strength << endl; //
- cout << "2. (202) Constitution: " << constitution << endl; //
- cout << "3. (303) Charisma: " << charisma << endl; // Attribute managment
- cout << "4. (404) Dextrity: " << dextrity << endl; //
- cout << "5. (505) Intelligence: " << intelligence << endl; //
- cout << endl; //
- cout << "If you want to know anything about any attribute type" << endl; cout << endl; cout << "( 101 / 202 / 303 / 404 / 505 ) " << endl;
- cout << endl;
- cout << "If you want to upgrade attribute select numer" << endl; cout << endl; cout << "( 1 / 2 / 3 / 4 / 5 )" << endl;
- cout << endl;
- cout << "Choose: ";
- cin >> attributes;
- cout << endl;
- /////////////////////////////////////////////////////////////////////////
- //
- switch(attributes) //
- { //
- case 1: //
- strength=strength+2;
- attributesp=attributesp-2; //
- break; //
- //
- case 2: //
- constitution=constitution+2;
- attributesp=attributesp-2; //
- break; //
- //
- case 3: //
- charisma=charisma+2;
- attributesp=attributesp-2; //
- break; //
- //
- case 4: //
- dextrity=dextrity+2;
- attributesp=attributesp-2;
- //
- break; //
- //
- case 5: //
- intelligence=intelligence+2;
- attributesp=attributesp-2; //
- break;
- case 101:
- cout << "Strength makes your character hit harder," << endl;
- cout << "dealing more damage to enemies." << endl;
- cout << " "<< endl;
- system ("pause"); cout << endl;
- break;
- case 202:
- cout << "Constitution makes your character healther," << endl;
- cout << "increasing amount of damage he can take." << endl;
- cout << " "<< endl;
- system ("pause"); cout << endl;
- break;
- case 303:
- cout << "Charisma makes your character move convincing," << endl;
- cout << "increasing his speech and allowing him to buy items for less gold." << endl;
- cout << " "<< endl;
- system ("pause"); cout << endl;
- break;
- case 404:
- cout << "Dextrity makes your character more agile," << endl;
- cout << "increasing amount of damage dealt with bows." << endl;
- cout << " "<< endl;
- system ("pause"); cout << endl;
- break;
- case 505:
- cout << "Intelligence makes your character more intelligent," << endl;
- cout << "increaces amount of damage dealt with magic." << endl;
- cout << " "<< endl;
- system ("pause"); cout << endl;
- break;
- default:
- cout << endl;
- break;
- }
- cout << endl;
- }
- cout << "Your attributes are: " << endl;
- cout << "STR: " << strength << endl;
- cout << "CON: " << constitution << endl;
- cout << "CHA: " << charisma << endl;
- cout << "DEX: " << dextrity << endl;
- cout << "INT: " << intelligence << endl;
- /////////////////////////////////////////////////////////////////////////
- cout << "You chosed "; if (gender==1) cout << "male "; else cout << "female ";
- switch(profession)
- {
- case 1:
- cout <<"warrior ";
- break;
- case 2:
- cout <<"archer ";
- break;
- case 3:
- cout <<"mage ";
- break;
- }
- switch(race)
- {
- case 1:
- cout <<"human ";
- cout << endl;
- break;
- case 2:
- cout <<"elf ";
- cout << endl;
- break;
- case 3:
- cout <<"orc ";
- cout << endl;
- break;
- }
- cout << endl;
- cout << "Now, tell me, " << name << " are you ready to begin your adventure? ";
- cout << "(Yes / No)"; cout << endl;
- cout << "Choose "; cin >> advready; cout << endl;
- if (advready=="Yes") advreadybl=1; else if (advready=="yes") advreadybl=1;
- if (advreadybl==0) dogesong=1;
- while (advreadybl==0)
- {
- cout << endl;
- cout << "Please write 'Yes if you're ready to begin your adventure. " << endl;
- cout << "Whilist you're struggling with your choice, listen to this dog song." << endl;
- cout << endl;
- cout << "Choose "; cin >> advready; cout << endl;
- if (advready=="Yes") advreadybl=1; else if (advready=="yes") advreadybl=1;
- }
- dogesong=1;
- cout << "Enter first room: ";
- system ("Pause");
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement