Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void charCreate()
- {
- Fighter pc{ "a", 3, 3, 3, 10 };
- bool cont(0);
- int statNum(3);
- std::string statSel("0");
- std::cout << "\nInput your character's name: ";
- std::getline(std::cin, pc.name);
- do
- {
- std::cout << std::string(50, '\n') << pc.name << " has:\nStrength: " << pc.str
- << "\nDexterity: " << pc.dex << "\nEndurance: " << pc.end << "\t\t\tHit points: " << pc.hp << "\n\n\n\n" <<
- "(1)Increase stat\t\t(2)Decrease stat\n(3)Finish\t\t\tStats remaining: " << statNum << "\n";
- std::cin >> statSel;
- if (statSel == "1")
- {
- std::cout << "\nWhich stat would you like to increase?\n\n(1)Strength\t(2)Dexterity\t(3)Endurance";
- std::getline(std::cin, statSel);
- if (statSel == "1")
- {
- pc.str++;
- statNum--;
- }
- }
- else if (statSel == "2")
- {
- std::cout << "\nWhich stat would you like to decrease?\n\n(1)Strength\t(2)Dexterity\t(3)Endurance";
- }
- }
- while (statSel != "1" && statSel != "2" && statSel != "3" && cont);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement