Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. void swordUpgrade()
  2. {
  3. int level = 1;
  4. int goldReq = 100;
  5. char choice = y;
  6. if ( gold >= goldReq)
  7. {
  8. while ( choice != 'N')
  9. {
  10. cout << "\nYour sword mad SKLLZ are currently" << level << " level\n";
  11. cout << "\nUpgrading it to " << level + 1 << " will cost " << goldReq << " golden coins\n";
  12. cout << "\nLeaving you with " << gold - goldReq << " amount of golden coins\n";
  13. cout << "\nWill you do it?\n";
  14. cout << "\n Y for Yes or N for No!\n";
  15. char choice;
  16. cin >> choice;
  17. if ( choice == 'Y')
  18. {
  19. attack += 5;
  20. strenght +=2;
  21. gold -= goldReq;
  22. goldReq += 100;
  23. level ++;
  24. break;
  25. }
  26. else
  27. {
  28. break;
  29. }
  30. }
  31. }
  32. else
  33. {
  34. cout << "\nYou've not enough money!";
  35. }
  36. }
  37. void armorUpgrade()
  38. {
  39.  
  40. int goldReq = 100;
  41. int level = 1
  42. char choice = y;
  43. if ( gold >= goldReq)
  44. {
  45. while ( choice != 'N')
  46. {
  47. cout << "\nYour armor is currently" << level << " level\n";
  48. cout << "\nUpgrading it to " << level + 1 << " will cost " << goldReq << " golden coins\n";
  49. cout << "\nLeaving you with " << gold - goldReq << " amount of golden coins\n";
  50. cout << "\nWill you do it?\n";
  51. cout << "\n Y for Yes or N for No!\n";
  52. char choice;
  53. cin >> choice;
  54. if ( choice == 'Y' || choice == 'y')
  55. {
  56. defence += 5;
  57. maxhealth += 10;
  58. gold -= goldReq;
  59. goldReq += 100;
  60. level ++;
  61. cout << " \nGold is" << gold;
  62. cout << " \n GoldREQ is" << goldReq;
  63. break;
  64. }
  65. else
  66. {
  67. break;
  68. }
  69. }
  70. }
  71. else
  72. {
  73. cout << "\nYou've not enough money!";
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement