Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- srand(time(0));
- int maxDamage = armor + health;
- int damage = rand() % maxDamage + 1;
- if(damage < armor)
- {
- armor -= damage;
- }
- if(damage >= armor && damage <= maxDamage)
- {
- armor = 0;
- health -= (damage - armor);
- }
- if(damage > maxDamage)
- {
- cout << "\t\tThe orcs were stronger than you and you are now dead.\n";
- cout << "\t\tHope you had fun playing. Goodbye.\n\n";
- break;
- }
- cout << "They put up a good fight but take your armor down to: " << armor << "\n";
- cout << "And your health is at: " << health << "\n\n";
- break;
Add Comment
Please, Sign In to add comment