Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void enemySoloBattle()
- {
- timeOut();
- itemCheck();
- bool battle=true;
- firstTurn=true;
- cout<<"Your battle with a level "<<enemyLevel<<" "<<enemyName<<" has begun!\n";
- enemyCurrentHP=enemyMaxHP;
- while (battle==true)
- {
- int mainRoll=rand() % 10 + 1;
- int enemyRoll=rand() % 5 + 1;
- enemyDamage=mainRoll+mainATK-enemyDEF-enemyDEFBoost1-enemyDEFBoost2;
- if ((mainAbility==2) && (firstTurn==true))
- {
- cout<<mainName<<" has an ability! It is Pre-Emptive Strike!\n";
- cout<<"The "<<enemyName<<" has taken an extra 5 damage!\n";
- enemyDamage=enemyDamage+5;
- sleep(2);
- }
- mainWeaponAdvEngine();
- enemyCurrentHP=enemyCurrentHP-enemyDamage;
- cout<<"The "<<enemyName<<" has taken "<<enemyDamage<<" damage!\n";
- sleep(2);
- mainDamage=enemyRoll+enemyATK-mainDEF-mainDEFBoost2-mainDEFBoost1;
- mainCurrentHP=mainCurrentHP-mainDamage;
- enemyWeaponAdvEngine();
- cout<<"You have taken "<<mainDamage<<" damage!\n";
- sleep(2);
- firstTurn=false;
- if (enemyCurrentHP<0.1 && mainCurrentHP<0.1)
- {
- cout<<"You are both dead!\n";
- battle=false;
- continuation=false;
- }
- if (mainCurrentHP<0.1 && enemyCurrentHP>0)
- {
- cout<<"You lost!\n";
- battle=false;
- continuation=false;
- }
- if (enemyCurrentHP<0.1 && mainCurrentHP>0)
- {
- cout<<"You won!\n";
- cout<<"You earned "<<enemyReward<<" coins!\n";
- mainMaxHP=mainMaxHP+mainRoll;
- mainATK=mainATK+1;
- mainDEF=mainDEF+1;
- cash=cash+enemyReward;
- battle=false;
- cout<<"Here are your new stats:\n"<<"MaxHP="<<mainMaxHP<<"; mainATK="<<mainATK<<"; mainDEF="<<mainDEF<<"; cash="<<cash<<".\n";
- mainEXP=mainEXP+(enemyLevel*0.5);
- newAbility=mainAbility+mainAbility+mainAbility+mainAbility;
- if (newAbility-mainEXP<0)
- {
- cout<<"You have unlocked a new ability!";
- mainAbility++;
- }
- cout<<"You currently have "<<mainEXP<<"EXP. You are "<<newAbility-mainEXP<<" EXP away from Ability "<<mainAbility+1<<".\n";
- timeOut();
- }
- }
- }
Add Comment
Please, Sign In to add comment