Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. void charCreate()
  2. {
  3. Fighter pc{ "a", 3, 3, 3, 10 };
  4. bool cont(0);
  5. int statNum(3);
  6. std::string statSel("0");
  7.  
  8. std::cout << "\nInput your character's name: ";
  9. std::getline(std::cin, pc.name);
  10.  
  11.  
  12. do
  13. {
  14. std::cout << std::string(50, '\n') << pc.name << " has:\nStrength: " << pc.str
  15. << "\nDexterity: " << pc.dex << "\nEndurance: " << pc.end << "\t\t\tHit points: " << pc.hp << "\n\n\n\n" <<
  16. "(1)Increase stat\t\t(2)Decrease stat\n(3)Finish\t\t\tStats remaining: " << statNum << "\n";
  17.  
  18. std::cin >> statSel;
  19.  
  20. if (statSel == "1")
  21. {
  22. std::cout << "\nWhich stat would you like to increase?\n\n(1)Strength\t(2)Dexterity\t(3)Endurance";
  23. std::getline(std::cin, statSel);
  24. if (statSel == "1")
  25. {
  26. pc.str++;
  27. statNum--;
  28. }
  29.  
  30. }
  31.  
  32. else if (statSel == "2")
  33. {
  34. std::cout << "\nWhich stat would you like to decrease?\n\n(1)Strength\t(2)Dexterity\t(3)Endurance";
  35.  
  36. }
  37. }
  38. while (statSel != "1" && statSel != "2" && statSel != "3" && cont);
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement