Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 4th, 2013  |  syntax: C++  |  size: 79.12 KB  |  views: 35  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //dodrio, hypno, joleon, victrebel, venusaur, sandslash, articuno, moltres, kingler
  2. //plays pokemon
  3. //12-13-12
  4.  
  5. #include <iostream>
  6. #include <string>
  7. #include <vector>
  8. #include <cstdlib>
  9. #include <ctime>
  10. #include <cmath>
  11.  
  12. using namespace std;
  13.  
  14. int player_pokemon=0;
  15. int enemy_pokemon=0;
  16. int your_choice;
  17. int enemy_choice;
  18. int your_switch=0;
  19. int enemy_switch=0;
  20. int damage;
  21. int move_choices;
  22. float reflect=1.00;
  23. int reflect_ctr=-1;
  24. float t_speed=1;
  25. float t_def=1;
  26. float t_spc=1;
  27. float evasion=1.00;
  28. int confusion=0;
  29. int confusion_ctr;
  30. int substitute=0;
  31. int counter_power=0;
  32. int mimic_choice=-1;
  33. int recharge=0;
  34. int enemy_recharge=0;
  35.  
  36. void enemy_r_switch();
  37. void player_switch();
  38. void enemy_death();
  39. void player_death();
  40.  
  41.  
  42. //MOVESET Constants
  43. void initialize_deck();
  44. void output_deck();
  45. void output_moves();
  46. void move_list();
  47. void output_party();
  48. void instructions();
  49. void teambuilder();
  50. void create_enemy_team();
  51. void your_battlecode();
  52. void enemy_battlecode();
  53.  
  54. class Moves
  55. {
  56.     friend ostream&operator<<(ostream& os, const Moves& pmoves);
  57. public:
  58.     Moves(string move, string move_type, int power, int acr, int pp, int cat);
  59.     string get_move() const;
  60.     string get_move_type() const;
  61.     int get_power() const;
  62.     int get_acr() const;
  63.     int get_pp() const;
  64.     int get_cat() const;
  65.  
  66.     string m_move;
  67.     string m_move_type;
  68.     int    m_power;
  69.     int    m_acr;
  70.     int    m_pp;
  71.     int    m_cat;
  72.  
  73.  
  74. private:
  75.  
  76. };
  77.  
  78. class Pokemon_card
  79. {
  80.     friend ostream&operator<<(ostream& os, const Pokemon_card& pcard);
  81. public:
  82.     Pokemon_card(string name, string type1, string type2, float max_hp, float hp, float atk, float def, float spc, float speed, float health);
  83.     string get_name() const;
  84.     string get_type1() const;
  85.     string get_type2() const;
  86.     int get_max_hp() const;
  87.     int get_hp() const;
  88.     int get_atk() const;
  89.     int get_def() const;
  90.     int get_spc() const;
  91.     int get_speed() const;
  92.     int get_health() const;
  93.     string m_name;
  94.     string m_type1;
  95.     string m_type2;
  96.     int    m_max_hp;
  97.     int    m_hp;
  98.     int    m_atk;
  99.     int    m_def;
  100.     int    m_spc;
  101.     int    m_speed;
  102.     int    m_health;
  103.     vector<Moves>   m_moves;
  104.     vector<Moves>   m_party_moves;
  105.  
  106. private:
  107.  
  108. };
  109.  
  110.  
  111. string Pokemon_card::get_name() const
  112. {
  113.     return m_name;
  114. }
  115.  
  116. string Pokemon_card::get_type1() const
  117. {
  118.     return m_type1;
  119. }
  120.  
  121. string Pokemon_card::get_type2() const
  122. {
  123.     return m_type2;
  124. }
  125.  
  126. int Pokemon_card::get_max_hp() const
  127. {
  128.     return m_max_hp;
  129. }
  130.  
  131. int Pokemon_card::get_hp() const
  132. {
  133.     return m_hp;
  134. }
  135.  
  136. int Pokemon_card::get_atk() const
  137. {
  138.     return m_atk;
  139. }
  140.  
  141. int Pokemon_card::get_def() const
  142. {
  143.     return m_def;
  144. }
  145.  
  146. int Pokemon_card::get_spc() const
  147. {
  148.     return m_spc;
  149. }
  150.  
  151. int Pokemon_card::get_speed() const
  152. {
  153.     return m_speed;
  154. }
  155.  
  156. int Pokemon_card::get_health() const
  157. {
  158.     return m_health;
  159. }
  160. //
  161. string Moves::get_move() const
  162. {
  163.     return m_move;
  164. }
  165.  
  166. string Moves::get_move_type() const
  167. {
  168.     return m_move_type;
  169. }
  170.  
  171. int Moves::get_power() const
  172. {
  173.     return m_power;
  174. }
  175.  
  176. int Moves::get_acr() const
  177. {
  178.     return m_acr;
  179. }
  180.  
  181. int Moves::get_pp() const
  182. {
  183.     return m_pp;
  184. }
  185.  
  186. int Moves::get_cat() const
  187. {
  188.     return m_cat;
  189. }
  190.  
  191. ostream&operator<<(ostream& os, const Pokemon_card& pcard);
  192.  
  193. Pokemon_card::Pokemon_card(string name, string type1, string type2, float max_hp, float hp, float atk, float def, float spc, float speed, float health):
  194.     m_name(name), m_type1(type1), m_type2(type2), m_max_hp(max_hp), m_hp(hp), m_atk(atk), m_def(def), m_spc(spc), m_speed(speed), m_health(health)
  195. {}
  196.  
  197. ostream&operator<<(ostream& os, const Moves& pmove);
  198.  
  199. Moves::Moves(string move, string move_type, int power, int acr, int pp, int cat):
  200.     m_move(move), m_move_type(move_type), m_power(power), m_acr(acr), m_pp(pp), m_cat(cat)
  201. {}
  202.  
  203. vector<Pokemon_card> deck;
  204. vector<Moves> list;
  205. vector<Pokemon_card>::iterator my_interator;
  206. vector<Pokemon_card>::const_iterator iter;
  207. vector<Pokemon_card>enemy_team;
  208. vector<Pokemon_card>party;
  209. vector<Moves>your_moves;
  210. vector<Moves>enemy_moves;
  211.  
  212. vector<Pokemon_card>temp_team;
  213. vector<Moves>temp_moves;
  214. void initialize_deck()
  215. {
  216.     temp_team.push_back(Pokemon_card("Temp Pokemon", "Psychic", "", 313, 313,198,188,368,338, 1));
  217.     temp_team[temp_team.size()-1].m_moves.push_back(Moves("Temp Move", "Psychic", 90, 100, 16, 3));
  218.  
  219.     deck.push_back(Pokemon_card("Alakazam ", "Psychic", "", 313, 313,198,188,368,338, 1));
  220.     deck[deck.size()-1].m_moves.push_back(Moves("Psychic", "Psychic", 90, 100, 16, 3));
  221.     deck[deck.size()-1].m_moves.push_back(Moves("Recover","Normal", 0, 100, 16, 0));
  222.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  223.     deck[deck.size()-1].m_moves.push_back(Moves("Seismic Toss","Fighting", 100, 100, 32, 1));
  224.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  225.     deck[deck.size()-1].m_moves.push_back(Moves("Kinesis","Psychic", 0, 80, 24, 1));
  226.     deck[deck.size()-1].m_moves.push_back(Moves("Counter","Fighting", 0, 100, 32, 1));
  227.     deck[deck.size()-1].m_moves.push_back(Moves("Mimic","Normal", 0, 100, 16, 1));
  228.  
  229.     deck.push_back(Pokemon_card("Chansey  ", "Normal", "",703, 703,108,108,308,198, 1));
  230.     deck[deck.size()-1].m_moves.push_back(Moves("Ice Beam", "Ice", 95, 100, 16, 3));
  231.     deck[deck.size()-1].m_moves.push_back(Moves("Softboiled","Psychic", 0, 100, 16, 0));
  232.     deck[deck.size()-1].m_moves.push_back(Moves("Counter","Fighting", 0, 100, 32, 1));
  233.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  234.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  235.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  236.     deck[deck.size()-1].m_moves.push_back(Moves("Sing","Psychic", 0, 55, 24, 1));
  237.     deck[deck.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  238.     deck[deck.size()-1].m_moves.push_back(Moves("Flash","Normal", 0, 70, 32, 1));
  239.     deck[deck.size()-1].m_moves.push_back(Moves("Seismic Toss","Fighting", 100, 100, 32, 1));
  240.     //  deck[deck.size()-1].m_moves.push_back(Moves("Defense Curl","Normal", 0, 100, 64, 0));
  241.  
  242.     deck.push_back(Pokemon_card("Cloyster ", "Water", "Ice",303, 303,288,458,268,238, 1));
  243.   //  deck[deck.size()-1].m_moves.push_back(Moves("Clamp","Water",35, 75, 16, 2));
  244.     deck[deck.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  245.     deck[deck.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  246.     deck[deck.size()-1].m_moves.push_back(Moves("Explosion","Normal",340, 100, 8, 2));
  247.     deck[deck.size()-1].m_moves.push_back(Moves("Double Edge", "Normal", 100, 100, 24, 2));
  248.     deck[deck.size()-1].m_moves.push_back(Moves("Rest","Psychic", 0, 100, 16, 0));
  249.     deck[deck.size()-1].m_moves.push_back(Moves("Surf", "Water", 95, 100, 24, 3));
  250.     deck[deck.size()-1].m_moves.push_back(Moves("Supersonic","Normal", 0, 55, 32, 1));
  251.     deck[deck.size()-1].m_moves.push_back(Moves("Mimic","Normal", 0, 100, 16, 1));
  252.     deck[deck.size()-1].m_moves.push_back(Moves("Substitute","Normal", 0, 100, 16, 0));
  253.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  254.  
  255.     deck.push_back(Pokemon_card("Dragonite", "Dragon", "Flying",385, 385,366,288,298,258, 1));
  256.     deck[deck.size()-1].m_moves.push_back(Moves("Agility","Psychic", 0, 100, 48, 0));
  257.    // deck[deck.size()-1].m_moves.push_back(Moves("Wrap","Normal",15, 85, 32, 2));
  258.     deck[deck.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  259.     deck[deck.size()-1].m_moves.push_back(Moves("Surf", "Water", 95, 100, 24, 3));
  260.     deck[deck.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  261.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  262.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  263.     deck[deck.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  264.     deck[deck.size()-1].m_moves.push_back(Moves("Double Edge", "Normal", 100, 100, 24, 2));
  265.  
  266.     deck.push_back(Pokemon_card("Exeggutor", "Grass", "Psychic",393, 393,288,268,348,208, 1));
  267.     deck[deck.size()-1].m_moves.push_back(Moves("Sleep Powder","Grass", 0, 75, 24, 1));
  268.     deck[deck.size()-1].m_moves.push_back(Moves("Psychic", "Psychic", 90, 100, 16, 3));
  269.     deck[deck.size()-1].m_moves.push_back(Moves("Explosion","Normal",340, 100, 8, 2));
  270.     deck[deck.size()-1].m_moves.push_back(Moves("Mega Drain","Grass",40, 100, 16, 3));
  271.     deck[deck.size()-1].m_moves.push_back(Moves("Double Edge", "Normal", 100, 100, 24, 2));
  272.     deck[deck.size()-1].m_moves.push_back(Moves("Stun Spore","Grass", 0, 75, 48, 1));
  273.     deck[deck.size()-1].m_moves.push_back(Moves("Rest","Psychic", 0, 100, 16, 0));
  274.     deck[deck.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  275.     //  deck[deck.size()-1].m_moves.push_back(Moves("Leech Seed","Grass", 0, 90, 16, 1));
  276.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  277.     deck[deck.size()-1].m_moves.push_back(Moves("Egg Bomb", "Normal", 100, 75, 16, 2));
  278.  
  279.     deck.push_back(Pokemon_card("Gengar   ", "Ghost", "Poison",323, 323,228,218,358,318, 1));
  280.     deck[deck.size()-1].m_moves.push_back(Moves("Hypnosis","Psychic", 0, 60, 32, 1));
  281.     deck[deck.size()-1].m_moves.push_back(Moves("Explosion","Normal",340, 100, 8, 2));
  282.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  283.     deck[deck.size()-1].m_moves.push_back(Moves("Mega Drain","Grass",40, 100, 16, 3));
  284.     deck[deck.size()-1].m_moves.push_back(Moves("Confuse Ray","Psychic", 0, 100, 16, 1));
  285.     deck[deck.size()-1].m_moves.push_back(Moves("Psychic", "Psychic", 90, 100, 16, 3));
  286.     deck[deck.size()-1].m_moves.push_back(Moves("Seismic Toss","Fighting", 100, 100, 32, 1));
  287.  
  288.     deck.push_back(Pokemon_card("Golem    ", "Ground", "Rock",363, 363,318,358,208,188, 1));
  289.     deck[deck.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  290.     deck[deck.size()-1].m_moves.push_back(Moves("Earthquake", "Ground", 100, 100, 16, 2));
  291.     deck[deck.size()-1].m_moves.push_back(Moves("Rock Slide", "Rock", 75, 90, 16, 2));
  292.     deck[deck.size()-1].m_moves.push_back(Moves("Explosion","Normal",340, 100, 8, 2));
  293.     deck[deck.size()-1].m_moves.push_back(Moves("Substitute","Normal", 0, 100, 16, 0));
  294.  
  295.     deck.push_back(Pokemon_card("Jynx     ", "Ice", "Psychic",333, 333,198,168,288,288, 1));
  296.     deck[deck.size()-1].m_moves.push_back(Moves("Lovely Kiss","Psychic", 0, 75, 16, 1));
  297.     deck[deck.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  298.     deck[deck.size()-1].m_moves.push_back(Moves("Psychic", "Psychic", 90, 100, 16, 3));
  299.     deck[deck.size()-1].m_moves.push_back(Moves("Mimic","Normal", 0, 100, 16, 1));
  300.     deck[deck.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  301.     deck[deck.size()-1].m_moves.push_back(Moves("Counter","Fighting", 0, 100, 32, 1));
  302.     deck[deck.size()-1].m_moves.push_back(Moves("Rest","Psychic", 0, 100, 16, 0));
  303.  
  304.     deck.push_back(Pokemon_card("Lapras   ", "Water", "Ice",463, 463,268,258,288,218, 1));
  305.     deck[deck.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  306.     deck[deck.size()-1].m_moves.push_back(Moves("Ice Beam", "Ice", 95, 100, 16, 3));
  307.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  308.     deck[deck.size()-1].m_moves.push_back(Moves("Rest","Psychic", 0, 100, 16, 0));
  309.     deck[deck.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  310.     deck[deck.size()-1].m_moves.push_back(Moves("Confuse Ray","Psychic", 0, 100, 16, 1));
  311.     deck[deck.size()-1].m_moves.push_back(Moves("Mimic","Normal", 0, 100, 16, 1));
  312.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  313.     deck[deck.size()-1].m_moves.push_back(Moves("Sing","Psychic", 0, 55, 24, 1));
  314.     deck[deck.size()-1].m_moves.push_back(Moves("Surf", "Water", 95, 100, 24, 3));
  315.  
  316.     deck.push_back(Pokemon_card("Persian  ", "Normal", "",333, 333,238,218,228,328, 1));
  317.     deck[deck.size()-1].m_moves.push_back(Moves("Slash", "Normal",140, 100, 32, 2));
  318.     deck[deck.size()-1].m_moves.push_back(Moves("BubbleBeam", "Water", 65, 100, 32, 3));
  319.     deck[deck.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  320.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  321.     deck[deck.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  322.     deck[deck.size()-1].m_moves.push_back(Moves("Screech","Psychic", 0, 85, 64, 1));
  323.     deck[deck.size()-1].m_moves.push_back(Moves("Mimic","Normal", 0, 100, 16, 1));
  324.  
  325.     deck.push_back(Pokemon_card("Rhydon  ", "Ground", "Rock",413, 413,358,338,188,178, 1));
  326.     deck[deck.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  327.     deck[deck.size()-1].m_moves.push_back(Moves("Earthquake", "Ground", 100, 100, 16, 2));
  328.     deck[deck.size()-1].m_moves.push_back(Moves("Rock Slide", "Rock", 75, 90, 16, 2));
  329.     deck[deck.size()-1].m_moves.push_back(Moves("Substitute","Normal", 0, 100, 16, 2));
  330.     deck[deck.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  331.     deck[deck.size()-1].m_moves.push_back(Moves("Rest","Psychic", 0, 100, 16, 0));
  332.  
  333.     deck.push_back(Pokemon_card("Slowbro ", "Water", "Psychic",393, 393,248,318,258,158, 1));
  334.     deck[deck.size()-1].m_moves.push_back(Moves("Amnesia","Psychic", 0, 100, 32, 0));
  335.     deck[deck.size()-1].m_moves.push_back(Moves("Surf", "Water", 95, 100, 24, 3));
  336.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  337.     deck[deck.size()-1].m_moves.push_back(Moves("Rest","Psychic", 0, 100, 16, 0));
  338.     deck[deck.size()-1].m_moves.push_back(Moves("Psychic", "Psychic", 90, 100, 16, 3));
  339.     deck[deck.size()-1].m_moves.push_back(Moves("Ice Beam", "Ice", 95, 100, 16, 3));
  340.     deck[deck.size()-1].m_moves.push_back(Moves("Withdraw","Normal", 0, 100, 64, 0));
  341.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  342.     deck[deck.size()-1].m_moves.push_back(Moves("Counter","Fighting", 0, 100, 32, 1));
  343.  
  344.     deck.push_back(Pokemon_card("Snorlax ", "Normal", "",523, 523,318,228,228,158, 1));
  345.     deck[deck.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  346.     deck[deck.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  347.     deck[deck.size()-1].m_moves.push_back(Moves("Surf", "Water", 95, 100, 24, 3));
  348.     deck[deck.size()-1].m_moves.push_back(Moves("Earthquake", "Ground", 100, 100, 16, 2));
  349.     deck[deck.size()-1].m_moves.push_back(Moves("Selfdestruct","Normal",260, 100, 8, 2));
  350.     deck[deck.size()-1].m_moves.push_back(Moves("Amnesia","Psychic", 0, 100, 32, 0));
  351.     deck[deck.size()-1].m_moves.push_back(Moves("Ice Beam", "Ice", 95, 100, 16, 3));
  352.     deck[deck.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  353.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  354.     deck[deck.size()-1].m_moves.push_back(Moves("Rest","Psychic", 0, 100, 16, 0));
  355.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  356.     deck[deck.size()-1].m_moves.push_back(Moves("Counter","Fighting", 0, 100, 32, 1));
  357.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder", "Electric", 120, 75, 16, 3));
  358.  
  359.     deck.push_back(Pokemon_card("Starmie ", "Water", "Psychic",323, 323,248,268,298,328, 1));
  360.     deck[deck.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  361.     deck[deck.size()-1].m_moves.push_back(Moves("Surf", "Water", 95, 100, 24, 3));
  362.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  363.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  364.     deck[deck.size()-1].m_moves.push_back(Moves("Recover","Normal", 0, 100, 16, 0));
  365.     deck[deck.size()-1].m_moves.push_back(Moves("Hydro Pump", "Water", 120, 80, 8, 3));
  366.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  367.     deck[deck.size()-1].m_moves.push_back(Moves("Psychic", "Psychic", 90, 100, 16, 3));
  368.     deck[deck.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  369.  
  370.     deck.push_back(Pokemon_card("Tauros  ", "Normal", "",353, 353,298,288,238,318, 1));
  371.     deck[deck.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  372.     deck[deck.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  373.     deck[deck.size()-1].m_moves.push_back(Moves("Earthquake", "Ground", 100, 100, 16, 2));
  374.     deck[deck.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  375.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  376.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder", "Electric", 120, 75, 16, 3));
  377.     deck[deck.size()-1].m_moves.push_back(Moves("Substitute","Normal", 0, 100, 16, 0));
  378.  
  379.     deck.push_back(Pokemon_card("Zapdos  ", "Electric", "Flying",383, 383,278,268,348,298, 1));
  380.     deck[deck.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  381.     deck[deck.size()-1].m_moves.push_back(Moves("Drill Peck", "Flying", 80, 100, 32, 2));
  382.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  383.     deck[deck.size()-1].m_moves.push_back(Moves("Agility","Psychic", 0, 100, 48, 0));
  384.     deck[deck.size()-1].m_moves.push_back(Moves("Thunder", "Electric", 120, 75, 16, 3));
  385.     deck[deck.size()-1].m_moves.push_back(Moves("Mimic","Normal", 0, 100, 16, 1));
  386.     // deck[deck.size()-1].m_moves.push_back(Moves("Toxic","Poison", 0, 85, 16, 1));
  387.     deck[deck.size()-1].m_moves.push_back(Moves("Rest","Psychic", 0, 100, 16, 0));
  388.     deck[deck.size()-1].m_moves.push_back(Moves("Reflect","Psychic", 0, 100, 32, 0));
  389.  
  390.  
  391.     return;
  392. }
  393.  
  394. void create_enemy_team()
  395. {
  396.     enemy_team.push_back(Pokemon_card("Tauros  ", "Normal", "",353, 353,298,288,238,318, 1));
  397.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  398.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Hyper Beam","Normal",150, 90, 8, 2));
  399.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Earthquake", "Ground", 100, 100, 16, 2));
  400.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  401.  
  402.     enemy_team.push_back(Pokemon_card("Alakazam ", "Psychic", "", 313, 313,198,188,368,338, 1));
  403.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Psychic", "Psychic", 90, 100, 16, 3));
  404.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Recover","Normal", 0, 100, 16, 0));
  405.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  406.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Seismic Toss","Fighting", 100, 100, 32, 1));
  407.  
  408.     enemy_team.push_back(Pokemon_card("Chansey  ", "Normal", "",703, 703,108,108,308,198, 1));
  409.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Ice Beam", "Ice", 95, 100, 16, 3));
  410.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Softboiled","Psychic", 0, 100, 16, 0));
  411.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  412.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  413.  
  414.     enemy_team.push_back(Pokemon_card("Golem    ", "Ground", "Rock",363, 363,318,358,208,188, 1));
  415.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Body Slam", "Normal", 85, 100, 24, 2));
  416.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Earthquake", "Ground", 100, 100, 16, 2));
  417.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Rock Slide", "Rock", 75, 90, 16, 2));
  418.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Explosion","Normal",340, 100, 8, 2));
  419.  
  420.     enemy_team.push_back(Pokemon_card("Exeggutor", "Grass", "Psychic",393, 393,288,268,348,208, 1));
  421.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Sleep Powder","Grass", 0, 75, 24, 1));
  422.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Psychic", "Psychic", 90, 100, 16, 3));
  423.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Explosion","Normal",340, 100, 8, 2));
  424.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Mega Drain","Grass",40, 100, 16, 3));
  425.  
  426.     enemy_team.push_back(Pokemon_card("Starmie ", "Water", "Psychic",323, 323,248,268,298,328, 1));
  427.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Blizzard","Ice",120, 90, 8, 3));
  428.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Thunder Wave","Electric",0, 100, 32, 1));
  429.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Thunderbolt", "Electric", 95, 100, 24, 3));
  430.     enemy_team[enemy_team.size()-1].m_moves.push_back(Moves("Recover","Normal", 0, 100, 16, 0));
  431. }
  432.  
  433. ostream&operator<<(ostream& os, const Pokemon_card& pcard)
  434. {
  435.     os << pcard.m_name << " | " << pcard.m_type1 << "/"<< pcard.m_type2;
  436.     return os;
  437. }
  438.  
  439. ostream&operator<<(ostream& os, const Moves& pmove)
  440. {
  441.     os << pmove.m_move;
  442.     return os;
  443. }
  444.  
  445. void output_deck()
  446. {
  447.     int i=0;
  448.     cout << "# Pokemon   | Types" << endl;
  449.     for (iter = deck.begin(); iter != deck.end(); iter++)
  450.     {
  451.         cout << i << " " << *iter << endl;
  452.         i++;
  453.     }
  454. }
  455. void output_moves(int input)
  456. {
  457.     int i=0;
  458.     cout << "# Move" << endl;
  459.  
  460.     for (vector<Moves>::const_iterator iter = deck[input].m_moves.begin(); iter!=deck[input].m_moves.end(); iter++)
  461.     {
  462.         cout << i << " " << *iter << endl;
  463.         i++;
  464.     }
  465.     move_choices = deck[input].m_moves.size();
  466.  
  467.  
  468.     cout << "Choose a move" << endl;
  469. }
  470. void instructions()
  471. {
  472.     cout << "POKEMON GENERATION 1 SIMULATOR" << endl;
  473.     cout << "Welcome to the pokemon battle simulator" << endl;
  474.     cout << "Here you will battle against a fearsome opponent in a pokemon battle" << endl;
  475.     cout << "First choose each member of your 6 man team and all 4 of their Moves" << endl;
  476.     cout << "After that the battle begins" << endl;
  477.     cout << "During each turn of the battle you will select your pokemon's Moves" << endl;
  478.     cout << "The goal is to be the last man standing as pokemon pummel each other" << endl;
  479.     cout << "Good luck!" << endl << endl;
  480. }
  481.  
  482. void output_party()
  483. {
  484.  
  485.  
  486.     cout << "Your final team is" << endl;
  487.  
  488.     for (int t=0; t<6; t++)
  489.     {
  490.         cout << party[t].get_name() << endl;
  491.         for (int k=0; k<4; k++)
  492.         {
  493.  
  494.             cout << "-" << party[t].m_moves[k].get_move() << endl;
  495.         }
  496.     }
  497. }
  498.  
  499. void teambuilder()
  500. {
  501.     int input=0;
  502.  
  503.     for (int ctr=0; ctr<6; ctr++)
  504.     {
  505.         output_deck();
  506.         cout << endl << "Choose a pokemon" << endl;
  507.         cin >> input;
  508.         while ((input < 0) || (input > deck.size()-1))
  509.         {
  510.             cout << "Error: enter a valid pokemon number" << endl;
  511.             cin >> input;
  512.         }
  513.         party.push_back(deck.at(input));
  514.         string choosen = deck[input].get_name();
  515.         cout << choosen << " has been added" << endl<< endl;
  516.  
  517.         for (int j=0; j<4; j++)
  518.         {
  519.             output_moves(input);
  520.             int choice;
  521.             string move_choice;
  522.             cin >> choice;
  523.             move_choices--;
  524.             while ((choice < 0) || (choice > move_choices))
  525.             {
  526.                 cout << "Error: enter a valid numbered move" << endl;
  527.                 cin >> choice;
  528.             }
  529.             party[party.size()-1].m_moves.push_back(Moves(deck[input].m_moves.at(choice)));
  530.             party[ctr].m_moves.at(j) = deck[input].m_moves.at(choice);
  531.             cout << party[ctr].m_moves[j] << " was added." << endl;
  532.             // deck.erase(Alakazam_moves.begin() + choice);
  533.  
  534.             deck[input].m_moves.erase(deck[input].m_moves.begin()+ choice);
  535.             cout << endl;
  536.         }
  537.         deck.erase(deck.begin() + input );
  538.     }
  539.     cout << endl;
  540. }
  541.  
  542. void enemy_r_switch()
  543. {
  544.     int temp=0;
  545.     temp = enemy_pokemon;
  546.  
  547.     while (temp == enemy_pokemon)
  548.     {
  549.         enemy_pokemon=rand() % enemy_team.size();
  550.     }
  551.     cout << "The enemy switch in "<< enemy_team[enemy_pokemon].get_name() << endl;
  552.     confusion=0;
  553.     evasion=1.00;
  554.     t_def=1;
  555. }
  556. void enemy_death ()
  557. {
  558.     enemy_team.erase(enemy_team.begin() + enemy_pokemon);
  559.     enemy_pokemon=rand() % enemy_team.size();
  560.     cout << "The enemy switch in "<< enemy_team[enemy_pokemon].get_name() << endl;
  561.     confusion=0;
  562.     evasion=1.00;
  563.     t_def=1;
  564. }
  565.  
  566. void player_death()
  567. {
  568.     if (mimic_choice!=-1)
  569.     {
  570.         party[player_pokemon].m_moves.at(mimic_choice) = temp_team[0].m_moves.at(0);
  571.         mimic_choice=-1;
  572.     }
  573.     party.erase(party.begin() + player_pokemon);
  574.     for (int t = 0; t<party.size(); t++)
  575.     {
  576.         cout << t << " " << party[t].get_name() << endl;
  577.     }
  578.     cout << "Choose a pokemon" << endl;
  579.     cin >> player_pokemon;
  580.     while ((player_pokemon<0) || (player_pokemon>=party.size()))
  581.     {
  582.         cout << "Enter a valid pokemon number" << endl;
  583.         cin >> player_pokemon;
  584.     }
  585.     cout << "You switch in "<< party[player_pokemon].get_name() << endl;
  586.     counter_power=0;
  587.     t_spc=1;
  588.     t_speed=1;
  589. }
  590.  
  591. void player_switch()
  592. {
  593.     if (mimic_choice!=-1)
  594.     {
  595.         party[player_pokemon].m_moves.at(mimic_choice) = temp_team[0].m_moves.at(0);
  596.         mimic_choice=-1;
  597.     }
  598.     for (int t = 0; t<party.size(); t++)
  599.     {
  600.         cout << t << " " << party[t].get_name() << endl;
  601.     }
  602.     int temp=0;
  603.     temp = player_pokemon;
  604.     while ((temp == player_pokemon)  || (player_pokemon>(party.size())) || (player_pokemon<0))
  605.     {
  606.         cout << "Choose a pokemon that is not currently on the field" << endl;
  607.         cin >> player_pokemon;
  608.     }
  609.     cout << "You switched in "<< party[player_pokemon].get_name() << endl;
  610.     counter_power=0;
  611.     t_spc=1;
  612.     t_speed=1;
  613. }
  614.  
  615. void your_battlecode()
  616. {
  617.     int accuracy;
  618.     int C=1;
  619.     float M=1;
  620.     float super=1;
  621.     int para_chance;
  622.     para_chance = rand() % 4;
  623.     int critical_hit=0;
  624.     int crit_rand;
  625.     crit_rand=rand() % 100;
  626.     if ((crit_rand) < (floor(ceil(((party[player_pokemon].get_speed()-5)/2)-47)*100 / 512)))
  627.     {
  628.         critical_hit=1;
  629.     }
  630.  
  631.     if ((your_switch != 1) && (recharge==0))
  632.     {
  633.         if (party[player_pokemon].get_health()>=20)
  634.         {
  635.             cout << party[player_pokemon].get_name() << " is fast asleep"  << endl;
  636.             if (party[player_pokemon].get_health()==20)
  637.             {
  638.                 cout << party[player_pokemon].get_name() << " woke up"  << endl;
  639.                 party[player_pokemon].m_health = 1;
  640.             }
  641.         }
  642.         else if ((para_chance==2) && (party[player_pokemon].get_health()==2))
  643.         {
  644.             cout << party[player_pokemon].get_name() << " is paralized!"   << endl;
  645.         }
  646.         else
  647.         {
  648.             cout << party[player_pokemon].get_name() << " used " << party[player_pokemon].m_moves[your_choice].get_move() << endl;
  649.             accuracy = rand() % 100;
  650.             if(accuracy< party[player_pokemon].m_moves[your_choice].get_acr())
  651.             {
  652.  
  653.                 if ((party[player_pokemon].get_type1()  == party[player_pokemon].m_moves[your_choice].get_move_type()) || (party[player_pokemon].get_type2()  == party[player_pokemon].m_moves[your_choice].get_move_type()))
  654.                 {
  655.                     M *= 1.50;
  656.                 }
  657.  
  658.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Psychic")
  659.                 {
  660.                     if ((enemy_team[enemy_pokemon].get_type1() == "Psychic") || (enemy_team[enemy_pokemon].get_type2() == "Psychic"))
  661.                     {
  662.                         super /= 2.00;
  663.                     }
  664.                     if ((enemy_team[enemy_pokemon].get_type1() == "Fighting") || (enemy_team[enemy_pokemon].get_type2() == "Fighting"))
  665.                     {
  666.                         super *= 2.00;
  667.                     }
  668.                     if ((enemy_team[enemy_pokemon].get_type1() == "Poison") || (enemy_team[enemy_pokemon].get_type2() == "Poison"))
  669.                     {
  670.                         super *= 2.00;
  671.                     }
  672.  
  673.                 }
  674.  
  675.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Water")
  676.                 {
  677.                     if ((enemy_team[enemy_pokemon].get_type1() == "Ground") || (enemy_team[enemy_pokemon].get_type2() == "Ground"))
  678.                     {
  679.                         super *= 2.00;
  680.                     }
  681.                     if ((enemy_team[enemy_pokemon].get_type1() == "Rock") || (enemy_team[enemy_pokemon].get_type2() == "Rock"))
  682.                     {
  683.                         super *= 2.00;
  684.                     }
  685.                     if ((enemy_team[enemy_pokemon].get_type1() == "Water") || (enemy_team[enemy_pokemon].get_type2() == "Water"))
  686.                     {
  687.                         super /= 2.00;
  688.                     }
  689.                     if ((enemy_team[enemy_pokemon].get_type1() == "Grass") || (enemy_team[enemy_pokemon].get_type2() == "Grass"))
  690.                     {
  691.                         super /= 2.00;
  692.                     }
  693.                     if ((enemy_team[enemy_pokemon].get_type1() == "Dragon") || (enemy_team[enemy_pokemon].get_type2() == "Dragon"))
  694.                     {
  695.                         super /= 2.00;
  696.                     }
  697.                     if ((enemy_team[enemy_pokemon].get_type1() == "Fire") || (enemy_team[enemy_pokemon].get_type2() == "Fire"))
  698.                     {
  699.                         super *= 2.00;
  700.                     }
  701.                 }
  702.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Grass")
  703.                 {
  704.                     if ((enemy_team[enemy_pokemon].get_type1() == "Grass") || (enemy_team[enemy_pokemon].get_type2() == "Grass"))
  705.                     {
  706.                         super /= 2.00;
  707.                     }
  708.                     if ((enemy_team[enemy_pokemon].get_type1() == "Water") || (enemy_team[enemy_pokemon].get_type2() == "Water"))
  709.                     {
  710.                         super *= 2.00;
  711.                     }
  712.                     if ((enemy_team[enemy_pokemon].get_type1() == "Grass") || (enemy_team[enemy_pokemon].get_type2() == "Grass"))
  713.                     {
  714.                         super /= 2.00;
  715.                     }
  716.                     if ((enemy_team[enemy_pokemon].get_type1() == "Flying") || (enemy_team[enemy_pokemon].get_type2() == "Flying"))
  717.                     {
  718.                         super /= 2.00;
  719.                     }
  720.                     if ((enemy_team[enemy_pokemon].get_type1() == "Rock") || (enemy_team[enemy_pokemon].get_type2() == "Rock"))
  721.                     {
  722.                         super *= 2.00;
  723.                     }
  724.                     if ((enemy_team[enemy_pokemon].get_type1() == "Ground") || (enemy_team[enemy_pokemon].get_type2() == "Ground"))
  725.                     {
  726.                         super *= 2.00;
  727.                     }
  728.                     if ((enemy_team[enemy_pokemon].get_type1() == "Poison") || (enemy_team[enemy_pokemon].get_type2() == "Poison"))
  729.                     {
  730.                         super /= 2.00;
  731.                     }
  732.                     if ((enemy_team[enemy_pokemon].get_type1() == "Dragon") || (enemy_team[enemy_pokemon].get_type2() == "Dragon"))
  733.                     {
  734.                         super /= 2.00;
  735.                     }
  736.                 }
  737.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Electric")
  738.                 {
  739.                     if ((enemy_team[enemy_pokemon].get_type1() == "Dragon") || (enemy_team[enemy_pokemon].get_type2() == "Dragon"))
  740.                     {
  741.                         super /= 2.00;
  742.                     }
  743.                     if ((enemy_team[enemy_pokemon].get_type1() == "Grass") || (enemy_team[enemy_pokemon].get_type2() == "Grass"))
  744.                     {
  745.                         super /= 2.00;
  746.                     }
  747.                     if ((enemy_team[enemy_pokemon].get_type1() == "Water") || (enemy_team[enemy_pokemon].get_type2() == "Water"))
  748.                     {
  749.                         super *= 2.00;
  750.                     }
  751.                     if ((enemy_team[enemy_pokemon].get_type1() == "Electric") || (enemy_team[enemy_pokemon].get_type2() == "Electric"))
  752.                     {
  753.                         super /= 2.00;
  754.                     }
  755.                     if ((enemy_team[enemy_pokemon].get_type1() == "Flying") || (enemy_team[enemy_pokemon].get_type2() == "Flying"))
  756.                     {
  757.                         super /= 2.00;
  758.                     }
  759.                     if ((enemy_team[enemy_pokemon].get_type1() == "Ground") || (enemy_team[enemy_pokemon].get_type2() == "Ground"))
  760.                     {
  761.                         super *= 0;
  762.                     }
  763.                 }
  764.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Ice")
  765.                 {
  766.                     if ((enemy_team[enemy_pokemon].get_type1() == "Water") || (enemy_team[enemy_pokemon].get_type2() == "Water"))
  767.                     {
  768.                         super /= 2.00;
  769.                     }
  770.                     if ((enemy_team[enemy_pokemon].get_type1() == "Grass") || (enemy_team[enemy_pokemon].get_type2() == "Grass"))
  771.                     {
  772.                         super *= 2.00;
  773.                     }
  774.                     if ((enemy_team[enemy_pokemon].get_type1() == "Ice") || (enemy_team[enemy_pokemon].get_type2() == "Ice"))
  775.                     {
  776.                         super /= 2.00;
  777.                     }
  778.                     if ((enemy_team[enemy_pokemon].get_type1() == "Flying") || (enemy_team[enemy_pokemon].get_type2() == "Flying"))
  779.                     {
  780.                         super *= 2.00;
  781.                     }
  782.                     if ((enemy_team[enemy_pokemon].get_type1() == "Ground") || (enemy_team[enemy_pokemon].get_type2() == "Ground"))
  783.                     {
  784.                         super *= 2.00;
  785.                     }
  786.                     if ((enemy_team[enemy_pokemon].get_type1() == "Dragon") || (enemy_team[enemy_pokemon].get_type2() == "Dragon"))
  787.                     {
  788.                         super /= 2.00;
  789.                     }
  790.                 }
  791.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Normal")
  792.                 {
  793.                     if ((enemy_team[enemy_pokemon].get_type1() == "Rock") || (enemy_team[enemy_pokemon].get_type2() == "Rock"))
  794.                     {
  795.                         super /= 2.00;
  796.                     }
  797.                     if ((enemy_team[enemy_pokemon].get_type1() == "Ghost") || (enemy_team[enemy_pokemon].get_type2() == "Ghost"))
  798.                     {
  799.                         super *= 0;
  800.                     }
  801.                 }
  802.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Flying")
  803.                 {
  804.                     if ((enemy_team[enemy_pokemon].get_type1() == "Rock") || (enemy_team[enemy_pokemon].get_type2() == "Rock"))
  805.                     {
  806.                         super /= 2.00;
  807.                     }
  808.                     if ((enemy_team[enemy_pokemon].get_type1() == "Electric") || (enemy_team[enemy_pokemon].get_type2() == "Electric"))
  809.                     {
  810.                         super /= 2.00;
  811.                     }
  812.                     if ((enemy_team[enemy_pokemon].get_type1() == "Grass") || (enemy_team[enemy_pokemon].get_type2() == "Grass"))
  813.                     {
  814.                         super *= 2.00;
  815.                     }
  816.                     if ((enemy_team[enemy_pokemon].get_type1() == "Fighting") || (enemy_team[enemy_pokemon].get_type2() == "Fighting"))
  817.                     {
  818.                         super *= 2.00;
  819.                     }
  820.                 }
  821.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Ground")
  822.                 {
  823.                     if ((enemy_team[enemy_pokemon].get_type1() == "Fire") || (enemy_team[enemy_pokemon].get_type2() == "Fire"))
  824.                     {
  825.                         super *= 2.00;
  826.                     }
  827.                     if ((enemy_team[enemy_pokemon].get_type1() == "Electric") || (enemy_team[enemy_pokemon].get_type2() == "Electric"))
  828.                     {
  829.                         super *= 2.00;
  830.                     }
  831.                     if ((enemy_team[enemy_pokemon].get_type1() == "Rock") || (enemy_team[enemy_pokemon].get_type2() == "Rock"))
  832.                     {
  833.                         super *= 2.00;
  834.                     }
  835.                     if ((enemy_team[enemy_pokemon].get_type1() == "Poison") || (enemy_team[enemy_pokemon].get_type2() == "Poison"))
  836.                     {
  837.                         super *= 2.00;
  838.                     }
  839.                     if ((enemy_team[enemy_pokemon].get_type1() == "Grass") || (enemy_team[enemy_pokemon].get_type2() == "Grass"))
  840.                     {
  841.                         super /= 2.00;
  842.                     }
  843.                     if ((enemy_team[enemy_pokemon].get_type1() == "Flying") || (enemy_team[enemy_pokemon].get_type2() == "Flying"))
  844.                     {
  845.                         super *= 0;
  846.                     }
  847.                 }
  848.                 if (party[player_pokemon].m_moves[your_choice].get_move_type()== "Rock")
  849.                 {
  850.                     if ((enemy_team[enemy_pokemon].get_type1() == "Fire") || (enemy_team[enemy_pokemon].get_type2() == "Fire"))
  851.                     {
  852.                         super *= 2.00;
  853.                     }
  854.                     if ((enemy_team[enemy_pokemon].get_type1() == "Ice") || (enemy_team[enemy_pokemon].get_type2() == "Ice"))
  855.                     {
  856.                         super *= 2.00;
  857.                     }
  858.                     if ((enemy_team[enemy_pokemon].get_type1() == "Flying") || (enemy_team[enemy_pokemon].get_type2() == "Flying"))
  859.                     {
  860.                         super *= 2.00;
  861.                     }
  862.                     if ((enemy_team[enemy_pokemon].get_type1() == "Fighting") || (enemy_team[enemy_pokemon].get_type2() == "Fighting"))
  863.                     {
  864.                         super /= 2.00;
  865.                     }
  866.                     if ((enemy_team[enemy_pokemon].get_type1() == "Ground") || (enemy_team[enemy_pokemon].get_type2() == "Ground"))
  867.                     {
  868.                         super /= 2.00;
  869.                     }
  870.                 }
  871.                 switch (party[player_pokemon].m_moves[your_choice].get_cat())
  872.                 {
  873.                 case 0:
  874.                     if ((party[player_pokemon].m_moves[your_choice].get_move()=="Softboiled") || (party[player_pokemon].m_moves[your_choice].get_move()=="Recover"))
  875.                     {
  876.                         party[player_pokemon].m_hp += (party[player_pokemon].get_max_hp() / 2);
  877.                         if (party[player_pokemon].get_max_hp() < party[player_pokemon].get_hp())
  878.                         {
  879.                             party[player_pokemon].m_hp = party[player_pokemon].get_max_hp();
  880.                         }
  881.                         cout << "It restored HP" << endl;
  882.                     }
  883.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Reflect"))
  884.                     {
  885.  
  886.                         if (reflect_ctr<=0)
  887.                         {
  888.                             reflect = 2.00;
  889.                             reflect_ctr=4;
  890.                         }
  891.                         cout << "A psychic layer was put up" << endl;
  892.                     }
  893.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Rest"))
  894.                     {
  895.                         if (party[player_pokemon].m_health == 2)
  896.                         {
  897.                             party[player_pokemon].m_speed *= 2;
  898.                         }
  899.                         party[player_pokemon].m_health=22;
  900.                         party[player_pokemon].m_hp = party[player_pokemon].get_max_hp();
  901.                         cout << party[player_pokemon].get_name() << " fell asleep and restored HP" << endl;
  902.                     }
  903.  
  904.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Agility"))
  905.                     {
  906.                         t_speed+=1;
  907.                         cout << party[player_pokemon].get_name() << "'s speed sharply rose" << endl;
  908.                     }
  909.  
  910.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Amnesia") && t_spc<4)
  911.                     {
  912.                         t_spc+=1;
  913.                         cout << party[player_pokemon].get_name() << "'s special sharply rose" << endl;
  914.                     }
  915.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Substitute") && (substitute<=0) && ((party[player_pokemon].get_max_hp() / 4) < party[player_pokemon].get_hp()))
  916.                     {
  917.                         party[player_pokemon].m_hp -= (party[player_pokemon].get_max_hp() / 4);
  918.                         substitute = (party[player_pokemon].get_max_hp() / 4);
  919.                         cout << party[player_pokemon].get_name() << " set up a substitute" << endl;
  920.                     }
  921.                     else
  922.                     {
  923.                         cout << "but it failed!" << endl;
  924.                     }
  925.  
  926.                     break;
  927.  
  928.                 case 1:
  929.                     if ((party[player_pokemon].m_moves[your_choice].get_move()=="Stun Spore") && (enemy_team[enemy_pokemon].get_health() == 1))
  930.                     {
  931.                         enemy_team[enemy_pokemon].m_health = 2;
  932.                         enemy_team[enemy_pokemon].m_speed /= 2;
  933.                         cout << enemy_team[enemy_pokemon].get_name() << " was paralyzed" << endl;
  934.                     }
  935.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Thunder Wave")  && (enemy_team[enemy_pokemon].get_health() == 1) && (enemy_team[enemy_pokemon].get_type1() != "Ground")  && (enemy_team[enemy_pokemon].get_type2() != "Ground"))
  936.                         {
  937.                             enemy_team[enemy_pokemon].m_health = 2;
  938.                         enemy_team[enemy_pokemon].m_speed /= 2;
  939.                         cout << enemy_team[enemy_pokemon].get_name() << " was paralyzed" << endl;
  940.                         }
  941.                     else if (((party[player_pokemon].m_moves[your_choice].get_move()=="Sleep Powder") || (party[player_pokemon].m_moves[your_choice].get_move()=="Hypnosis") ||
  942.                               (party[player_pokemon].m_moves[your_choice].get_move()=="Sing") || (party[player_pokemon].m_moves[your_choice].get_move()=="Lovely Kiss")) && (enemy_team[enemy_pokemon].get_health() == 1))
  943.                     {
  944.                         enemy_team[enemy_pokemon].m_health = (rand() % 6 + 21);
  945.                         cout << enemy_team[enemy_pokemon].get_name() << " fell asleep" << endl;
  946.                     }
  947.                     else if (party[player_pokemon].m_moves[your_choice].get_move()=="Seismic Toss")
  948.                     {
  949.                         enemy_team[enemy_pokemon].m_hp -= 100;
  950.                         cout << enemy_team[enemy_pokemon].get_name() << " lost 100 HP" << endl;
  951.                     }
  952.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Flash") || (party[player_pokemon].m_moves[your_choice].get_move()=="Kinesis"))
  953.                     {
  954.                         if (evasion != .131687)
  955.                         {
  956.                             evasion *= (2.00/3.00);
  957.                             cout << enemy_team[enemy_pokemon].get_name() << " lost accuracy" << endl;
  958.                         }
  959.                         else
  960.                         {
  961.                             cout << "but it failed!" << endl;
  962.                         }
  963.                     }
  964.                     else if (((party[player_pokemon].m_moves[your_choice].get_move()=="Supersonic") || (party[player_pokemon].m_moves[your_choice].get_move()=="Confuse Ray")))
  965.                     {
  966.                         confusion=1;
  967.                         confusion_ctr= (rand() % 4) +1;
  968.                         cout << enemy_team[enemy_pokemon].get_name() << " is confused!" << endl;
  969.                     }
  970.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Counter"))
  971.                     {
  972.                     }
  973.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Mimic"))
  974.                     {
  975.                         temp_team[0].m_moves.at(0) = party[player_pokemon].m_moves.at(your_choice);
  976.                         party[player_pokemon].m_moves.at(your_choice) = enemy_team[enemy_pokemon].m_moves.at(rand() % 4);
  977.                         mimic_choice=your_choice;
  978.                         cout << enemy_team[enemy_pokemon].get_name() << " copied " << party[player_pokemon].m_moves.at(your_choice) << endl;
  979.                     }
  980.                     else if ((party[player_pokemon].m_moves[your_choice].get_move()=="Screech") && (t_def != 3))
  981.                     {
  982.                         t_def += 1.00;
  983.                         cout << enemy_team[enemy_pokemon].get_name() << "'s defense sharply lowered" << endl;
  984.                     }
  985.                     else
  986.                     {
  987.                         cout << "But it failed" << endl;
  988.                     }
  989.                     break;
  990.  
  991.                 case 2:
  992.  
  993.                     if ((critical_hit==1) || (party[player_pokemon].m_moves[your_choice].get_move()=="Slash"))
  994.                     {
  995.                         enemy_team[enemy_pokemon].m_hp -= floor((floor(floor(floor(42.0*party[player_pokemon].get_atk()*party[player_pokemon].m_moves[your_choice].get_power())/enemy_team[enemy_pokemon].get_def())/50)+2)*M*super*2.00*((rand() % 39) + 217)/255.0);
  996.                         cout << "It was a critical hit!" << endl;
  997.                     }
  998.                     else
  999.                     {
  1000.                     enemy_team[enemy_pokemon].m_hp -= floor((floor(floor(floor(42.0*party[player_pokemon].get_atk()*party[player_pokemon].m_moves[your_choice].get_power())/enemy_team[enemy_pokemon].get_def())/50)+2)*M*super*t_def*((rand() % 39) + 217)/255.0);
  1001.                     }//enemy_team[enemy_pokemon].m_hp -= floor((floor(floor(floor(42.0*party[player_pokemon].get_spc()*party[player_pokemon].m_moves[your_choice].get_power())/enemy_team[enemy_pokemon].get_spc())/50)+2)*M*super*t_spc*((rand() % 39) + 217)/255.0);
  1002.                     if ((party[player_pokemon].m_moves[your_choice].get_move()=="Hyper Beam") && (enemy_team[enemy_pokemon].get_hp() >= 0))
  1003.                     {
  1004.                         cout << party[player_pokemon].get_name() << " needs to recharge" << endl;
  1005.                         recharge = 3;
  1006.                     }
  1007.  
  1008.                     if (super == 1)
  1009.                     {
  1010.                         cout << "Its normally effective!" << endl;
  1011.                     }
  1012.                     else if (super > 1)
  1013.                     {
  1014.                         cout << "Its super effective!" << endl;
  1015.                     }
  1016.                     else if (super == 0)
  1017.                     {
  1018.                         cout << "It didn't do anything" << endl;
  1019.                     }
  1020.                     else
  1021.                     {
  1022.                         cout << "Its not very effective!" << endl;
  1023.                     }
  1024.  
  1025.                     break;
  1026.  
  1027.                 case 3:
  1028.                     if (critical_hit==1)
  1029.                     {
  1030.                       enemy_team[enemy_pokemon].m_hp -=floor((floor(floor(floor(42.0*party[player_pokemon].get_spc()*party[player_pokemon].m_moves[your_choice].get_power())/enemy_team[enemy_pokemon].get_spc())/50)+2)*M*super*2*((rand() % 39) + 217)/255.0);
  1031.                     cout << "It was a critical hit!" << endl;
  1032.                     }
  1033.                     else
  1034.                     {
  1035.                     enemy_team[enemy_pokemon].m_hp -=floor((floor(floor(floor(42.0*party[player_pokemon].get_spc()*party[player_pokemon].m_moves[your_choice].get_power())/enemy_team[enemy_pokemon].get_spc())/50)+2)*M*super*t_spc*((rand() % 39) + 217)/255.0);
  1036.                     }
  1037.  
  1038.  
  1039.                     if (super == 1)
  1040.                     {
  1041.                         cout << "Its normally effective!" << endl;
  1042.                     }
  1043.                     else if (super > 1)
  1044.                     {
  1045.                         cout << "Its super effective!" << endl;
  1046.                     }
  1047.                     else if (super == 0)
  1048.                     {
  1049.                         cout << "It didn't do anything" << endl;
  1050.                     }
  1051.                     else
  1052.                     {
  1053.                         cout << "Its not very effective!" << endl;
  1054.                     }
  1055.  
  1056.  
  1057.                     break;
  1058.                 default:
  1059.                     cout << "But it failed!" << endl;
  1060.                 }
  1061.             }
  1062.             else
  1063.             {
  1064.                 cout << "But it missed!" << endl;
  1065.             }
  1066.         }
  1067.     }
  1068.     if (party[player_pokemon].get_health()>20)
  1069.     {
  1070.         party[player_pokemon].m_health--;
  1071.     }
  1072. }
  1073.  
  1074.  
  1075.  
  1076.  
  1077. void enemy_battlecode()
  1078. {
  1079.     float M=1.0;
  1080.     int accuracy;
  1081.     int para_chance;
  1082.     para_chance = rand() % 4;
  1083.     int confusion_chance = rand() % 2;
  1084.     float super=1.00;
  1085.     int critical_hit=0;
  1086.  
  1087.     if ((rand() % 100) < (floor(ceil(((enemy_team[enemy_pokemon].get_speed()-5)/2)-47)*100 / 512)))
  1088.     {
  1089.         critical_hit=1;
  1090.     }
  1091.  
  1092.  
  1093.     if ((enemy_switch !=1) && (enemy_recharge==0))
  1094.     {
  1095.         if (enemy_team[enemy_pokemon].get_health()>=20)
  1096.         {
  1097.             cout << enemy_team[enemy_pokemon].get_name() << " is fast asleep"  << endl;
  1098.             if (enemy_team[enemy_pokemon].get_health()==20)
  1099.             {
  1100.                 cout << enemy_team[enemy_pokemon].get_name() << " woke up"  << endl;
  1101.                 enemy_team[enemy_pokemon].m_health = 1;
  1102.             }
  1103.         }
  1104.         else
  1105.         {
  1106.             if (confusion==1)
  1107.             {
  1108.                 cout << enemy_team[enemy_pokemon].get_name() << " is confused!" << endl;
  1109.  
  1110.                 confusion_ctr--;
  1111.                 if (confusion_ctr==0)
  1112.                 {
  1113.                     confusion=0;
  1114.                     cout << enemy_team[enemy_pokemon].get_name() << " snapped out of confusion" << endl;
  1115.                 }
  1116.             }
  1117.             if ((confusion==1) && (confusion_chance == 1))
  1118.             {
  1119.                 enemy_team[enemy_pokemon].m_hp -=floor((floor(floor(floor(42.0*enemy_team[enemy_pokemon].get_atk()*40)/party[player_pokemon].get_def())/50)+2)*((rand() % 39) + 217)/255.0);
  1120.                 cout << enemy_team[enemy_pokemon].get_name() << " hurt itself in confustion!" << endl;
  1121.             }
  1122.             else if ((enemy_team[enemy_pokemon].get_health()==2) && (para_chance==0))
  1123.             {
  1124.                 cout << enemy_team[enemy_pokemon].get_name() << " is paralized, it was unable to move!" << endl;
  1125.             }
  1126.             else
  1127.             {
  1128.                 cout << enemy_team[enemy_pokemon].get_name() << " used " << enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move() << endl;
  1129.                 accuracy = rand() % 100;
  1130.                 if(accuracy<(enemy_team[enemy_pokemon].m_moves[enemy_choice].get_acr() * evasion))
  1131.                 {
  1132.  
  1133.                     if ((enemy_team[enemy_pokemon].get_type1()  == enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()) || (enemy_team[enemy_pokemon].get_type2()  == enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()))
  1134.                     {
  1135.                         M = 1.5;
  1136.                     }
  1137.  
  1138.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Psychic")
  1139.                     {
  1140.                         if ((party[player_pokemon].get_type1() == "Psychic") || (party[player_pokemon].get_type2() == "Psychic"))
  1141.                         {
  1142.                             super /= 2.00;
  1143.                         }
  1144.                         if ((party[player_pokemon].get_type1() == "Fighting") || (party[player_pokemon].get_type2() == "Fighting"))
  1145.                         {
  1146.                             super *= 2.00;
  1147.                         }
  1148.                         if ((party[player_pokemon].get_type1() == "Poison") || (party[player_pokemon].get_type2() == "Poison"))
  1149.                         {
  1150.                             super *= 2.00;
  1151.                         }
  1152.                     }
  1153.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Water")
  1154.                     {
  1155.                         if ((party[player_pokemon].get_type1() == "Ground") || (party[player_pokemon].get_type2() == "Ground"))
  1156.                         {
  1157.                             super *= 2.00;
  1158.                         }
  1159.                         if ((party[player_pokemon].get_type1() == "Rock") || (party[player_pokemon].get_type2() == "Rock"))
  1160.                         {
  1161.                             super *= 2.00;
  1162.                         }
  1163.                         if ((party[player_pokemon].get_type1() == "Water") || (party[player_pokemon].get_type2() == "Water"))
  1164.                         {
  1165.                             super /= 2.00;
  1166.                         }
  1167.                         if ((party[player_pokemon].get_type1() == "Grass") || (party[player_pokemon].get_type2() == "Grass"))
  1168.                         {
  1169.                             super /= 2.00;
  1170.                         }
  1171.                         if ((party[player_pokemon].get_type1() == "Dragon") || (party[player_pokemon].get_type2() == "Dragon"))
  1172.                         {
  1173.                             super /= 2.00;
  1174.                         }
  1175.                         if ((party[player_pokemon].get_type1() == "Fire") || (party[player_pokemon].get_type2() == "Fire"))
  1176.                         {
  1177.                             super *= 2.00;
  1178.                         }
  1179.                     }
  1180.  
  1181.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Grass")
  1182.                     {
  1183.                         if ((party[player_pokemon].get_type1() == "Grass") || (party[player_pokemon].get_type2() == "Grass"))
  1184.                         {
  1185.                             super /= 2.00;
  1186.                         }
  1187.                         if ((party[player_pokemon].get_type1() == "Water") || (party[player_pokemon].get_type2() == "Water"))
  1188.                         {
  1189.                             super *= 2.00;
  1190.                         }
  1191.                         if ((party[player_pokemon].get_type1() == "Grass") || (party[player_pokemon].get_type2() == "Grass"))
  1192.                         {
  1193.                             super /= 2.00;
  1194.                         }
  1195.                         if ((party[player_pokemon].get_type1() == "Flying") || (party[player_pokemon].get_type2() == "Flying"))
  1196.                         {
  1197.                             super /= 2.00;
  1198.                         }
  1199.                         if ((party[player_pokemon].get_type1() == "Rock") || (party[player_pokemon].get_type2() == "Rock"))
  1200.                         {
  1201.                             super *= 2.00;
  1202.                         }
  1203.                         if ((party[player_pokemon].get_type1() == "Ground") || (party[player_pokemon].get_type2() == "Ground"))
  1204.                         {
  1205.                             super *= 2.00;
  1206.                         }
  1207.                         if ((party[player_pokemon].get_type1() == "Poison") || (party[player_pokemon].get_type2() == "Poison"))
  1208.                         {
  1209.                             super /= 2.00;
  1210.                         }
  1211.                         if ((party[player_pokemon].get_type1() == "Dragon") || (party[player_pokemon].get_type2() == "Dragon"))
  1212.                         {
  1213.                             super /= 2.00;
  1214.                         }
  1215.                     }
  1216.  
  1217.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Electric")
  1218.                     {
  1219.                         if ((party[player_pokemon].get_type1() == "Dragon") || (party[player_pokemon].get_type2() == "Dragon"))
  1220.                         {
  1221.                             super /= 2.00;
  1222.                         }
  1223.                         if ((party[player_pokemon].get_type1() == "Grass") || (party[player_pokemon].get_type2() == "Grass"))
  1224.                         {
  1225.                             super /= 2.00;
  1226.                         }
  1227.                         if ((party[player_pokemon].get_type1() == "Water") || (party[player_pokemon].get_type2() == "Water"))
  1228.                         {
  1229.                             super *= 2.00;
  1230.                         }
  1231.                         if ((party[player_pokemon].get_type1() == "Electric") || (party[player_pokemon].get_type2() == "Electric"))
  1232.                         {
  1233.                             super /= 2.00;
  1234.                         }
  1235.                         if ((party[player_pokemon].get_type1() == "Flying") || (party[player_pokemon].get_type2() == "Flying"))
  1236.                         {
  1237.                             super /= 2.00;
  1238.                         }
  1239.                         if ((party[player_pokemon].get_type1() == "Ground") || (party[player_pokemon].get_type2() == "Ground"))
  1240.                         {
  1241.                             super *= 0;
  1242.                         }
  1243.                     }
  1244.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Ice")
  1245.                     {
  1246.                         if ((party[player_pokemon].get_type1() == "Water") || (party[player_pokemon].get_type2() == "Water"))
  1247.                         {
  1248.                             super /= 2.00;
  1249.                         }
  1250.                         if ((party[player_pokemon].get_type1() == "Grass") || (party[player_pokemon].get_type2() == "Grass"))
  1251.                         {
  1252.                             super *= 2.00;
  1253.                         }
  1254.                         if ((party[player_pokemon].get_type1() == "Ice") || (party[player_pokemon].get_type2() == "Ice"))
  1255.                         {
  1256.                             super /= 2.00;
  1257.                         }
  1258.                         if ((party[player_pokemon].get_type1() == "Flying") || (party[player_pokemon].get_type2() == "Flying"))
  1259.                         {
  1260.                             super *= 2.00;
  1261.                         }
  1262.                         if ((party[player_pokemon].get_type1() == "Ground") || (party[player_pokemon].get_type2() == "Ground"))
  1263.                         {
  1264.                             super *= 2.00;
  1265.                         }
  1266.                         if ((party[player_pokemon].get_type1() == "Dragon") || (party[player_pokemon].get_type2() == "Dragon"))
  1267.                         {
  1268.                             super *= 2.00;
  1269.                         }
  1270.                     }
  1271.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Normal")
  1272.                     {
  1273.                         if ((party[player_pokemon].get_type1() == "Rock") || (party[player_pokemon].get_type2() == "Rock"))
  1274.                         {
  1275.                             super /= 2.00;
  1276.                         }
  1277.                         if ((party[player_pokemon].get_type1() == "Ghost") || (party[player_pokemon].get_type2() == "Ghost"))
  1278.                         {
  1279.                             super *= 0;
  1280.                         }
  1281.                     }
  1282.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Flying")
  1283.                     {
  1284.                         if ((party[player_pokemon].get_type1() == "Rock") || (party[player_pokemon].get_type2() == "Rock"))
  1285.                         {
  1286.                             super /= 2.00;
  1287.                         }
  1288.                         if ((party[player_pokemon].get_type1() == "Electric") || (party[player_pokemon].get_type2() == "Electric"))
  1289.                         {
  1290.                             super /= 2.00;
  1291.                         }
  1292.                         if ((party[player_pokemon].get_type1() == "Grass") || (party[player_pokemon].get_type2() == "Grass"))
  1293.                         {
  1294.                             super *= 2.00;
  1295.                         }
  1296.                         if ((party[player_pokemon].get_type1() == "Fighting") || (party[player_pokemon].get_type2() == "Fighting"))
  1297.                         {
  1298.                             super *= 2.00;
  1299.                         }
  1300.                     }
  1301.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Ground")
  1302.                     {
  1303.                         if ((party[player_pokemon].get_type1() == "Fire") || (party[player_pokemon].get_type2() == "Fire"))
  1304.                         {
  1305.                             super *= 2.00;
  1306.                         }
  1307.                         if ((party[player_pokemon].get_type1() == "Electric") || (party[player_pokemon].get_type2() == "Electric"))
  1308.                         {
  1309.                             super *= 2.00;
  1310.                         }
  1311.                         if ((party[player_pokemon].get_type1() == "Rock") || (party[player_pokemon].get_type2() == "Rock"))
  1312.                         {
  1313.                             super *= 2.00;
  1314.                         }
  1315.                         if ((party[player_pokemon].get_type1() == "Poison") || (party[player_pokemon].get_type2() == "Poison"))
  1316.                         {
  1317.                             super *= 2.00;
  1318.                         }
  1319.                         if ((party[player_pokemon].get_type1() == "Grass") || (party[player_pokemon].get_type2() == "Grass"))
  1320.                         {
  1321.                             super /= 2.00;
  1322.                         }
  1323.                         if ((party[player_pokemon].get_type1() == "Flying") || (party[player_pokemon].get_type2() == "Flying"))
  1324.                         {
  1325.                             super *= 0;
  1326.                         }
  1327.                     }
  1328.                     if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move_type()== "Rock")
  1329.                     {
  1330.                         if ((party[player_pokemon].get_type1() == "Fire") || (party[player_pokemon].get_type2() == "Fire"))
  1331.                         {
  1332.                             super *= 2.00;
  1333.                         }
  1334.                         if ((party[player_pokemon].get_type1() == "Ice") || (party[player_pokemon].get_type2() == "Ice"))
  1335.                         {
  1336.                             super *= 2.00;
  1337.                         }
  1338.                         if ((party[player_pokemon].get_type1() == "Flying") || (party[player_pokemon].get_type2() == "Flying"))
  1339.                         {
  1340.                             super *= 2.00;
  1341.                         }
  1342.                         if ((party[player_pokemon].get_type1() == "Fighting") || (party[player_pokemon].get_type2() == "Fighting"))
  1343.                         {
  1344.                             super /= 2.00;
  1345.                         }
  1346.                         if ((party[player_pokemon].get_type1() == "Ground") || (party[player_pokemon].get_type2() == "Ground"))
  1347.                         {
  1348.                             super /= 2.00;
  1349.                         }
  1350.                     }
  1351.  
  1352.                     switch (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_cat())
  1353.                     {
  1354.  
  1355.                     case 0:
  1356.                         if ((enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Softboiled") || (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Recover"))
  1357.                     {
  1358.                         enemy_team[enemy_pokemon].m_hp += (enemy_team[enemy_pokemon].get_max_hp() / 2);
  1359.                         if (enemy_team[enemy_pokemon].get_max_hp() < enemy_team[enemy_pokemon].get_hp())
  1360.                         {
  1361.                             enemy_team[enemy_pokemon].m_hp = enemy_team[enemy_pokemon].get_max_hp();
  1362.                         }
  1363.                         cout << "It restored HP" << endl;
  1364.                     }
  1365.                     else
  1366.                     {
  1367.                         cout << "but it failed!" << endl;
  1368.                     }
  1369.  
  1370.                         break;
  1371.  
  1372.                     case 1:
  1373.                         if (((enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Stun Spore")) && (party[player_pokemon].get_health() == 1))
  1374.                         {
  1375.                             party[player_pokemon].m_health = 2;
  1376.                             party[player_pokemon].m_speed /= 2;
  1377.                             cout << party[player_pokemon].get_name() << " was paralyzed" << endl;
  1378.                         }
  1379.                         else if ((enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Thunder Wave")  && (party[player_pokemon].get_health() == 1) && (party[player_pokemon].get_type1() != "Ground")  && (party[player_pokemon].get_type2() != "Ground"))
  1380.                         {
  1381.                             party[player_pokemon].m_health = 2;
  1382.                             party[player_pokemon].m_speed /= 2;
  1383.                             cout << party[player_pokemon].get_name() << " was paralyzed" << endl;
  1384.                         }
  1385.                         else if (((enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Sleep Powder") || (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Hypnosis") ||
  1386.                                   (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Sing") || (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Lovely Kiss")) && (party[player_pokemon].get_health() == 1))
  1387.                         {
  1388.                             party[player_pokemon].m_health = (rand() % 6 + 21);
  1389.                             cout << party[player_pokemon].get_name() << " fell asleep" << endl;
  1390.                         }
  1391.                         else if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Seismic Toss")
  1392.                         {
  1393.                             party[player_pokemon].m_hp -= 100;
  1394.                             cout << party[player_pokemon].get_name() << " lost 100 HP" << endl;
  1395.                         }
  1396.                         else
  1397.                         {
  1398.                             cout << "But it failed!" << endl;
  1399.                         }
  1400.                         break;
  1401.  
  1402.                     case 2:
  1403.                         if (substitute>0)
  1404.                         {
  1405.                              if (critical_hit==1)
  1406.                             {
  1407.                               substitute -=floor((floor(floor(floor(42.0*enemy_team[enemy_pokemon].get_atk()*enemy_team[enemy_pokemon].m_moves[enemy_choice].get_power())/party[player_pokemon].get_def())/50)+2)*M*super*2*((rand() % 39) + 217)/255.0)/reflect;
  1408.                              cout << "It was a critical hit!" << endl;
  1409.                             }
  1410.                             else
  1411.                             {
  1412.                             substitute -=floor((floor(floor(floor(42.0*enemy_team[enemy_pokemon].get_atk()*enemy_team[enemy_pokemon].m_moves[enemy_choice].get_power())/party[player_pokemon].get_def())/50)+2)*M*super*((rand() % 39) + 217)/255.0)/reflect;
  1413.                             }
  1414.  
  1415.  
  1416.                              if (substitute<=0)
  1417.                             {
  1418.                                 cout << "Subtitute faded" << endl;
  1419.                             }
  1420.                         }
  1421.                         else
  1422.                         {
  1423.                             if (critical_hit==1)
  1424.                             {
  1425.                               party[player_pokemon].m_hp -=floor((floor(floor(floor(42.0*enemy_team[enemy_pokemon].get_atk()*enemy_team[enemy_pokemon].m_moves[enemy_choice].get_power())/party[player_pokemon].get_def())/50)+2)*M*super*2*((rand() % 39) + 217)/255.0)/reflect;
  1426.                              cout << "It was a critical hit!" << endl;
  1427.                             }
  1428.                             else
  1429.                             {
  1430.                             party[player_pokemon].m_hp -=floor((floor(floor(floor(42.0*enemy_team[enemy_pokemon].get_atk()*enemy_team[enemy_pokemon].m_moves[enemy_choice].get_power())/party[player_pokemon].get_def())/50)+2)*M*super*((rand() % 39) + 217)/255.0)/reflect;
  1431.                             }
  1432.                         }
  1433.  
  1434.                         if (party[player_pokemon].m_moves[your_choice].get_move() == "Counter")
  1435.                         {
  1436.                             counter_power= floor(2*floor((floor(floor(floor(42.0*enemy_team[enemy_pokemon].get_atk()*enemy_team[enemy_pokemon].m_moves[enemy_choice].get_power())/party[player_pokemon].get_def())/50)+2)*M*super*((rand() % 39) + 217)/255.0)/reflect);
  1437.  
  1438.                         }
  1439.  
  1440.                         if ((enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Hyper Beam") && (party[player_pokemon].get_hp() >= 0))
  1441.                     {
  1442.                         cout << enemy_team[enemy_pokemon].get_name() << " needs to recharge" << endl;
  1443.                         enemy_recharge = 3;
  1444.                     }
  1445.  
  1446.                         if (super == 1)
  1447.                         {
  1448.                             cout << "Its normally effective!" << endl;
  1449.                         }
  1450.                         else if (super > 1)
  1451.                         {
  1452.                             cout << "Its super effective!" << endl;
  1453.                         }
  1454.                         else if (super == 0)
  1455.                         {
  1456.                             cout << "It didn't do anything" << endl;
  1457.                         }
  1458.                         else
  1459.                         {
  1460.                             cout << "Its not very effective!" << endl;
  1461.                         }
  1462.                         break;
  1463.  
  1464.                     case 3:
  1465.                         if (critical_hit==1)
  1466.                         {
  1467.                              party[player_pokemon].m_hp -=floor((floor(floor(floor(42.0*enemy_team[enemy_pokemon].get_spc()*enemy_team[enemy_pokemon].m_moves[enemy_choice].get_power())/party[player_pokemon].get_spc())/50)+2)*M*super*2*((rand() % 39) + 217)/255.0);
  1468.                             cout << "It was a critical hit!" << endl;
  1469.                         }
  1470.                         else
  1471.                         {
  1472.                         party[player_pokemon].m_hp -=floor((floor(floor(floor(42.0*enemy_team[enemy_pokemon].get_spc()*enemy_team[enemy_pokemon].m_moves[enemy_choice].get_power())/party[player_pokemon].get_spc())/50)+2)*M*super*(1/t_spc)*((rand() % 39) + 217)/255.0);
  1473.                         }
  1474.                         if (super == 1)
  1475.                         {
  1476.                             cout << "Its normally effective!" << endl;
  1477.                         }
  1478.                         else if (super > 1)
  1479.                         {
  1480.                             cout << "Its super effective!" << endl;
  1481.                         }
  1482.                         else if (super == 0)
  1483.                         {
  1484.                             cout << "It didn't do anything" << endl;
  1485.                         }
  1486.                         else
  1487.                         {
  1488.                             cout << "Its not very effective!" << endl;
  1489.                         }
  1490.                         break;
  1491.  
  1492.                     default:
  1493.                         cout << endl;
  1494.                     }
  1495.                 }
  1496.                 else
  1497.                 {
  1498.                     cout << "It missed" << endl;
  1499.                 }
  1500.             }
  1501.         }
  1502.         if (enemy_team[enemy_pokemon].get_health() >20)
  1503.         {
  1504.             enemy_team[enemy_pokemon].m_health--;
  1505.         }
  1506.         if (confusion==1)
  1507.         {
  1508.             confusion_ctr--;
  1509.             if (confusion_ctr==0)
  1510.             {
  1511.                 confusion=0;
  1512.                 cout << enemy_team[enemy_pokemon].get_name() << " snapped out of confusion" << endl;
  1513.             }
  1514.         }
  1515.  
  1516.     }
  1517. }
  1518.  
  1519.  
  1520. int main()
  1521. {
  1522.     int faster=3;
  1523.     int temp;
  1524.     int battle_on=1;
  1525.  
  1526.     instructions();
  1527.     create_enemy_team();
  1528.     initialize_deck();
  1529.     teambuilder();
  1530.     output_party();
  1531.  
  1532.     while (battle_on==1)
  1533.     {
  1534.         cout << endl;
  1535.         cout << "Your "<<party[player_pokemon].get_name() << "(HP: (" << party[player_pokemon].get_hp() << "/"<< party[player_pokemon].get_max_hp() << ") " <<  (party[player_pokemon].get_hp() * 100.00) / party[player_pokemon].get_max_hp() << "%) is on the field" << endl;
  1536.         cout << "Enemy " << enemy_team[enemy_pokemon].get_name() << "(HP: (" << enemy_team[enemy_pokemon].get_hp() << "/"<< enemy_team[enemy_pokemon].get_max_hp() << ") " <<  (enemy_team[enemy_pokemon].get_hp() * 100.00) / enemy_team[enemy_pokemon].get_max_hp() << "%) is on the field" << endl;
  1537.         if (recharge == 0)
  1538.         {
  1539.             cout << "Choose a move: " << endl;
  1540.             for (int t=0; t<4; t++)
  1541.             {
  1542.                 //deck[15].m_moves[2].get_move();
  1543.                 cout << t << " " << party[player_pokemon].m_moves[t].get_move()<< endl;
  1544.             }
  1545.             cout << "4 Switch to another pokemon" << endl;
  1546.             cin >> your_choice;
  1547.  
  1548.             if (party.size() == 1)
  1549.             {
  1550.                 while ((your_choice > 3) || (your_choice < 0))
  1551.                 {
  1552.                     cout << "Enter a valid number (you can't switch if you are the last pokemon)" << endl;
  1553.                     cin >> your_choice;
  1554.                 }
  1555.             }
  1556.             else
  1557.             {
  1558.                 while ((your_choice > 4) || (your_choice < 0))
  1559.                 {
  1560.                     cout << "Enter a valid number" << endl;
  1561.                     cin >> your_choice;
  1562.                 }
  1563.             }
  1564.  
  1565.             if (your_choice==4)
  1566.             {
  1567.                 your_switch=1;
  1568.             }
  1569.             else
  1570.             {
  1571.                 your_switch=0;
  1572.             }
  1573.             if (your_switch== 1)
  1574.             {
  1575.                 player_switch();
  1576.             }
  1577.         }
  1578.         else
  1579.         {
  1580.             cout << party[player_pokemon].get_name() << " is recharging " << endl;
  1581.         }
  1582.  
  1583.         srand ( time(NULL) );
  1584.         enemy_choice=rand() % 5;
  1585.         if (enemy_recharge==0)
  1586.         {
  1587.         if (enemy_team.size() == 1)
  1588.         {
  1589.             enemy_choice=rand() % 4;
  1590.  
  1591.         }
  1592.         if (enemy_choice==4)
  1593.         {
  1594.             enemy_switch=1;
  1595.         }
  1596.         if (enemy_switch==1)
  1597.         {
  1598.             enemy_r_switch();
  1599.         }
  1600.         }
  1601.         else
  1602.         {
  1603.             cout << enemy_team[enemy_pokemon].get_name() << " is recharging" << endl;
  1604.         }
  1605.         /*
  1606.         else
  1607.         {
  1608.             enemy_choice = enemy_choice + (enemy_pokemon*4);
  1609.         }
  1610.         */
  1611.  
  1612.         if ( (party[player_pokemon].get_speed()*t_speed) == enemy_team[enemy_pokemon].get_speed())
  1613.         {
  1614.             faster = rand() % 2;
  1615.         }
  1616.  
  1617.         cout << endl;
  1618.         if (((party[player_pokemon].get_speed()*t_speed) > enemy_team[enemy_pokemon].get_speed()) || (faster ==1))
  1619.         {
  1620.             your_battlecode();
  1621.             if (enemy_team[enemy_pokemon].get_hp() <= 0)
  1622.             {
  1623.                 cout << enemy_team[enemy_pokemon].get_name() << " fainted" << endl;
  1624.                 if (enemy_team.size() == 1)
  1625.                 {
  1626.                     cout << "You win" << endl;
  1627.                     break;
  1628.                 }
  1629.                 else
  1630.                 {
  1631.                     enemy_death();
  1632.                 }
  1633.             }
  1634.             else
  1635.             {
  1636.  
  1637.                 enemy_battlecode();
  1638.             }
  1639.             if (party[player_pokemon].get_hp() <= 0)
  1640.             {
  1641.                 cout << party[player_pokemon].get_name() << " fainted" << endl;
  1642.                 if (party.size() == 1)
  1643.                 {
  1644.                     cout << "Enemy wins" << endl;
  1645.                     break;
  1646.                 }
  1647.                 else
  1648.                 {
  1649.                     player_death();
  1650.                 }
  1651.             }
  1652.  
  1653.         }
  1654.         else if (((party[player_pokemon].get_speed()*t_speed) < enemy_team[enemy_pokemon].get_speed()) || (faster==0))
  1655.         {
  1656.             enemy_battlecode();
  1657.  
  1658.             if (party[player_pokemon].get_hp() <= 0)
  1659.             {
  1660.                 cout << party[player_pokemon].get_name() << " fainted" << endl;
  1661.                 if (party.size() == 1)
  1662.                 {
  1663.                     cout << "Enemy wins" << endl;
  1664.                     break;
  1665.                 }
  1666.                 else
  1667.                 {
  1668.                     player_death();
  1669.                 }
  1670.             }
  1671.             else
  1672.             {
  1673.                 your_battlecode();
  1674.  
  1675.             }
  1676.             if (enemy_team[enemy_pokemon].get_hp() <= 0)
  1677.             {
  1678.                 cout << enemy_team[enemy_pokemon].get_name() << " fainted" << endl;
  1679.  
  1680.                 if (enemy_team.size() == 1)
  1681.                 {
  1682.                     cout << "You win" << endl;
  1683.                     break;
  1684.                 }
  1685.                 else
  1686.                 {
  1687.                     enemy_death();
  1688.                 }
  1689.             }
  1690.         }
  1691.  
  1692.         if ((counter_power>0))
  1693.         {
  1694.             enemy_team[enemy_pokemon].m_hp -= counter_power;
  1695.             cout << party[player_pokemon].get_name() << " used counter" << endl;
  1696.             if (enemy_team[enemy_pokemon].get_hp() <= 0)
  1697.             {
  1698.                 cout << enemy_team[enemy_pokemon].get_name() << " fainted" << endl;
  1699.                 if (enemy_team.size() == 1)
  1700.                 {
  1701.                     cout << "You win" << endl;
  1702.                     break;
  1703.                 }
  1704.                 else
  1705.                 {
  1706.                     enemy_death();
  1707.                 }
  1708.             }
  1709.             else
  1710.             {
  1711.                 cout << "Counter Failed!" << endl;
  1712.             }
  1713.         }
  1714.  
  1715.         if ((((party[player_pokemon].m_moves[your_choice].get_move()=="Explosion") || party[player_pokemon].m_moves[your_choice].get_move()=="Selfdestruct")) && your_switch==0)
  1716.         {
  1717.             cout << party[player_pokemon].get_name() << " faited!" << endl;
  1718.             if (party.size() == 1)
  1719.             {
  1720.                 cout << "Enemy wins" << endl;
  1721.                 break;
  1722.             }
  1723.             else
  1724.             {
  1725.                 player_death();
  1726.             }
  1727.         }
  1728.         if (enemy_switch== 0)
  1729.         {
  1730.             if (enemy_team[enemy_pokemon].m_moves[enemy_choice].get_move()=="Explosion")
  1731.             {
  1732.                 cout << enemy_team[enemy_pokemon].get_name() << " faited!" << endl;
  1733.                 if (enemy_team.size() == 1)
  1734.                 {
  1735.                     cout << "You win!" << endl;
  1736.                     break;
  1737.                 }
  1738.                 else
  1739.                 {
  1740.                     enemy_death();
  1741.                 }
  1742.             }
  1743.  
  1744.             if (enemy_recharge>0)
  1745.         {
  1746.             enemy_recharge--;
  1747.             if (enemy_recharge==1)
  1748.             {
  1749.                 enemy_recharge=0;
  1750.             }
  1751.             else
  1752.             {
  1753.                 cout << enemy_team[enemy_pokemon].get_name() << " is recharging" << endl;
  1754.             }
  1755.         }
  1756.         }
  1757.         if (recharge>0)
  1758.         {
  1759.             recharge--;
  1760.             if (recharge==1)
  1761.             {
  1762.                 recharge=0;
  1763.             }
  1764.             else
  1765.             {
  1766.                 cout << party[player_pokemon].get_name() << " is recharging" << endl;
  1767.             }
  1768.         }
  1769.         faster=3;
  1770.         your_switch=0;
  1771.         enemy_switch=0;
  1772.         reflect_ctr--;
  1773.         if (reflect_ctr==0)
  1774.         {
  1775.             reflect=1.00;
  1776.             cout << "The psychic shield faded" << endl;
  1777.         }
  1778.     }
  1779.  
  1780.     cout << "GAME OVER" << endl;
  1781.  
  1782.     return 0;
  1783. }
clone this paste RAW Paste Data