Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. if (enemyrandomattack == 4 && enemyDodge == 1) // if the enemy rolls a dodge action and already had dodge it will then use a normal attack instead of dodging again
  2. {
  3. enemy Dodge = 0; // it uses up the dodge and then attacks \/
  4. normalattack lines of code // i have attack instuctions over there but i cut them so you could see better
  5. }
  6. if (enemyrandomattack == 4 && enemyDodge != 1) // if the enemy does no have dodge it will then dodge
  7. {
  8. enemyDodge = 1;
  9. if (enemyNRG < 40)
  10. {
  11. enemyNRG = (enemyNRG + 5); // enemy gains 5 energy at the end of the turn because the player dodged and the energy gain is halved
  12. if (enemyNRG > 40)
  13. {
  14. enemyNRG = 40;
  15. }
  16. }
  17. cout << "The enemy decided to dodge the next attack!" << endl;
  18. cout << "Your creature has " << yourHP << " HP and " << yourNRG << " energy and the enemy has " << enemyHP << " HP and " << enemyNRG << " energy" << endl << endl << endl;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement