Advertisement
asqapro

Battle Revise

Jul 17th, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. struct monster{
  2.     int rep_count;
  3.     int bi_count;
  4.     int hum_count;
  5.     int hy_count;
  6.     vector<string> mon_count;
  7. }mob;
  8.  
  9. mob.rep_count = 50;
  10. mob.bi_count = 95;
  11. mob.hum_count = 50; //Sets up the number of monsters you have to kill to win
  12. mob.hy_count = 5;
  13. for(int i=mob.bi_count;i>0;i--){
  14.     mob.mon_count.push_back("bird");
  15. }
  16. for(int i=mob.rep_count;i>0;i--){
  17.     mob.mon_count.push_back("reptile");
  18.     mob.mon_count.push_back("humanoid");
  19. }
  20. for(int i=mob.hy_count;i>0;i--){
  21.     mob.mon_count.push_back("hybrid");
  22. }
  23.  
  24. int freq = rand() % 200 + 1;
  25. string f_mon = mob.mon_count[freq];
  26. if(f_mon=="bird"){
  27.     mob.bird();
  28.     mob.mon_count.erase(mob.mon_count.begin()+freq);
  29. }
  30. else if(f_mon=="reptile"){
  31.     mob.reptile();
  32.     mob.mon_count.erase(mob.mon_count.begin()+freq);
  33. }
  34. else if(f_mon=="humanoid"){
  35.     mob.humanoid();
  36.     mob.mon_count.erase(mob.mon_count.begin()+freq);
  37. }
  38. else{
  39.     mob.hybrid();
  40.     mob.mon_count.erase(mob.mon_count.begin()+freq);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement