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