1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#include <iostream>
#include <string>
class player
{
public:
std::string name;
int strength;
int stamina;
int luck;
int stealth;
bool dead;
void make(std::string, int, int, int, int, bool);
};
void player::make(std::string nam, int str, int sta, int luk, int stl, bool ded)
{
std::string name = nam;
int strength = str;
int stamina = sta;
int luck = luk;
int stealth = stl;
bool dead = ded;
}
player user;
void intro()
{
int tempstr;
int tempsta;
int templuk;
int tempstl;
std::string tempname;
std::cout<<"enter your name:"<<std::endl;
std::cin >> tempname;
std::cout<<"allocate thirty skill points to these four stats. these will serve as your main player's stats."<<std::endl;
std::cout<<"strength, stamina, luck, stealth"<<std::endl;
std::cout<<"strength:";
std::cin >> tempstr;
std::cout<<"stamina:";
std::cin >> tempsta;
std::cout<<"luck:";
std::cin >> templuk;
std::cout<<"stealth:";
std::cin >> tempstl;
std::cout<<" "<<std::endl;
user.make(tempname,tempstr, tempsta, templuk, tempstl, true);
}
int main (int argc, const char * argv[])
{
intro();
std::cout<<user.strength;
return 0;
}
|