Guest User

Untitled

a guest
Feb 21st, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. void enemySoloBattle()
  2. {
  3. timeOut();
  4. itemCheck();
  5. bool battle=true;
  6. firstTurn=true;
  7. cout<<"Your battle with a level "<<enemyLevel<<" "<<enemyName<<" has begun!\n";
  8. enemyCurrentHP=enemyMaxHP;
  9. while (battle==true)
  10. {
  11. int mainRoll=rand() % 10 + 1;
  12. int enemyRoll=rand() % 5 + 1;
  13. enemyDamage=mainRoll+mainATK-enemyDEF-enemyDEFBoost1-enemyDEFBoost2;
  14. if ((mainAbility==2) && (firstTurn==true))
  15. {
  16. cout<<mainName<<" has an ability! It is Pre-Emptive Strike!\n";
  17. cout<<"The "<<enemyName<<" has taken an extra 5 damage!\n";
  18. enemyDamage=enemyDamage+5;
  19. sleep(2);
  20. }
  21. mainWeaponAdvEngine();
  22. enemyCurrentHP=enemyCurrentHP-enemyDamage;
  23. cout<<"The "<<enemyName<<" has taken "<<enemyDamage<<" damage!\n";
  24. sleep(2);
  25. mainDamage=enemyRoll+enemyATK-mainDEF-mainDEFBoost2-mainDEFBoost1;
  26. mainCurrentHP=mainCurrentHP-mainDamage;
  27. enemyWeaponAdvEngine();
  28. cout<<"You have taken "<<mainDamage<<" damage!\n";
  29. sleep(2);
  30. firstTurn=false;
  31. if (enemyCurrentHP<0.1 && mainCurrentHP<0.1)
  32. {
  33. cout<<"You are both dead!\n";
  34. battle=false;
  35. continuation=false;
  36. }
  37. if (mainCurrentHP<0.1 && enemyCurrentHP>0)
  38. {
  39. cout<<"You lost!\n";
  40. battle=false;
  41. continuation=false;
  42. }
  43. if (enemyCurrentHP<0.1 && mainCurrentHP>0)
  44. {
  45. cout<<"You won!\n";
  46. cout<<"You earned "<<enemyReward<<" coins!\n";
  47. mainMaxHP=mainMaxHP+mainRoll;
  48. mainATK=mainATK+1;
  49. mainDEF=mainDEF+1;
  50. cash=cash+enemyReward;
  51. battle=false;
  52. cout<<"Here are your new stats:\n"<<"MaxHP="<<mainMaxHP<<"; mainATK="<<mainATK<<"; mainDEF="<<mainDEF<<"; cash="<<cash<<".\n";
  53. mainEXP=mainEXP+(enemyLevel*0.5);
  54. newAbility=mainAbility+mainAbility+mainAbility+mainAbility;
  55. if (newAbility-mainEXP<0)
  56. {
  57. cout<<"You have unlocked a new ability!";
  58. mainAbility++;
  59. }
  60. cout<<"You currently have "<<mainEXP<<"EXP. You are "<<newAbility-mainEXP<<" EXP away from Ability "<<mainAbility+1<<".\n";
  61. timeOut();
  62. }
  63. }
  64. }
Add Comment
Please, Sign In to add comment